- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Printer Information
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 02:02 AM
10-18-2005 02:02 AM
1. Provide a list of printers that are currently defined on this server that either:
a) are no longer valid;
b) are offline;
c) cannot be pinged.
I'm not experienced at scripting. Is there an easy way to get this information. I had planned to use lpstat -p and use all the printers that are disabled to satisfy this request. Any other ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 05:16 AM
10-18-2005 05:16 AM
Solution#!/bin/sh
#
# check printer status
# Geoff Wild
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "lpst \"printer\""
echo "Example:"
echo "lpst W052"
exit 1
fi
echo " "
/usr/sbin/ping $1 -n 2
echo " "
lpstat -p$1 -v$1
echo " "
echo "Output Requests"
echo "-----------------------------------------------------------"
lpstat -o$1
echo " "
lpstat -r
echo " "
Example:
lpst W052
PING myprinter.mydomain.com: 64 byte packets
64 bytes from 192.168.2.101: icmp_seq=0. time=7. ms
64 bytes from 192.168.2.101: icmp_seq=1. time=7. ms
----myprinter.mydomain.com PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms) min/avg/max = 7/7/7
printer W052 is idle. enabled since May 14 10:00
fence priority : 0
device for W052: /dev/null
Output Requests
-----------------------------------------------------------
no entries
scheduler is running
To tell if it is offline:
hpnpadmin -v PRINTQUEUENAME
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 05:44 AM
10-18-2005 05:44 AM
Re: Printer Information
==============================================================
lpstat -p | grep -v priority | awk '{print $2}' | while read PRINTER
do
IP=`cat /etc/lp/interface/$PRINTER | grep PERIPH= | awk -F = '{print $2}' | grep -v MODEL`
ping $IP -n 1 > /dev/null 2>&1
if [ $? = 0 ]
then echo "I can ping $PRINTER"
else echo "I cannot ping $PRINTER"
fi
done
==============================================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 05:51 AM
10-18-2005 05:51 AM
Re: Printer Information
Could it be maybe a firewall or something that is preventing me from pinging?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 06:44 AM
10-18-2005 06:44 AM
Re: Printer Information
If they're on the same subnet then I'd suspect a connectivity problem with those particular printers.
If they all seem to be on the same subnet, I'd start looking for either a routing issue or something missing from network configuration.