Help with my Data Query XML, please

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
BKesslerHHC
Posts: 3
Joined: Wed Jan 06, 2016 9:54 am

Help with my Data Query XML, please

Post by BKesslerHHC »

(Edited to add a more complete SNMPWALK output)

I've searched the forum for items related to the HWgroup's STE2 environment monitoring devices, but have come up short. I found some templates that were designed to work for HWgroup's older STE device, and I decided to use it as a baseline. I've gone through and modified the XML file for the STE2 using the OIDs as provided by HWgroup, but the XML file doesn't seem to work.

I know the device is reachable and that SNMP queries work from my Cacti host (notice that the OIDs change slightly after the first 8 pieces of sensor data: those are the "input" ports, whereas the following data are the "sensor" ports):

Code: Select all

$ snmpwalk -v 2c -c public STE2-LAB .1.3.6.1
iso.3.6.1.2.1.1.1.0 = STRING: "STE2"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.21796.4.9
iso.3.6.1.2.1.1.3.0 = Timeticks: (69126900) 8 days, 0:01:09.00
iso.3.6.1.2.1.1.4.0 = STRING: "STE2-LAB: For more information try http://www.HW-group.co"
iso.3.6.1.2.1.1.5.0 = STRING: "STE2-LAB"
iso.3.6.1.2.1.1.6.0 = STRING: "LAB"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.4.1.21796.4.9.1.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.1.1.1.2 = INTEGER: 2
iso.3.6.1.4.1.21796.4.9.1.1.2.1 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.2.2 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.3.1 = STRING: "Input 1"
iso.3.6.1.4.1.21796.4.9.1.1.3.2 = STRING: "Input 2"
iso.3.6.1.4.1.21796.4.9.1.1.4.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.1.1.4.2 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.1.1 = INTEGER: 23264
iso.3.6.1.4.1.21796.4.9.3.1.1.2 = INTEGER: 58455
iso.3.6.1.4.1.21796.4.9.3.1.2.1 = STRING: "REFRIGERATOR"
iso.3.6.1.4.1.21796.4.9.3.1.2.2 = STRING: "FREEZER"
iso.3.6.1.4.1.21796.4.9.3.1.3.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.3.2 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.4.1 = STRING: "37.0"
iso.3.6.1.4.1.21796.4.9.3.1.4.2 = STRING: "2.9"
iso.3.6.1.4.1.21796.4.9.3.1.5.1 = INTEGER: 370
iso.3.6.1.4.1.21796.4.9.3.1.5.2 = INTEGER: 29
iso.3.6.1.4.1.21796.4.9.3.1.6.1 = STRING: "28E05ADC07000076"
iso.3.6.1.4.1.21796.4.9.3.1.6.2 = STRING: "2857E4DB0700009F"
iso.3.6.1.4.1.21796.4.9.3.1.7.1 = INTEGER: 2
iso.3.6.1.4.1.21796.4.9.3.1.7.2 = INTEGER: 2
iso.3.6.1.4.1.21796.4.9.3.1.8.1 = INTEGER: 23264
iso.3.6.1.4.1.21796.4.9.3.1.8.2 = INTEGER: 58455
iso.3.6.1.4.1.21796.4.9.70.1.0 = STRING: "00:0A:59:04:43:40"
End of MIB
Cacti does access the device as expected:

Code: Select all

STE2-LAB (xxx.xxx.xxx.xxx)
SNMP Information
System:STE2
Uptime: 68955600 (7 days, 23 hours, 32 minutes)
Hostname: STE2-LAB
Location: LAB
Contact: STE2-LAB: For more information try http://www.HW-group.co
But when I try to execute the query as part of a device within Cacti, I get the following:

Code: Select all

+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/ste2.xml'
+ Error parsing XML file into an array.
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/ste2.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/ste2.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/ste2.xml'
And, of course, the status shows "Success [0 Items, 0 Rows]."

I was hoping somebody can help me figure out what I'm doing wrong. Here are the contents of the ste2.xml file I created:

Code: Select all

<interface>
        <name>Get STE2 Inputs and Sensors</name>
        <description>Queries a host for a list of monitorable STE2 inputs and sensors</description>

        <oid_index>.1.3.6.1.4.1.21796.4.9.1.1.1</oid_index>

        <fields>

                <STE2InputIndex>
                        <name>STE2 Input Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.1.1.1</oid_index>
                </STE2InputIndex>

                <STE2InputValue>
                        <name>STE2 Input Value (0=Open, 1=Close)</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.1.1.2</oid>
                </STE2InputValue>

                <STE2InputName>
                        <name>STE2 Input Name</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.1.1.3</oid>
                </STE2InputName>

                <STE2InputState>
                        <name>STE2 Input State (0=Normal, 1=Alarm)</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.1.1.4</oid>
                </STE2InputState>

        </fields>

        <oid_index>.1.3.6.1.4.1.21796.4.9.3.1.1</oid_index>

        <fields>

                <STE2SensorIndex>
                        <name>STE2 Sensor Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.1</oid_index>
                </STE2SensorIndex>

                <STE2SensorName>
                        <name>STE2 Sensor Name</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.2</oid>
                </STE2SensorName>

                <STE2SensorState>
                        <name>STE2 Sensor State</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.3</oid>
                </STE2SensorState>

                <STE2SensorStringValue>
                        <name>STE2 Sensor Value (String)</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.4</oid>
                </STE2SensorStringValue>

                <STE2SensorValue>
                        <name>STE2 Sensor Value (Integer)</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.5</oid>
                </STE2SensorValue>

                <STE2SensorSN>
                        <name>STE2 Sensor Serial Number</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.6</oid>
                </STE2SensorSN>

                <STE2SensorUnit>
                        <name>STE2 Sensor Unit (1=C, 2=F, 3=K, 4=%)</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.7</oid>
                </STE2SensorUnit>

                <STE2SensorID>
                        <name>STE2 Sensor ID</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.21796.4.9.3.1.8</oid>
                </STE2SensorID>

        </fields>
</interface>
Any takers?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests