Data Query From SNMP Table

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

Moderators: Developers, Moderators

zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

i found this interesting bug http://bugs.cacti.net/view.php?id=632 which someone says may be related to why the mlx/xmr graphs are not working.

original thread for the bug: http://forums.cacti.net/viewtopic.php?t=10505&start=0
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

First, this bug is quite old and a response is missing. Loads of changes have been made since then for the snmp data query stuff. But if you still are facing problems, please give us an snmpwalk and a verbose query of the Data Query at least. A list from "System Utilities -> View SNMP cache" would be fine as well.
That's the minimum requirement for starting debugging
Reinhard
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

Although it is an old bug I think it is still valid because I haven't seen any mlx/xmr router templates, only threads with failed attempts. the xml and snmpwalk is the same as the one earlier in this post

i will post the verbose query here

Code: Select all

+ Running data query [12].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1991.1.1.2.11.1.1.1'
+ Located input field 'cpuSlotNum' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.1'
+ Found item [cpuSlotNum='1'] index: 1.1.1 [from value]
+ Found item [cpuSlotNum='1'] index: 1.1.5 [from value]
+ Found item [cpuSlotNum='1'] index: 1.1.60 [from value]
+ Found item [cpuSlotNum='1'] index: 1.1.300 [from value]
+ Found item [cpuSlotNum='2'] index: 2.1.1 [from value]
+ Found item [cpuSlotNum='2'] index: 2.1.5 [from value]
+ Found item [cpuSlotNum='2'] index: 2.1.60 [from value]
+ Found item [cpuSlotNum='2'] index: 2.1.300 [from value]
+ Found item [cpuSlotNum='5'] index: 5.1.1 [from value]
+ Found item [cpuSlotNum='5'] index: 5.1.5 [from value]
+ Found item [cpuSlotNum='5'] index: 5.1.60 [from value]
+ Found item [cpuSlotNum='5'] index: 5.1.300 [from value]
+ Found item [cpuSlotNum='6'] index: 6.1.1 [from value]
+ Found item [cpuSlotNum='6'] index: 6.1.5 [from value]
+ Found item [cpuSlotNum='6'] index: 6.1.60 [from value]
+ Found item [cpuSlotNum='6'] index: 6.1.300 [from value]
+ Located input field 'cpuId' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.2'
+ Found item [cpuId='1'] index: 1.1.1 [from value]
+ Found item [cpuId='1'] index: 1.1.5 [from value]
+ Found item [cpuId='1'] index: 1.1.60 [from value]
+ Found item [cpuId='1'] index: 1.1.300 [from value]
+ Found item [cpuId='1'] index: 2.1.1 [from value]
+ Found item [cpuId='1'] index: 2.1.5 [from value]
+ Found item [cpuId='1'] index: 2.1.60 [from value]
+ Found item [cpuId='1'] index: 2.1.300 [from value]
+ Found item [cpuId='1'] index: 5.1.1 [from value]
+ Found item [cpuId='1'] index: 5.1.5 [from value]
+ Found item [cpuId='1'] index: 5.1.60 [from value]
+ Found item [cpuId='1'] index: 5.1.300 [from value]
+ Found item [cpuId='1'] index: 6.1.1 [from value]
+ Found item [cpuId='1'] index: 6.1.5 [from value]
+ Found item [cpuId='1'] index: 6.1.60 [from value]
+ Found item [cpuId='1'] index: 6.1.300 [from value]
+ Located input field 'cpuInterval' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.3'
+ Found item [cpuInterval='1'] index: 1.1.1 [from value]
+ Found item [cpuInterval='5'] index: 1.1.5 [from value]
+ Found item [cpuInterval='60'] index: 1.1.60 [from value]
+ Found item [cpuInterval='300'] index: 1.1.300 [from value]
+ Found item [cpuInterval='1'] index: 2.1.1 [from value]
+ Found item [cpuInterval='5'] index: 2.1.5 [from value]
+ Found item [cpuInterval='60'] index: 2.1.60 [from value]
+ Found item [cpuInterval='300'] index: 2.1.300 [from value]
+ Found item [cpuInterval='1'] index: 5.1.1 [from value]
+ Found item [cpuInterval='5'] index: 5.1.5 [from value]
+ Found item [cpuInterval='60'] index: 5.1.60 [from value]
+ Found item [cpuInterval='300'] index: 5.1.300 [from value]
+ Found item [cpuInterval='1'] index: 6.1.1 [from value]
+ Found item [cpuInterval='5'] index: 6.1.5 [from value]
+ Found item [cpuInterval='60'] index: 6.1.60 [from value]
+ Found item [cpuInterval='300'] index: 6.1.300 [from value]
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'

Yes in the bug a response is missing, but I did try what Rony recommended and left it with 2 values. This worked but I would have to make a custom xml sheet for each mlx router because they have different slots and if I had an invalid OID in the xml it failed to create the RRD.

Code: Select all

<interface>
  <name>Get CPU Load</name>
  <description>Queries a host for a list of all modules cpu</description>
  <oid_index>.1.3.6.1.4.1.1991.1.1.2.11.1.1.4</oid_index>
  <oid_index_parse>OID/REGEXP:^.*\.([0-9]*\.[0-9]*)$</oid_index_parse>
  <index_order>cpuId:cpuInterval</index_order>
  <index_order_type>numeric</index_order_type>
  <index_title_format>|chosen_order_field|</index_title_format>
 <fields>
 <cpuSlotNum>
  <name>Slot Number</name>
  <method>walk</method>
  <source>value</source>
  <direction>input</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid>
  </cpuSlotNum>

 <cpuId>
  <name>CPU ID</name>
  <method>walk</method>
  <source>value</source>
  <direction>input</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
  </cpuId>

 <cpuInterval>
  <name>Interval</name>
  <method>walk</method>
  <source>value</source>
  <direction>input</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.3</oid>
  </cpuInterval>

 <cpuValue>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.1</oid>
 </cpuValue>
 <cpuValue3>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.3</oid>
 </cpuValue3>
 <cpuValue5>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.5</oid>
 </cpuValue5>
 <cpuValue6>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.6</oid>
 </cpuValue6>
  </fields>
  </interface>
verbose query

Code: Select all

Data Query Debug Information 
 
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1991.1.1.2.11.1.1.4'
+ Located input field 'cpuSlotNum' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.1'
+ Found item [cpuSlotNum='1'] index: 1.1 [from value]
+ Found item [cpuSlotNum='1'] index: 1.5 [from value]
+ Found item [cpuSlotNum='1'] index: 1.60 [from value]
+ Found item [cpuSlotNum='1'] index: 1.300 [from value]
+ Found item [cpuSlotNum='3'] index: 1.1 [from value]
+ Found item [cpuSlotNum='3'] index: 1.5 [from value]
+ Found item [cpuSlotNum='3'] index: 1.60 [from value]
+ Found item [cpuSlotNum='3'] index: 1.300 [from value]
+ Found item [cpuSlotNum='5'] index: 1.1 [from value]
+ Found item [cpuSlotNum='5'] index: 1.5 [from value]
+ Found item [cpuSlotNum='5'] index: 1.60 [from value]
+ Found item [cpuSlotNum='5'] index: 1.300 [from value]
+ Found item [cpuSlotNum='6'] index: 1.1 [from value]
+ Found item [cpuSlotNum='6'] index: 1.5 [from value]
+ Found item [cpuSlotNum='6'] index: 1.60 [from value]
+ Found item [cpuSlotNum='6'] index: 1.300 [from value]
+ Located input field 'cpuId' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.2'
+ Found item [cpuId='1'] index: 1.1 [from value]
+ Found item [cpuId='1'] index: 1.5 [from value]
+ Found item [cpuId='1'] index: 1.60 [from value]
+ Found item [cpuId='1'] index: 1.300 [from value]
+ Found item [cpuId='1'] index: 1.1 [from value]
+ Found item [cpuId='1'] index: 1.5 [from value]
+ Found item [cpuId='1'] index: 1.60 [from value]
+ Found item [cpuId='1'] index: 1.300 [from value]
+ Found item [cpuId='1'] index: 1.1 [from value]
+ Found item [cpuId='1'] index: 1.5 [from value]
+ Found item [cpuId='1'] index: 1.60 [from value]
+ Found item [cpuId='1'] index: 1.300 [from value]
+ Found item [cpuId='1'] index: 1.1 [from value]
+ Found item [cpuId='1'] index: 1.5 [from value]
+ Found item [cpuId='1'] index: 1.60 [from value]
+ Found item [cpuId='1'] index: 1.300 [from value]
+ Located input field 'cpuInterval' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.1991.1.1.2.11.1.1.3'
+ Found item [cpuInterval='1'] index: 1.1 [from value]
+ Found item [cpuInterval='5'] index: 1.5 [from value]
+ Found item [cpuInterval='60'] index: 1.60 [from value]
+ Found item [cpuInterval='300'] index: 1.300 [from value]
+ Found item [cpuInterval='1'] index: 1.1 [from value]
+ Found item [cpuInterval='5'] index: 1.5 [from value]
+ Found item [cpuInterval='60'] index: 1.60 [from value]
+ Found item [cpuInterval='300'] index: 1.300 [from value]
+ Found item [cpuInterval='1'] index: 1.1 [from value]
+ Found item [cpuInterval='5'] index: 1.5 [from value]
+ Found item [cpuInterval='60'] index: 1.60 [from value]
+ Found item [cpuInterval='300'] index: 1.300 [from value]
+ Found item [cpuInterval='1'] index: 1.1 [from value]
+ Found item [cpuInterval='5'] index: 1.5 [from value]
+ Found item [cpuInterval='60'] index: 1.60 [from value]
+ Found item [cpuInterval='300'] index: 1.300 [from value]
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/foundry_netiron_mlx_cpu.xml' 
the results from before and after the verbose query are a little different since I queried two different routers. the difference is the first one has a module in slot2 and the 2nd results show a module in slot3
Last edited by zeki on Mon Mar 09, 2009 2:44 pm, edited 1 time in total.
http://www.krypt.com/
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

Did you ever get this working?

msw1970 wrote:Update....

OK, I think I've managed to create the xml correctly...
<query>
<name>Get Foundry MLX CPU Utilization</name>
<index_order_type>numeric</index_order_type>
<description>Queries MLX For LP CPU Utilization</description>
<oid_index>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid_index>
<oid_index_parse>OID/REGEXP:^.*\.([0-9]*\.[0-9]*\.[0-9]*)$</oid_index_parse>
<fields>
<snAgentCpuUtilSlotNum>
<name>Slot</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid>
</snAgentCpuUtilSlotNum>
<snAgentCpuUtilCpuId>
<name>CPU Id</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilCpuId>
<snAgentCpuUtilInterval>
<name>CPU Interval</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.3</oid>
</snAgentCpuUtilInterval>
<snAgentCpuUtilValue>
<name>CPU Utilization</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.4</oid>
</snAgentCpuUtilValue>
</fields>
</query>
I've then followed the HowTo on the Cacti Docs site to create the Data Query, Data Template & Graph Template but no RRD files are ever created.

Any ideas where I might have gone wrong?
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

I haven't got it working in its current state, but i have a way around it.
Instead of querying for all the slots, query only the slots that you need
i.e.

Code: Select all

<query> 
<name>Get Foundry MLX CPU Utilization</name> 
<index_order_type>numeric</index_order_type> 
<description>Queries MLX For LP CPU Utilization</description> 
<oid_index>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid_index> 
<oid_index_parse>OID/REGEXP:^.*\.([0-9]*\.[0-9]*)$</oid_index_parse> 
<fields> 
<snAgentCpuUtilSlotNum> 
<name>Slot</name> 
<method>walk</method> 
<source>value</source> 
<direction>input</direction> 
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid> 
</snAgentCpuUtilSlotNum> 
<snAgentCpuUtilCpuId> 
<name>CPU Id</name> 
<method>walk</method> 
<source>value</source> 
<direction>input</direction> 
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid> 
</snAgentCpuUtilCpuId> 
<snAgentCpuUtilInterval> 
<name>CPU Interval</name> 
<method>walk</method> 
<source>value</source> 
<direction>input</direction> 
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.3</oid> 
</snAgentCpuUtilInterval> 
 <cpuValue>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.1</oid>
 </cpuValue>
 <cpuValue3>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.3</oid>
 </cpuValue3>
 <cpuValue5>
  <name>Value</name>
  <method>walk</method>
  <source>value</source>
  <direction>output</direction>
  <oid>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.5</oid>
 </cpuValue5>
</fields> 
</query>
Last edited by zeki on Mon Mar 09, 2009 2:43 pm, edited 1 time in total.
http://www.krypt.com/
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

Can you explain a little more what you're doing here... TIA!
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

the bad xml when it queries shows all the slots automatically, but there is a bug so when you create the data it won't work properly.
In my example you need to know what slots you are using on your MLX.
login to your MLX and do "show cpu lp" You'll see what slots you have.

so for my mlx i'm using slot 1,3, and 5. I'm going to want to create an entry using this oid for those slots. Look at my XML, you'll see cpuvalue, cpuvalue3, and cpuvalue5.
notice the last value changes. I'm querying >1.3.6.1.4.1.1991.1.1.2.11.1.1.4.1
>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.3
>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.5
because those are for slots 1,3,5

so if you have like slot 15 then you can modify mine and add 15
>1.3.6.1.4.1.1991.1.1.2.11.1.1.4.15

Get it?
Last edited by zeki on Mon Mar 09, 2009 2:42 pm, edited 1 time in total.
http://www.krypt.com/
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

thanks!
User avatar
nebj00la
Cacti User
Posts: 112
Joined: Fri Feb 17, 2006 9:02 pm
Location: Massachusetts, USA
Contact:

Post by nebj00la »

I've followed the SNMP Data Query Walkthrough and also cannot get the graphs to show up. Attached you will find the templates that I'm using.

Due to the fact I don't yet understand how to return only one set of intervals at a time during the queries, I have two graph templates using the same data query.

I'm sure this isn't the best way to do things, but I digress.

It would be nice if we could figure out why the graphs aren't being created! Nothing shows up in a debug log, either. The only trace of anything relating to the graphs is the output of RRDTool within graph debug mode.

RRDTool Command:

/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="csw1 - Slot 1 - 1 Min. CPU Avg." \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:8: \
--font AXIS:7: \
--font LEGEND:7: \
--font UNIT:6: \
DEF:a="<cacti-path>/rra/83/2654.rrd":CpuUtilValue:LAST \
LINE1:a#FF3932FF:"" \
GPRINT:a:LAST:"1 Min. CPU\:%8.2lf%s\n"

RRDTool Says:

ERROR: opening '<cacti-path>/rra/83/2654.rrd': No such file or directory
Attachments
Foundry_Chassis_CPU.xml
Foundry Chassis CPU Data Query
(1.79 KiB) Downloaded 106 times
cacti_graph_template_foundry_-_1_min_chassis_cpu_avg_.xml
1 Minute CPU Template
(12.65 KiB) Downloaded 266 times
cacti_graph_template_foundry_-_5_min_chassis_cpu_avg_.xml
5 Minute CPU Template
(12.65 KiB) Downloaded 128 times
Thanks,
nebj00la
User avatar
nebj00la
Cacti User
Posts: 112
Joined: Fri Feb 17, 2006 9:02 pm
Location: Massachusetts, USA
Contact:

Post by nebj00la »

gandalf wrote:First, this bug is quite old and a response is missing. Loads of changes have been made since then for the snmp data query stuff. But if you still are facing problems, please give us an snmpwalk and a verbose query of the Data Query at least. A list from "System Utilities -> View SNMP cache" would be fine as well.
That's the minimum requirement for starting debugging
Reinhard
I've created a fresh bug, ID #1466. It relates only to this issue.
Thanks,
nebj00la
dethmetaljeff
Posts: 4
Joined: Thu Jun 12, 2008 11:21 am

Re: Data Query From SNMP Table

Post by dethmetaljeff »

Digging up the past a bit but since I don't see an answer for this anywhere I thought I'd post the snmp query that's working for me.

Code: Select all

<query>
        <name>Get Foundry MLX CPU Utilization</name>
        <index_order_type>numeric</index_order_type>
        <description>Queries MLX For LP CPU Utilization</description>
        <oid_index>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid_index>
        <oid_index_parse>OID/REGEXP:^.*\.([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,})$</oid_index_parse>
        <index_order>snAgentCpuUtilSlotNum:index</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>Slot#|chosen_order_field|</index_title_format>
        <fields>
                <index>
                        <name>Index</name>
                        <method>walk</method>
                        <source>index</source>
                        <direction>input</direction>
                </index>
                <snAgentCpuUtilSlotNum>
                        <name>Slot</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.1</oid>
                </snAgentCpuUtilSlotNum>
                <snAgentCpuUtilCpuId>
                        <name>CPU Id</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
                </snAgentCpuUtilCpuId>
                <snAgentCpuUtilInterval>
                        <name>CPU Interval</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.3</oid>
                </snAgentCpuUtilInterval>
                <snAgentCpuUtilValue>
                        <name>CPU Utilization</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.4</oid>
                </snAgentCpuUtilValue>
        </fields>
</query>
I also applied http://www.cacti.net/downloads/patches/ ... onse.patch while I was debugging this because I couldn't rerun the data queries w/o hitting that bug. It may or may not be required.
User avatar
nebj00la
Cacti User
Posts: 112
Joined: Fri Feb 17, 2006 9:02 pm
Location: Massachusetts, USA
Contact:

Re: Data Query From SNMP Table

Post by nebj00la »

Thanks for your response.
Thanks,
nebj00la
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests