http://qs321.pair.com?node_id=814086


in reply to Getting statistics from an attached device (printer)

(Repost due to DB hiccups, twice)

Scraping the GUI using WWW::Mechanize is likely the easiest path, especially as you've already looked at the stuff that gets sent using the Live HTTP Headers.

Alternatively, I'd sniff the whole network traffic using Wireshark and see what SNMP packets get sent, and if any of these belong to the HP namespace.

  • Comment on Re: Getting statistics from an attached device (printer)

Replies are listed 'Best First'.
Re^2: Getting statistics from an attached device (printer)
by bobf (Monsignor) on Dec 23, 2009 at 16:28 UTC

    Thanks for the input, Corion. I am not opposed to writing a scraper, but since there is a multi-step manual process to generate the page(s) I'd prefer to investigate other options first. In addition, not all of the information that I want is presented on the pages so it would not be accessible.

    I'll definitely put Wireshark in my back pocket. I have no prior experience using a packet sniffer so there would likely be a learning curve.

    I've done some more reading on SNMP and I installed a few related modules from CPAN. I am starting to think that might be the most efficient route. The trick now is finding out what variables to request from the printer.

Re^2: Getting statistics from an attached device (printer)
by eye (Chaplain) on Dec 24, 2009 at 07:09 UTC
    SNMP::NPAdmin might be helpful in pursuing an SNMP approach.

    I've used Wireshark to avoid understanding overly convoluted web pages. It turned out to be far easier than I expected. It will help to filter on the IP address of the printer either in capturing transactions or in analyzing them. Once you know what requests are being made, you may find wget to be useful to test requests that the GUI application won't generate.

      SNMP::NPAdmin is one of the several modules that I am investigating (and the most promising, by the way). Unfortunately the PPM installation failed and when I used the manual approach (nmake) it broke on the space in "Program Files"*. I will pursue the installation issue when I return after the holidays. In the meantime, I think I will install Wireshark on my laptop and give it a test drive.

      If anyone has any ideas about how to determine which MIB is used by this printer, I'd really appreciate it. My efforts have been unsuccessful thus far and I will need the variable names (or OIDs) to make calls to NPAdmin.

      *This is a huge pet peeve of mine, given Windows' finicky shell quoting and the difficulty of third party software to handle it correctly. Why "they" decided to put a space in the name of the root directory used for programs is beyond me.</rant>