- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: check status for printer
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
Discussions
Discussions
Discussions
Forums
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
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
тАО03-15-2009 12:44 AM
тАО03-15-2009 12:44 AM
i want to write a small script which will check the printer status and if status is disable it will enable and send me email.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2009 09:07 PM
тАО03-15-2009 09:07 PM
Re: check status for printer
enable
disable
if you want to get email you should have install sendmail in your hpux box.
for writting script i believe you can try with sell script in hpux, logic should be declair printer alias, and with if condition check the status for printer, at present i dont have any script but should try something this.
this may help.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2009 09:31 PM
тАО03-15-2009 09:31 PM
Re: check status for printer
Use lpstat -t
The "lpstat" command with the "-t" option gives you total information about the printer status. This option is generally the most useful, but the printout can be lengthy if you have a large number for printers configured.
From the output of the above command you can write a script as per your requirment.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2009 10:14 PM
тАО03-15-2009 10:14 PM
Re: check status for printer
commands looks ok, but if will get some script then will be good,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2009 08:03 AM
тАО03-17-2009 08:03 AM
Solutionyou may try something below, if its work ok then add sendmail to get email, let us know how it goes, thanks,
printer=hplaserjet
printerstatus=`lpstat -p\`echo $printer\`|awk {'print $5'}`
if [ $printerstatus!= "enabled" ]
then
enable $printer
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 07:28 PM
тАО03-18-2009 07:28 PM
Re: check status for printer
its shows printer satatus and also able to enable it.
how to get email when it enable? i am trying with sendmail, anyone can guide me for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 08:56 PM
тАО03-18-2009 08:56 PM
Re: check status for printer
Just change it to:
if [ $printerstatus != "enabled" ]; then
enable $printer
echo "printer enabled" | mailx -s "Enabling printer: $printer" mail@foo.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 09:46 PM
тАО03-18-2009 09:46 PM
Re: check status for printer
sendmail -F printername abcd@domain.com /etc/message.txt
here message.txt is the message which you want to send when printer will enable.
so here this sendmail line you need to write for each and every printer, hope this will help, let us know, thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 09:54 PM
тАО03-18-2009 09:54 PM