Operating System - HP-UX
1821645 Members
2856 Online
109633 Solutions
New Discussion юеВ

Knowing Printer ON/OFF status

 
devhariprasad
Advisor

Knowing Printer ON/OFF status

We have configure a printer which is up and running in our HP-UX OS and enabled it.

Suppose if the printer is switched off, we want to know that through some command(or something else) about the printer's ON/OFF status.

Will it be possible.

Please help me.
6 REPLIES 6
Rita C Workman
Honored Contributor

Re: Knowing Printer ON/OFF status

This isn't fancy...but couldn't you just cron a very simple script to do a 'single -n 1' ping and output to a file, then check the file and grep for either the IP of printer or if any packets were received. If no IP or 0 packets received, send email.

Just a thought,
Rita
spex
Honored Contributor

Re: Knowing Printer ON/OFF status

Hi,

# lpstat -p

PCS
Zinky
Honored Contributor

Re: Knowing Printer ON/OFF status

Namaste,

Unless you are using the printer's "proper" UNIX/Linux software suite - there is NO reliable way for UNIX/Linux to find out the true status of the printer much more about its "power status - be it off or energy saving mode".

I always use Jetdirect Software for HPs. Most other printer vendors provide UNIX printing software i.e. Xerox - xpadmin, QMS - CrownNet, LexMark - LexPrint, etc...

Using these software, the LP subsystem actually has a better idea on things like (1) proper resumption of the queue once physical issues on the printer are resolved (2) proper wake up of printers from hibernation/power-saver mode (3) power saver mode no longer "downs" the queue (4) better reporting on the true status of the printer -- i.e. toner low, paper out, jams, etc...


If you have several machines that have printing requirements - then I suggest you set up one machine to at as print server. Only on this machine you will need to install the software. The clients can then just print through this print server.

Hope this helps you and others willing to be helped...

;^)
Hakuna Matata

Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
Bill Hassell
Honored Contributor

Re: Knowing Printer ON/OFF status

There is no simple answer because there are so many ways that a printer can be defined to HP-UX:

If the printer is directly connected by a serial or parallel port to your computer, about the only way is to look at the printer since it is next to the computer. There are THOUSANDS of printer models with HP being the largest printer vendor by far. However, even with an HP printer, there are several designs with no standard way to query every possible model.

If the printer is not connected to your computer but is instead connected to another computer which is acting as a 'print server', this is the worst situation because the protocol (lpr/lpd or RFC 1179) has no remote status capability and you are forced to query the printer's status on the print server (if possible).

If the printer is directly connected to the network, things get better. For non-HP printers that have their own internal LAN card, the protocol is (unfortunately) the same lpr/lpd protocol with no status. With some clever network socket programming, you might be able to determine if the printer is turned off, busy with another connection or has some problem.

If the printer uses an HP LAN card (called a JetDirect card), you have a very nice program to query the state of the printer. It is called hpnpadmin and is part of the HPPI (HP Printer Installer) product. There are more than two dozen options including one that reads the front panel of the printer and displays it for you (like OUT OF PAPER or PAPER JAM or TONER LOW). Note that if the printer is no responding to a query, you cannot determine if the printer is turned off, the network cable was removed, or a network configuration is preventing communication.

As you can see, the only practical method for printer status is using an HP printer with an HP LAN card, or any other printer using an HP External JetDirect adapter.


Bill Hassell, sysadmin
Zinky
Honored Contributor

Re: Knowing Printer ON/OFF status

Bill,

Other printer vendors actually have their own JetDirect or HPNP like software for their own Printer LAN Card (aka Print Server Cards) and they equally are just as effective or even better than the ages old (but still being improved JetDirect software)

Prasad, let me know what kind of printer you're using and I can lead you to the "proper" software you need to use.

My shop "probably" is one of the biggest UNIX based enterprises on the planet that deals with practically thousands of printers of many different flavours. And we've come to a conclusion that using the printer's native JetDirect Software or the like makes for the most robust printing infrastructure.

Hakuna Matata

Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
devhariprasad
Advisor

Re: Knowing Printer ON/OFF status

The replies have been very useful.