+ Post New Thread
Results 1 to 7 of 7
Web Development Thread, Pulling Data from Printer Web Interface in Coding and Web Development; Hi In the school I work at, the printers all have web interfaces that are accessible by a browser. I've ...
  1. #1

    Join Date
    Oct 2013
    Posts
    43
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile Pulling Data from Printer Web Interface

    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!

  2. #2

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,794
    Thank Post
    517
    Thanked 2,468 Times in 1,912 Posts
    Blog Entries
    24
    Rep Power
    835
    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.

  3. #3

    Join Date
    Oct 2013
    Posts
    43
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.
    Last edited by jamwatn; 7th March 2014 at 10:27 AM.

  4. #4

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,794
    Thank Post
    517
    Thanked 2,468 Times in 1,912 Posts
    Blog Entries
    24
    Rep Power
    835
    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.

  5. #5

    Join Date
    Oct 2013
    Posts
    43
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Ah brilliant, I'll see how I get on with that..thanks!!

  6. #6

    Join Date
    Oct 2013
    Posts
    43
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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?

  7. #7

    Join Date
    Nov 2012
    Posts
    34
    Thank Post
    1
    Thanked 5 Times in 4 Posts
    Rep Power
    4
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Pulling Information from the My Planner Web Part of SLG
    By fawkers in forum Virtual Learning Platforms
    Replies: 0
    Last Post: 23rd November 2010, 12:23 PM
  2. Writing a custom app to pull data from SIMS?
    By robinm in forum MIS Systems
    Replies: 8
    Last Post: 17th September 2009, 08:24 AM
  3. HP Printer web-interface over HTTPS
    By contink in forum Hardware
    Replies: 8
    Last Post: 29th April 2008, 09:06 PM
  4. VMWare web interface address
    By Dos_Box in forum Thin Client and Virtual Machines
    Replies: 2
    Last Post: 6th April 2006, 10:26 AM
  5. Recover data from broken RAID 0 array
    By indie in forum Hardware
    Replies: 23
    Last Post: 8th February 2006, 10:42 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •