1832978 Members
2947 Online
110048 Solutions
New Discussion

Failover print queue...

 
SOLVED
Go to solution
Hazem Mahmoud_3
Respected Contributor

Failover print queue...

I need help on developing something that I'm not sure is possible or not under HP-UX. We have a primary line printer (connected to network through a jet direct print server) so basically it has it's own IP. We have another backup line printer that is also connected to a jet direct print server with it's own IP.
They both have different queue names, but I want to make it so that if the primary fails, the backup can take over.
I was looking through HPDPS, and it looks like I can do it there, but nothing seems to be configured there. Would I have to reconfigure both printers again in that area? Anyone did this sort of thing before, and did you use HPDPS? Another option I was thinking of was to use lpmove. I believe that would work as well. Ideas, feedback, comments? Thanks!

-Hazem Mahmoud
5 REPLIES 5
MarkSyder
Honored Contributor

Re: Failover print queue...

The first thing that springs to my mind is putting the two printers in the same class. This means that every print job would go to whichever of the printers happened to be free, rather than the primary one, but it may be worth considering.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Jeff Schussele
Honored Contributor
Solution

Re: Failover print queue...

Hi Hazem,

Well you *could* use a printer class, but that won't be a failover per se. But it would allow jobs to print on ptrB when ptrA is unavailable.

lpadmin -pptrA -cclass_name
lpadmin -pptrB -cclass_name

will add them both to the same class w/o having to recreate.

Then one sends the print jobs to the class..

lp -dclass_name file_to_print

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Hazem Mahmoud_3
Respected Contributor

Re: Failover print queue...

Jeff,
So what you're saying is if I have all my jobs set to "lp -d ", then I would have to change them to "lp -d "?
If that's the case, then that probably won't be an option. We have hundreds of jobs that are set up to print to lp -d that it would take hours to change each one. Do I need to specify the class name if I put them both in the same class?
Thanks!

-Hazem
Diego Calvo
Occasional Advisor

Re: Failover print queue...

Hi Hazem.
There are another possibility. You could change the name of the printer queue to a new name, from PtrA to PtrC, and after that change the Class name to PtrA, so you don't need to change anything an your current configuration.
Bill Hassell
Honored Contributor

Re: Failover print queue...

Yes, in order to use a print class, you must use the name of the printer class rather than the name of the individual printer. Note that the printer name is more appropriately called a printer queue name. However, it's very easily solved by removing the primary printer and adding it back with a different name such as prna, add your backup printer as prnb, and then use lpadmin -c to create a class for the two new printers where the class name is the name you use for printing.

While that should work OK, the lp spooler is very primitive when it comes to monitoring. The hpnpf program is the actual code that talks to the printer so you'll have to test whether that program will detect a paper jam or out of paper on non-responsive printer and returns a non-zero return code. If it does, then the prna queue will be disabled and the class will choose the next printer. NOTE: If two or more jobs are sent to the class at the same time, both printers will be printing since a print class is designed as a load sharing feature.

If hpnpf doesn't disable the printer, you'll need to edit the generic interface script to run hpnpadmin to check on the printer, perhaps every minute and then issue a disable for the problem printer. If the load sharing feature of the class is not desirable, you can write code into the interface script that changes the IP address in the script once it becomes disabled, then re-enable the same printer, but now with a new IP address.

The script would have to use mailx to notify sys admins that a switch has occurred, then allow for a special lp -o option to trigger the printer script to finish the current job, disable the printer queue, change the address back to the old printer and re-enable again.

I woulod not try to use HPDPS for this task.


Bill Hassell, sysadmin