G
Guest
I'm using VB.NET 2005 (with a little c#)
Before printing a document my app need to know if the printer
is functioning. A paper jam, low on toner etc could have knocked
the printer out. I'm trying two approached to this: WMI and SNMP.
(BTW the printer is attached using its network interface. )
WMI
I can get the PrinterStatus (and ExteandedPrinterStatus) I think WMI
is working at the print spooler level. If I turn the printer off WMI still
reports status 3 (OK) when clearly the printer is unavailble, but ot
course the printer spooler system does not know this until a print
is attempted. If I then print a test page, after 30 seconds the spooler
gives up. At this point WMI will report status 1.
If I pull the paper tray on the printer so its "out of paper" and print
the following happends. WMI status goes to 4 (printing) while
print job briefly shows in queue then returns to 3. I guess
WMI is quite corrent, the print job has been sent to the print
which has placed it in its own internal queue awaiting more paper.
The upshot of this, I think, is that I'll have to talk firectly to the printer
hence my trip to SNMP land.
SNMP
Last month experimenting with another printer I got as far as
finding a Status field amoungst hunderds of other fields. It seemed
to be updated in a timely manner. To get that far I had to download
a trial version of a SNMP manager program and to find a MIB file
for the printer.
Today I've been examining a c# SNMP class (from www.c-sharpcorner.com) and
trying to find a MIB suitable for an HP 2605DN printer.
Questions:
1. Is SNMP the way to go ?
2. Do I need a MIB for the HP or is there some standard MIB
3. What would be the simplest means for my app to talk the
the SNMP agent(HP printer) the c# class is throwing exceptions.
As usual I don't have much time to look deeply into these areas.
M.
Before printing a document my app need to know if the printer
is functioning. A paper jam, low on toner etc could have knocked
the printer out. I'm trying two approached to this: WMI and SNMP.
(BTW the printer is attached using its network interface. )
WMI
I can get the PrinterStatus (and ExteandedPrinterStatus) I think WMI
is working at the print spooler level. If I turn the printer off WMI still
reports status 3 (OK) when clearly the printer is unavailble, but ot
course the printer spooler system does not know this until a print
is attempted. If I then print a test page, after 30 seconds the spooler
gives up. At this point WMI will report status 1.
If I pull the paper tray on the printer so its "out of paper" and print
the following happends. WMI status goes to 4 (printing) while
print job briefly shows in queue then returns to 3. I guess
WMI is quite corrent, the print job has been sent to the print
which has placed it in its own internal queue awaiting more paper.
The upshot of this, I think, is that I'll have to talk firectly to the printer
hence my trip to SNMP land.
SNMP
Last month experimenting with another printer I got as far as
finding a Status field amoungst hunderds of other fields. It seemed
to be updated in a timely manner. To get that far I had to download
a trial version of a SNMP manager program and to find a MIB file
for the printer.
Today I've been examining a c# SNMP class (from www.c-sharpcorner.com) and
trying to find a MIB suitable for an HP 2605DN printer.
Questions:
1. Is SNMP the way to go ?
2. Do I need a MIB for the HP or is there some standard MIB
3. What would be the simplest means for my app to talk the
the SNMP agent(HP printer) the c# class is throwing exceptions.
As usual I don't have much time to look deeply into these areas.
M.