[HELP] Getting laser printer toner level

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
m10
Posts: 7
Joined: Wed Feb 15, 2006 6:19 am
Location: HK, China

[HELP] Getting laser printer toner level

Post by m10 »

Hello, i am writing a SNMP XML query to monitoring the Black and White HP Laser Printer Toner Cartridge Level in office through LAN.

Here below is the XML query file
<interface>
<name>Get Black and White Printer Toner information</name>
<description>Get Black and White Printer Toner information</description>
<oid_index>.1.3.6.1.2.1.43.11.1.1.2</oid_index>
<index_order_type>numeric</index_order_type>

<fields>
<MarkerIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.2</oid>
</MarkerIndex>
<Class>
<name>Class</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.4</oid>
</Class>
<Type>
<name>Type</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.5</oid>
</Type>
<Description>
<name>Description</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.6</oid>
</Description>
<Capacity>
<name>Capacity</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.8</oid>
</Capacity>
<Level>
<name>Level</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.43.11.1.1.9</oid>
</Level>
</fields>
</interface>
Also the snmpwalk output
[root@localhost cacti]# snmpwalk 10.106.96.107 -c public -v1 SNMPv2-SMI::mib-2.43.11

SNMPv2-SMI::mib-2.43.11.1.1.2.1.1 = INTEGER: 1
SNMPv2-SMI::mib-2.43.11.1.1.3.1.1 = INTEGER: 0
SNMPv2-SMI::mib-2.43.11.1.1.4.1.1 = INTEGER: 3
SNMPv2-SMI::mib-2.43.11.1.1.5.1.1 = INTEGER: 21
SNMPv2-SMI::mib-2.43.11.1.1.6.1.1 = STRING: "Black Cartridge HP Q6511A"
SNMPv2-SMI::mib-2.43.11.1.1.7.1.1 = INTEGER: 7
SNMPv2-SMI::mib-2.43.11.1.1.8.1.1 = INTEGER: 6000
SNMPv2-SMI::mib-2.43.11.1.1.9.1.1 = INTEGER: 5880
At the data query (at device page) works fine (i can see the value for all 'input' field there), so i go through the Howto page [ Howto: from snmptable to XML Graphs (Data Query walkthrough) by lvm ] and follow the steps and created the graph. But nth is shown on the graph (two output value=nan, ( i expect checking the maxcapacity, and remain level of the toner :D)... And then i turn on the debug mode , and it's showing
"WARNING: Result from SNMP not valid. Partial Result:"
sorry for my poor english :lol:
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

What is the output of the script when you run it?
m10
Posts: 7
Joined: Wed Feb 15, 2006 6:19 am
Location: HK, China

Post by m10 »

um.. output of the script?
Do you mean this one?
+ Running data query [20].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/mono_toner.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.43.11.1.1.2'
+ Located input field 'MarkerIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.2'
+ Found item [MarkerIndex='1'] index: 1 [from value]
+ Located input field 'Class' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.4'
+ Found item [Class='3'] index: 1 [from value]
+ Located input field 'Type' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.5'
+ Found item [Type='21'] index: 1 [from value]
+ Located input field 'Description' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.6'
+ Found item [Description='Black Cartridge HP Q6511A'] index: 1 [from value]
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/mono_toner.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/mono_toner.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/mono_toner.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/mono_toner.xml'
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] Host[17] DS[371] WARNING: Result from SNMP not valid. Partial Result:
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] Host[17] DS[371] SNMP: v1: 10.106.96.107, dsname: Level, oid: .1.3.6.1.2.1.43.11.1.1.9.1, output: U
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (371,'Level','2006-02-16 06:00:02','U')"
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] Host[17] DS[371] WARNING: Result from SNMP not valid. Partial Result:
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] Host[17] DS[371] SNMP: v1: 10.106.96.107, dsname: Capacity, oid: .1.3.6.1.2.1.43.11.1.1.8.1, output: U
02/16/2006 06:00:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (371,'Capacity','2006-02-16 06:00:02','U')"
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Ahh, I see why it's failing. Cacti is trying to poll .1.3.6.1.2.1.43.11.1.1.8.1.x while your snmpwalk returned .1.3.6.1.2.1.43.11.1.1.8.1.1.x was valid. Try adding on the extra .1 to your xml script and see if that helps.
m10
Posts: 7
Joined: Wed Feb 15, 2006 6:19 am
Location: HK, China

Post by m10 »

BSOD2600 wrote:Ahh, I see why it's failing. Cacti is trying to poll .1.3.6.1.2.1.43.11.1.1.8.1.x while your snmpwalk returned .1.3.6.1.2.1.43.11.1.1.8.1.1.x was valid. Try adding on the extra .1 to your xml script and see if that helps.
yeah, it works !! Thank you for your help and quick reply :D
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There has already been a HP Printer template out there. Perhaps it will help you
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests