Sponsored Content
Operating Systems HP-UX [Solved] a way to tell printer used by configured print queue? Post 302658513 by rwuerth on Tuesday 19th of June 2012 11:01:40 AM
Old 06-19-2012
I had a more complicated script written a long time ago to find out this information,
but after realizing due to VBE's post (thank you VBE) that I could get all the info I
required in one place, I've reworked that into this simple script. Perhaps this will help?

Code:
#!/bin/sh
# hp-ux 11.11
 
# Script will return the IP Address, Model Script and
# the MIO# for all printers configured on the system.
 
# script uses 'eval' to set the variables PERIPH (ip address), MODELSCRIPTNAME
#and PRINTERCFG (mio#) that exist in each printer interface.  If one or more of the
#variables are not found, that information will be left blank, but the printer name
#will be printed.
 
#
# Create Header
#
 
Hptr=PRINTER
HIPA='IP ADDR'
HMOD=Model
HMIO=MIO#
printf '%-10s%-20s%-20s%-10s\n' "$Hptr" "$HIPA" "$HMOD" "$HMIO"
 
IDIR=/etc/lp/interface
 
cd ${IDIR}
 
for ptr in *
do
 if [[ -f $ptr ]]
 then
   # set PERIPH, MODELSCRIPTNAME & PRINTERCFG found in printer interface
   eval $(grep -E "^PERIPH=|MODELSCRIPTNAME=|PRINTERCFG=" $ptr | xargs | tr ' ' ';')
   PRINTERCFG=${PRINTERCFG##*/}
   PRINTERCFG=${PRINTERCFG%%\.cfg}
   printf '%-10s%-20s%-20s%-10s\n' "$ptr" "$PERIPH" "$MODELSCRIPTNAME" "$PRINTERCFG"
   unset -v PERIPH MODELSCRIPTNAME PRINTERCFG
 fi
done
 
cd -


Last edited by rwuerth; 06-19-2012 at 12:03 PM.. Reason: linespacing
This User Gave Thanks to rwuerth For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

Can you set up a networked printer as a local print queue?

Fairly simple question, I think. Still trying to get my head around AIX print queues. Most of our problems seem to stem from print queues going down. This generates help-desk calls when users call up to get their queues started or to get rid of the emails that qdaemon sends them. Looking at... (0 Replies)
Discussion started by: alexop
0 Replies

2. AIX

Printer Queue not getting created

When I try to create first print queue in this system with the command line argument, find the output also... # /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'generic' -D pcl -q 'AR06_Workcenter_32' -h 'AR06_Workcenter_32' -x '9100' 0782-606 /usr/lib/lpd/pio/etc/piomgpdev: Error 'A file or... (1 Reply)
Discussion started by: giribt
1 Replies

3. AIX

Check printer queue on Windows printer server

Hello Let me first give a small overview of the setup. All printers are connected to Windows 2000 servers. There are a lot of UNIX (AIX & HP-UX) servers as well which have SAP running. I'm working on a script to add printers to a specified SAP instance. I want to verify the user input (to... (0 Replies)
Discussion started by: NielsV
0 Replies

4. AIX

Problem with Queue of the Printer

Guy's This is the Queue of the printer ... >lpstat -pTOPPRINTER Queue Dev Status Job Files User PP % Blks Cp Rnk ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- --- TOPPRIN @TOPP DOWN QUEUED ... (1 Reply)
Discussion started by: ITHelper
1 Replies

5. HP-UX

[Solved] Problem creating print queue HP-UX -to- HP4100N

Hi all, I am new to HP-UX, using SAM I cannot make a print queue on my test server. From my test & live server as the user required and as root I can ping my printer. I have tried to clone the test print queue using the exact same options use on my live system that prints just fine. Can anyone... (9 Replies)
Discussion started by: KmJohnson
9 Replies

6. Shell Programming and Scripting

print all configured nics in one line with awk?

Hi all: I need to print all configured nics in one line with "|" separating them. So I use netstat -i since it don't mess with subinterfaces (work like I want) so with + cut + tail I get rid of the superfluous data netstat -i |cut -f 1 -d" " |tail +3 this gaves me e1000g1 e1000g2 Then ... (4 Replies)
Discussion started by: rbadillarx
4 Replies

7. UNIX for Advanced & Expert Users

[Solved] remove all print jobs from a print queue

Hello, Sometimes i need to clear all the jobs of a print queue and it is really annoying to cancel one by one. Is there a way to cancel all print jobs for a specific print queue with a single command instead of cancelling them one by one? My AIX system is 5.3 Thank you for your attention (2 Replies)
Discussion started by: omonoiatis9
2 Replies

8. AIX

Get details of the existing configured printer

I need to get the domain under which a printer is configured in an AIX machine. I have the IP address of the printer. Could you please help me with that? (3 Replies)
Discussion started by: Pandee
3 Replies

9. UNIX for Dummies Questions & Answers

Printer queue not clearing

Hi I have installed an HP X451dw printer on our network and want to print from Sco Openserver v6 The printer produces correct output but then repeats until the queue is manually stopped. :confused: It is using a netcat/dumb interface Any advice on how to persuade it to only print once... (5 Replies)
Discussion started by: David Holmes
5 Replies

10. UNIX for Beginners Questions & Answers

Remote print from SLES (SAP) to AIX 7.1 04 sp2 virtual printer queue gets down

Hello Administrators. I have a bit difficult problem. I have local virtual printer that has backend defined in /etc/qconf to script which in turns sends the spool to the real device. whenever I print locally (from sap) the print works as it should. The printer queue after the print is done... (6 Replies)
Discussion started by: Deneth
6 Replies
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy