jamwatn Posted March 7, 2014 Posted March 7, 2014 Hi In the school I work at, the printers all have web interfaces that are accessible by a browser. I've made a simple HTML page that has a list of printers on the left hand side. Each printer is a link that loads the printer's interface onto the right hand side of the page in a simple i-frame. This allows me to go through each printer and check the ink levels as they are displayed on the right. There is a 'fuel gauge' and a message 'toner is empty' etc for each one. I was wondering how easy/or difficult it would be to simply pull the 'toner is empty' message from the printer and have it load up next to the list, rather than clicking on each printer? The Web interface is a CGI file and after scouring through the code, I can't work out how the 'toner is empty' message is displayed? Any suggestions or advice on how to achieve this, or a similar system would be most helpful, thank-you!
localzuk Posted March 7, 2014 Posted March 7, 2014 I'd say that scraping the data is probably not the best way of going about this. Instead, I'd suggest using something which grabs the data via SNMP. There are a few options such as HP's Web Jetadmin (Web Jetadmin software | HP® Official Site) - it can work with HP and non-HP gear. You could also look at something like Nagios (Nagios Core - Nagios) which will do it too, but it is a more general network monitoring tool and a bit fiddly to set up. Another option is a tool like Papercut. It isn't free, but it is a full printer management package.
jamwatn Posted March 7, 2014 Author Posted March 7, 2014 (edited) Ok well I'm only pretty new so am learning how things work at the minute! We do use papercut so that is an option I suppose, only you have to log on to the server to view the toner status on the papercut admin browser. There must be a way I can view that locally though perhaps? I only thought simple HTML because its the basics of what I know. Edited March 7, 2014 by jamwatn
localzuk Posted March 7, 2014 Posted March 7, 2014 You don't need to go to the server to view the papercut admin tool. It is accessible via any browser on your network, or should be. Ours is via http://print:9191/admin - you just replace print with the name of your own server. You may need to allow it through the firewall on the server.
jamwatn Posted March 7, 2014 Author Posted March 7, 2014 Ah brilliant, I'll see how I get on with that..thanks!!
jamwatn Posted March 19, 2014 Author Posted March 19, 2014 An update. This is fairly good, however sometimes you find that you get a printer with no remaining toner and it doesn't appear in the list. Is there another solution to my issue?
m1k3r Posted April 1, 2014 Posted April 1, 2014 Sorry to revive an old thread. For fetching information about printing for users and devices if you are running Papercut, they offer an extensive API which allows you to query Papercut directly and return results. I've used this to create custom time outs for print jobs held in the queue depending on which user sent the job. Details: PaperCut KB | External System and Integration APIs For getting information directly from a network attached printer you can use the Simple Network Management Protocol (SNMP) - a simple example with Python using snmpget from a Linux machine. ################################################# #!/usr/bin/env python import os Printers = ["192.168.1.1", "192.168.1.2", "192.168.1.3"] isoName = "iso.3.6.1.2.1.1.6.0" isoErrors = "iso.3.6.1.2.1.43.18.1.1.8" isoPageCount = "iso.3.6.1.2.1.43.10.2.1.4.1.1" for Printer in Printers: command = "snmpget -v 1 -c public " + Printer + " " + isoName prnName = os.popen(command).read() prnName = prnName[prnName.find(":")+1:] prnName = prnName.replace('"', "") print prnName ################################################## The above Python script will query each printer IP in the printer array and return the network name as set on the printer. You can use this for any other available value, such as errors, toner levels and page counts. We use this same method to monitor toner levels and tray status for all of our printers from a simple webpage.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now