SNMP query on indexed OID: pb with graphs

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

SNMP query on indexed OID: pb with graphs

Post by fauf »

Hello,

I defined in my file "snmpd.conf" the OID .1.3.6.1.4.1.2021.62.
When i do an snmpwalk on the terminal ("snmpwalk -c public -v 1 192.168.0.13 .1.3.6.1.4.1.2021.62"), i get the following result:

UCD-SNMP-MIB::ucdavis.62.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.62.2.1 = STRING: "iaxnetstats"
UCD-SNMP-MIB::ucdavis.62.3.1 = STRING: "/bin/sh /tmp/lire-stats-out1"
UCD-SNMP-MIB::ucdavis.62.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.62.101.1 = STRING: "16.8780487804878"
UCD-SNMP-MIB::ucdavis.62.101.2 = STRING: "87.0222222222222"
UCD-SNMP-MIB::ucdavis.62.101.3 = STRING: "146.177777777778"
UCD-SNMP-MIB::ucdavis.62.101.4 = STRING: "0.6"
UCD-SNMP-MIB::ucdavis.62.101.5 = STRING: "1.17777777777778"
UCD-SNMP-MIB::ucdavis.62.101.6 = STRING: "19.9111111111111"
UCD-SNMP-MIB::ucdavis.62.101.7 = STRING: "32.3333333333333"
UCD-SNMP-MIB::ucdavis.62.101.8 = STRING: "5.71111111111111"
UCD-SNMP-MIB::ucdavis.62.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.62.103.1 = ""

I used the XML data query to graph the result of the oid .1.3.6.1.4.1.2021.62.101.1 until .1.3.6.1.4.1.2021.62.101.8. I followed the tutorial "http://docs.cacti.net/?q=node/303":
1) I defined a data template called "netstats"
2) I defined a graph template
3)I defined the data query with corresponding xml code
4)added the query in the field Devices
5) i added the graphs in the field "new graph"
But my graphs don't appear, and in the debug mode i get the following error: ERROR: opening '/var/www/cacti/rra/asterisk-dev_statistics_62.rrd': No such file or directory

What i am doing wrong?here after a print screen of all the steps i followed, and the xml code.

Thanks a lot

F.A
Attachments
DataQuery.png
DataQuery.png (152.54 KiB) Viewed 2621 times
datatemplate.png
datatemplate.png (178.17 KiB) Viewed 2621 times
GraphItemInput-GraphTemplate.png
GraphItemInput-GraphTemplate.png (135.24 KiB) Viewed 2621 times
graphtemplate.png
graphtemplate.png (170.3 KiB) Viewed 2621 times
new-graph-field.png
new-graph-field.png (130.9 KiB) Viewed 2621 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

From the first graph, I see, that the XML is wrong. The output field is displayed. You should change the XML for that field to <direction>output. Please post the XML
Reinhard
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

Post by fauf »

Thank you Gandalf for your response.
The old XML code is attached under the name "netstats.xml". The problem was in the oid index. I have one index, but i displayed as you said the value of my output.
I changed the xml. Here after my new xml code ("netstats1.xml").
But i still have no graphs. I have empty graphs with NAN value.
Here after the result of my snmpwalk:

Code: Select all

fauf@fauf-desktop:~$ snmpwalk -c public -v 1 192.168.0.13  .1.3.6.1.4.1.2021.62
UCD-SNMP-MIB::ucdavis.62.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.62.2.1 = STRING: "iaxnetstats"
UCD-SNMP-MIB::ucdavis.62.3.1 = STRING: "/bin/sh /tmp/lire-stats-out1"
UCD-SNMP-MIB::ucdavis.62.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.62.101.1 = STRING: "16.8780487804878"
UCD-SNMP-MIB::ucdavis.62.101.2 = STRING: "87.0222222222222"
UCD-SNMP-MIB::ucdavis.62.101.3 = STRING: "146.177777777778"
UCD-SNMP-MIB::ucdavis.62.101.4 = STRING: "0.6"
UCD-SNMP-MIB::ucdavis.62.101.5 = STRING: "1.17777777777778"
UCD-SNMP-MIB::ucdavis.62.101.6 = STRING: "19.9111111111111"
UCD-SNMP-MIB::ucdavis.62.101.7 = STRING: "32.3333333333333"
UCD-SNMP-MIB::ucdavis.62.101.8 = STRING: "5.71111111111111"
UCD-SNMP-MIB::ucdavis.62.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.62.103.1 = ""
i want to graph 8 graphs, the first one with the result of the oid .1.3.6.1.4.1.2021.62.101.1 (value 16.8), the second one of the oid .1.3.6.1.4.1.2021.62.101.2...until 101.8.

I really don't know what i am doing wrong.

Thank you for your help
Attachments
netstats.xml
(2.44 KiB) Downloaded 120 times
netstats1.xml
(2.37 KiB) Downloaded 136 times
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

Post by fauf »

just one more precision, i guess that the problem comes from the oid index. I just that my data have no index.
Will a data input method be more suitable for what i want to do?
(i want to have 8 graphs from 8 different OID but with just one SNMP query)

Thank you
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Code: Select all

<query>
<name>Get IAX2 netstats</name>
<description>Queries IAX2 statistics</description>
<oid_index>.1.3.6.1.4.1.2021.62.100</oid_index>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>

<fields>

<ifIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.2021.62.100</oid>
</ifIndex>
<ifsth>
<name>sth</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.2021.62.100</oid>
</ifsth>
</fields>
</query>
Should do. But you won't get all other data (as they are not indexed)
Reinhard
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

Post by fauf »

Thanks Reinhard for your response.
I tried this cml code but it doesn't give me any data. i want to graph the 8 data (RTT=16.8780487804878, Jitter= 87.0222222222222, delay=146.177777777778,...) but with just one query.
From what i understood, i can't do this with a data query as my data is not indexed...but can i do this with a data input method?how can i do it?
Thank you

F.A
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That's wrong.
Using a (SNMP|Script) Data Query required indexed data.
Else use plain script or "Simple OID Template" to fetch single OIDs data. See all that explained at 1st link of my sig
Reinhard
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

Post by fauf »

Thanks Reinhard for your response. I already tried using "Simple OID Template" to fetch single OIDs data, and graphs work. But this is not a good think because i want to query all the 8 OIDs at once. I don't want to have 8 different queries.

I tried to do a perl script that does this, but i still have graphs with NAN.
Here after the perl script, and the different steps i followed.
The resultat of the perl script gives:

Code: Select all

RTT:16.8780487804878 Jitter:87.0222222222222 Delay:146.177777777778 Packets_Lost:0.6 Percentage_of_packets_lost:1.17777777777778 Packets_Dropped:19.9111111111111 Out_Of_Order_Packets:32.3333333333333  Kpkts:5.71111111111111
What i am doind wrong?
Attachments
netstats.pl
(1.06 KiB) Downloaded 160 times
i first created a data input method
i first created a data input method
Data-Input-Method.png (155.31 KiB) Viewed 2461 times
Data template
Data template
data template.png (183.92 KiB) Viewed 2461 times
graph template
graph template
graph-template.png (172.34 KiB) Viewed 2461 times
result of the graph
result of the graph
graph.png (128.92 KiB) Viewed 2461 times
fauf
Posts: 9
Joined: Fri Jan 23, 2009 5:03 am

Post by fauf »

Hi again,

i guess i found what was going wrong.
In the perl script, the output is returned by:

Code: Select all

print "RTT:$RTT Jitter:$Jitter Delay:$Delay Packets_Lost:$Packets_Lost Percentage_of_packets_lost:$Percentage_packets_lost Packets_Dropped:$Packets_Dropped Out_Of_Order_Packets:$Out_Of_Order_Packets  Kpkts:$Kpkts\n";   
I had to remove the "\n", and the graph appeared!!

Thanks for your help

F.A
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests