Operating System - HP-UX
1821188 Members
3432 Online
109631 Solutions
New Discussion юеВ

Re: How does HPPI determine printer model ?

 
SOLVED
Go to solution
exec22
Occasional Advisor

How does HPPI determine printer model ?

I am trying to write a script to simulate the functionality of hppi interface. I tried putting "set -x" lines all arund the scripts it utilized but I could not figure out what kind of script/command gets executed so that, hppi determines the printer type and decides (how ??) if we have the right model script for this printer in the repository or not.

what I need is actually in the lines of this (semantically not code)

read printer_ip_address
model=`poll printer_ip_address`
if model exists in available model scripts
then
install printer with available script
else
give an error message
fi


In this construct, I do not know how can I determine the model as a result of not knowing how to poll this ip address.

Also once I have the correct printer model, how do I verify if I have the correct model script on my server or not ?
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: How does HPPI determine printer model ?

Look in the /opt/hpnpl/admin/getgoodpname script. I warn you it's ugly.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: How does HPPI determine printer model ?

hppi has a set of different scripts that perform the tasks. However, the 'best' printer script is a table--there is no direct method to take the dozens of printer models and pick the right model. Because the most recent models of printers are virtually the same, there is one general script that handles current models: net_ljx000. The choice of model script is not that critical. Only the very oldest printer (Laserjet I, II, III, IV) require a simpler script. The main reason is that prior to the LaserJet 4Si, these early printers did not understand PJL, the job control language which implements features like tray selection.

If you need to create a command line interface to automate printer installation, it's already done: addqueue (and removequeue, modifyqueue) which can be found in /opt/hpnpl/bin. Check the man pages for addqueue for a non-interactive (and very fast) methid to add a JetDirect printer.


Bill Hassell, sysadmin
Marlou Everson
Trusted Contributor
Solution

Re: How does HPPI determine printer model ?

You might do something like this to get the model.

hpnpadmin -i printer_ip_address | grep -e MODEL -e MDL

You'll have to figure out how you want to pull the model info from the MDL line (cut, awk, etc.). The text does not appear to be consistent. That would be too easy.

The addqueue -l command will give you a table of printers and their related models that you can use to verify if you have a model script available. Or you could use it to build your own table.

I just downloaded a script for a new printer we just installed. I used www.hp.com/pond/modelscripts/index2.html. These are mostly LaserJet scripts.

Hope that helps,
Marlou
Raj D.
Honored Contributor

Re: How does HPPI determine printer model ?

Hi Exec22 ,

You can cheeck this for , supported printer models with their printer ID, and model_string ,

# cd /opt/hpnpl/bin
# addqueue -l



Also to add a printer, you can use:
# addqueue -i -q -h
( hostname to be include in /etc/hosts file )

-----
usages: addqueue [-c class] [-d] [-i printerID]
-q queuename -h hostname [-p port] [-s]
[-r on/off] [-t on/off] [-b on/off] [-L PS/PCL/HPGL/HPGL2/AUTO]
[-P 1/2/3] [-T 1/2/3] [-m banner papersize] [-D on/off]
addqueue -l
----------------------

Cheers,
Raj .
" If u think u can , If u think u cannot , - You are always Right . "
Geoff Wild
Honored Contributor

Re: How does HPPI determine printer model ?

Models are in:

cat /opt/hpnpl/admin/PrinterList

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
exec22
Occasional Advisor

Re: How does HPPI determine printer model ?

Thanks for all the answers