Data Query For Non-Indexed Table

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

Moderators: Developers, Moderators

msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Data Query For Non-Indexed Table

Post by msw1970 »

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
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please see http://docs.cacti.net/node/225. snAgentCpuUtilSlotNum seems to be the table index
Reinhard
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

gandalf wrote:Please see http://docs.cacti.net/node/225. snAgentCpuUtilSlotNum seems to be the table index
Reinhard
That's what I thought, however, that doesn't contain unique data so haw can it be the index??
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Don't know. Please post results of snmptable output to get more help
Reinhard
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

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.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Fine. I've got a clue to create a three-dimensional indexed SNMP data query. Please now post an snmpwalk showing the real OIDs to form the required XML
Reinhard
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

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
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

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
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

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
Any idea what the OID/REGEXP should be??
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

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??
cinergi
Posts: 10
Joined: Mon Jan 24, 2005 6:36 pm

Post by cinergi »

msw1970 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??
Does

<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]
User avatar
ehelm
Posts: 16
Joined: Tue Dec 20, 2005 9:45 pm

Post by ehelm »

Anyone got this data query to work properly? I just began looking at this same problem with Foundry's implementation of their CPU usage on their newer chassis switches.

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

Post by gandalf »

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
User avatar
ehelm
Posts: 16
Joined: Tue Dec 20, 2005 9:45 pm

Post by ehelm »

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
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.
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Post by zeki »

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??
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?
</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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests