Data Query For Non-Indexed Table
Moderators: Developers, Moderators
Data Query For Non-Indexed Table
Hi
Can anyone help with this problem?? I'm trying to graph the CPU Utilisation for a Foundry NetIron MLX chassis. This data is stored in an snmptable which I can correctly list using the snmptable command.
However, I cannot see an index listed. The returned columns are as follows -
snAgentCpuUtilSlotNum snAgentCpuUtilCpuId snAgentCpuUtilInterval snAgentCpuUtilValue
Does anyone know how to get this data into cacti for graphing?? I've tried looking through the document on the cacti website for building from snmptable to XML graphs but cannot see how this could be done without a table index??
Thanks
Can anyone help with this problem?? I'm trying to graph the CPU Utilisation for a Foundry NetIron MLX chassis. This data is stored in an snmptable which I can correctly list using the snmptable command.
However, I cannot see an index listed. The returned columns are as follows -
snAgentCpuUtilSlotNum snAgentCpuUtilCpuId snAgentCpuUtilInterval snAgentCpuUtilValue
Does anyone know how to get this data into cacti for graphing?? I've tried looking through the document on the cacti website for building from snmptable to XML graphs but cannot see how this could be done without a table index??
Thanks
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please see http://docs.cacti.net/node/225. snAgentCpuUtilSlotNum seems to be the table index
Reinhard
Reinhard
That's what I thought, however, that doesn't contain unique data so haw can it be the index??gandalf wrote:Please see http://docs.cacti.net/node/225. snAgentCpuUtilSlotNum seems to be the table index
Reinhard
Here's the output
snAgentCpuUtilSlotNum snAgentCpuUtilCpuId snAgentCpuUtilInterval snAgentCpuUtilValue
1 1 1 1
1 1 5 1
1 1 60 1
1 1 300 1
5 1 1 0
5 1 5 0
5 1 60 0
5 1 300 0
Can't quite get it to format properly on here but basically the first column in 1 digit, the second 1 digit, the 3rd is either 1, 5, 60 or 300 and the fourth is 1 digit.
snAgentCpuUtilSlotNum snAgentCpuUtilCpuId snAgentCpuUtilInterval snAgentCpuUtilValue
1 1 1 1
1 1 5 1
1 1 60 1
1 1 300 1
5 1 1 0
5 1 5 0
5 1 60 0
5 1 300 0
Can't quite get it to format properly on here but basically the first column in 1 digit, the second 1 digit, the 3rd is either 1, 5, 60 or 300 and the fourth is 1 digit.
Here you go
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.1 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.60 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.300 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.60 = INTEGER: 60
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.300 = INTEGER: 300
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.60 = INTEGER: 60
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.300 = INTEGER: 300
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.1 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.5 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.60 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.300 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.1 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.5 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.60 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.300 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.1.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.1 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.60 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.1.5.1.300 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.1.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.5 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.60 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.2.5.1.300 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.60 = INTEGER: 60
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.1.1.300 = INTEGER: 300
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.60 = INTEGER: 60
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.3.5.1.300 = INTEGER: 300
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.1 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.5 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.60 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.1.1.300 = Gauge32: 1
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.1 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.5 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.60 = Gauge32: 0
SNMPv2-SMI::enterprises.1991.1.1.2.11.1.1.4.5.1.300 = Gauge32: 0
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please see http://forums.cacti.net/about12177.html to learn how to use an OID_INDEX_PARSE with a REGEXP. Your regexp should cath the last three tupels of the OID (e.g. 1.1.1 or 1.1.5 or 1.1.60 ...).
Then build your XML as given by http://docs.cacti.net/node/225
Reinhard
Then build your XML as given by http://docs.cacti.net/node/225
Reinhard
Any idea what the OID/REGEXP should be??gandalf wrote:Please see http://forums.cacti.net/about12177.html to learn how to use an OID_INDEX_PARSE with a REGEXP. Your regexp should cath the last three tupels of the OID (e.g. 1.1.1 or 1.1.5 or 1.1.60 ...).
Then build your XML as given by http://docs.cacti.net/node/225
Reinhard
ok, I've got the REGEXP working.... Here's the XML...
<interface>
<name>Get Foundry CPU Util</name>
<description>Get SNMP based Foundry CPU Utilisation</description>
<index_order>numeric</index_order>
<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]{1,3})$</oid_parse_index>
<fields>
<snAgentCpuUtilSlotNum>
<name>Slot Number</name>
<method>walk</walk>
<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</walk>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
<snAgentCpuUtilCpuInterval>
<name>Interval</name>
<method>walk</walk>
<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>Value</name>
<method>walk</walk>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
</fields>
</interface>
What I can't work out how to do is to only select the rows where the last part of the OID is 300 to get the 5 minute cpu??
<interface>
<name>Get Foundry CPU Util</name>
<description>Get SNMP based Foundry CPU Utilisation</description>
<index_order>numeric</index_order>
<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]{1,3})$</oid_parse_index>
<fields>
<snAgentCpuUtilSlotNum>
<name>Slot Number</name>
<method>walk</walk>
<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</walk>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
<snAgentCpuUtilCpuInterval>
<name>Interval</name>
<method>walk</walk>
<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>Value</name>
<method>walk</walk>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
</fields>
</interface>
What I can't work out how to do is to only select the rows where the last part of the OID is 300 to get the 5 minute cpu??
Doesmsw1970 wrote: What I can't work out how to do is to only select the rows where the last part of the OID is 300 to get the 5 minute cpu??
<oid_index_parse>OID/REGEXP:.*\.([0-9]\.[0-9]\.300)$</oid_parse_index>
Work? Heck, even:
<oid_index_parse>OID/REGEXP:.*\.([0-9]\.1\.300)$</oid_parse_index>
should work since the 5-minute OIDs always end in .1.300 ...
[size=75]Cacti 0.8.7a|Spine 0.8.7a|RRDTool 1.2.26 (win32)|MySQL 5.0.45 (x64)|Net-SNMP 5.4.1-3 (win32)|PHP 5.2.5|Windows Server 2003 SE x64[/size]
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Well, it may sound awful, but everything's in here. With the last post of mine I only missed the final answer. You may provide it! To overcome start porblems, please refer to http://docs.cacti.net HowTo section on Data Queries
Reinhard
Reinhard
I believe it is close, however the oid_index_parse in several regex iterations has caused errors and/or not the correct output needed for a suitable index of the values. I was just hoping not to spend alot of time on it. If someone already had it working, it would be great, otherwise, I'll manually create the data templates for each OID needed... will be quicker for me at this time.gandalf wrote:Well, it may sound awful, but everything's in here. With the last post of mine I only missed the final answer. You may provide it! To overcome start porblems, please refer to http://docs.cacti.net HowTo section on Data Queries
Reinhard
This is one year later but I noticed a few mistakes. correct me if I'm wrong but isn't there an error on the 3rd line from the bottom?msw1970 wrote:ok, I've got the REGEXP working.... Here's the XML...
<interface>
<name>Get Foundry CPU Util</name>
<description>Get SNMP based Foundry CPU Utilisation</description>
<index_order>numeric</index_order>
<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]{1,3})$</oid_parse_index>
<fields>
<snAgentCpuUtilSlotNum>
<name>Slot Number</name>
<method>walk</walk>
<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</walk>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
<snAgentCpuUtilCpuInterval>
<name>Interval</name>
<method>walk</walk>
<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>Value</name>
<method>walk</walk>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1991.1.1.2.11.1.1.2</oid>
</snAgentCpuUtilId>
</fields>
</interface>
What I can't work out how to do is to only select the rows where the last part of the OID is 300 to get the 5 minute cpu??
</snAgentCpuUtilId> should be </snAgentcpuUtilValue>and the oid for <snAgentCpuUtilValue> should be .1.3.6.1.4.1.1991.1.1.2.11.1.1.4
Who is online
Users browsing this forum: No registered users and 0 guests