- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script for resetting the printers after paperjam
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
02-14-2005 09:09 PM
02-14-2005 09:09 PM
Victor
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2005 09:49 PM
02-14-2005 09:49 PM
Re: Script for resetting the printers after paperjam
can't you give the users a restricted SAM session to do the work themselves.
They would only have access to the printer submenu and could reset the queues.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2005 10:14 PM
02-14-2005 10:14 PM
Re: Script for resetting the printers after paperjam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2005 11:01 PM
02-14-2005 11:01 PM
Solutionif you are going to use the cron solution something like this may help:
cancel -e `lpstat -a | grep -e "not accepting" | cut -f1 -d' '`
Explaination:
cancel -e : empties all queues on a printer
lpstat -a : acceptance status of lp destinations
grep : filters the output for failed printers
cut : extracts the printer name
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2005 11:31 PM
02-14-2005 11:31 PM
Re: Script for resetting the printers after paperjam
So here is the problem: There are 10 jobs queued for the printer. A user sees that they are printing junk and turns off the printer. Depending on the connection, the printer may get disabled. So an automatic re-enable will start printing the junk from the beginning. If a script clears the queue, then users will call saying that the printer isn't working, and will keep sending the same print requests over and over again.
There are just too many scenarios to adequately script a simple solution. Now modern HP LaserJet printers have a cancel feature. What this does is to absorb the entire print job and do nothing, then start printing the next job. The spooler thinks all is well and continues. This is probably the best solution although it may mean replacing a lot of printers.
Otherwise, the script will have to be smart enough to cancel the current job and enable the printer. You'll still have printer issues with untrained users.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 12:14 AM
02-15-2005 12:14 AM
Re: Script for resetting the printers after paperjam
You could use Exceed to give them a SAM interface, but if you have a lot of users that could get a little expensive. I can describe some of the steps using exceed if you like. I used it at my last job.
You could more cheaply set up a batch file on their desktop that initiated a telnet session to the UX server. Give them an ID that immediately starts a restricted SAM interface and then kicks them out when they exit. Of course you will not have any guarantee that they won't purge someone else's jobs from a different queue.
You may have to do some scripting regardless. If you provide some more details, I'm sure there's someone who can provide some sample scripts if I can't.
Good luck,
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 12:20 AM
02-15-2005 12:20 AM
Re: Script for resetting the printers after paperjam
just a thought
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 01:57 AM
02-15-2005 01:57 AM
Re: Script for resetting the printers after paperjam
Log this into an array and if counter is reached do
disable $prnt
cancel $prnt
lpshut
lpstart || logger -p crit "Spool DID NOT come up"
enable $prnt
reset counter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 04:10 PM
02-15-2005 04:10 PM
Re: Script for resetting the printers after paperjam
thanks for the respones, will assign points before I close the thread. Peter , I would like something like the script you sent me but i would like something like a IF and THEN kind of script where I can query just a few of my 100 odd printers every 5 mins.. I feel lpstat -a every 5 mins would be a bit of a load on the system , hence my approach. The algorithm would be something like
If $printerA is down/not accepting
then
{ Cancel -e $printerA
Enable $printerA
Accept $printerA
}
and so on for all 5 printers.
We are trying to avoid having a 24/7 Support group.
A script for the above algorithm would best suit my organisation.
Thanks again
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 08:49 PM
02-15-2005 08:49 PM
Re: Script for resetting the printers after paperjam
for a FIRST draft see attachment.
Any comments/suggestions for improvement.
Let us know if you need further assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 09:05 PM
02-15-2005 09:05 PM
Re: Script for resetting the printers after paperjam
"check the length of the data"
and
else " one datastring is null length"
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 09:25 PM
02-15-2005 09:25 PM
Re: Script for resetting the printers after paperjam
check the length of the data:
check that the printer name passed on the command line is > 0 characters and also that the printer name given is return by the lpstat command (i.e. the printer is marked as not accepting)
one data string is null length:
Message if the above check fails
Regards