The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Solaris 8 setup remote printer queue help miredale UNIX for Dummies Questions & Answers 2 11-03-2008 07:33 PM
Find IP Address of a Printer Q in Hp-Unix lenin1985 UNIX for Advanced & Expert Users 1 06-10-2008 11:02 AM
Printer Queue not getting created giribt AIX 1 01-17-2008 03:25 AM
Help adding a printer queue AQG HP-UX 0 09-05-2007 05:17 PM
Can you set up a networked printer as a local print queue? alexop AIX 0 06-28-2006 12:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-10-2008
lenin1985 lenin1985 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
Identify IP address of a printer Queue in HP-Unix

Hi ,
Could anyone help me out the way to figure out the IP Address of a remote printer queue with its printer queue name information.

I badly need this information
  #2 (permalink)  
Old 06-11-2008
bdittmar bdittmar is offline
Registered User
  
 

Join Date: Mar 2008
Location: Germany
Posts: 32
Sam

Quote:
Originally Posted by lenin1985 View Post
Hi ,
Could anyone help me out the way to figure out the IP Address of a remote printer queue with its printer queue name information.

I badly need this information
Hello,

Use Sam or information in /etc/hosts

Regards
  #3 (permalink)  
Old 06-11-2008
nua7 nua7 is offline
Registered User
  
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 353
Check the /usr/sam/lbin/lpmgr file for this. Yhe following script would give you an idea, on what files should be exactly checked.

This is used to add a printer on HP-UX systems.


Code:

=================================================
#!/usr/bin/sh
###############################################################################
#
#  Script:   add_printer
#
#  Purpose:  add remote printer for claims systems
#
#  Author : nua7
###############################################################################

basename=${0##*/}
export PATH=$PATH:/usr/sbin:/claims/amxw/SYS2/BIN
trap 'print "$basename: Unexpected rc $? at line $LINENO"; exit 1' ERR # exits script for any non-zero return-code

trap '
#
# command to clean up on any script exit, any rc value
#
  # start lp scheduler if necessary
  if lpstat -r | grep -q "scheduler is not running" ; then
    /usr/sbin/lpsched > /dev/null
  fi

' EXIT
#   function to display usage message and exit
#
function usage
{
  print "Usage: $(basename $0) printer_name printer_queue print_server"
  print
  print "Description:"
  print "  Add a printer definition to the AMXW MPE-emulation environment."
  print
  print "Parameters:"
  print "    printer_name   local name for printer (ex. L101)"
  print "    printer_queue  queue name on print server"
  print "    print_server   name of network print server"
  print
  print "Example:"
  print "    $(basename $0) L101 pcl299 nvbqxyz"
  exit 1
}


#
#  variable definitions
#

  if [[ $# -ne 3 ]]; then
    usage
  fi
  localname=$1
  remotename=$2
  remotesystem=$3

# # # # # # # # # # # #
#     main section
# # # # # # # # # # # #

  # validate that printer does not exist
  if lpstat -s | grep -q "device for $localname:" ; then
    print "ERROR: printer $localname already exists - cannot add"
    exit 1
  fi

  typeset -uL1 ANS
  print "Verify if this remote queue and print server already in use"
  print
  if /usr/sam/lbin/lpmgr | grep "$remotename on $remotesystem" ; then
      print
      print "WARNING: this remote queue/print server combination already in use"
      print "         on this system (see above)"
      print
      print -n "Continue building this queue? <n> "
      read ANS
      if [[ "$ANS" != "Y" ]]; then
          print
          print "Exiting add_printer without building queue"
          print
          exit 0
      fi
  else
      print "    not in use ... continuing"
  fi

  # stop lp scheduler if running
  if lpstat -r | grep -q "scheduler is running" ; then
    /usr/sbin/lpshut > /dev/null
  fi

  echo
  echo ">>> adding \"$localname\" for $remotename on $remotesystem"
  # Performing task "Add Remote Printer":  Adding "$localname"
  if [[ $(echo $remotename | grep  null | grep -v grep | wc -l) -gt 0 ]] ; then
    /usr/sbin/lpadmin -p$localname -v/dev/null -g0  -mPCL5
    /usr/sam/lbin/lpmgr -e -xlocalname=$localname
    #/usr/sbin/accept $localname
    #/usr/bin/enable $localname
  else
    /usr/sam/lbin/lpmgr -a -xlocalname=$localname,default=n,fence=2,rc=n,is_bsd=n,remname=$remotename,remsys=$remotesystem,remcancel=rcmodel,remstatus=rsmodel 2>/dev/null
    /usr/sbin/lpadmin -p$localname -orm$remotesystem -orp$remotename -mrmodel -v/dev/null -ocmrcmodel -osmrsmodel
  fi

  # start lp scheduler to ensure validation in next step succeeds
  if lpstat -r | grep -q "scheduler is not running" ; then
    /usr/sbin/lpsched > /dev/null
  fi

  echo
  echo '>>> validating new device - please review output'
  lpstat $localname

  # add device to DEVICES.PUB.SYS as necessary
  if print $localname | grep -q ^[A-Z] ; then
    # MPE-oriented printer - add to DEVICES file if it exists
    if [[ -f /claims/amxw/SYS/PUB/DEVICES ]]; then
      if ! grep -q "PRINTER  $localname" /claims/amxw/SYS/PUB/DEVICES ; then
        LDEV=$(get_new_ldev)
        add_new_ldev "$LDEV PRINTER  $localname $localname"
      fi
    fi
  fi

# # # # # # # # # # # #
#  script complete
# # # # # # # # # # # #
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0