IPs in SNMP OIDs

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

Moderators: Developers, Moderators

Post Reply
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

IPs in SNMP OIDs

Post by JediFr3d »

Similar to topic #41158 I'm trying to graph session counts of a Brocade ADX load balancer using SNMP on Cacti 0.8.8a.

I created an SNMP .xml query based on this page - http://www.cacti.net/downloads/docs/htm ... y_xml.html - and looking at the interface.xml that comes with Cacti.

I've tried various combinations of methods and sources in the 'ifSessions' field get the actual integer value (the session count) for each line, but so far I've only been able to get the query to pull the IP.

Can anyone shed any light on what I need to change to get it to pull the integer values of each line? Hopefully it's something simple that I've overlooked :)

Thanks!



Sample of snmpwalk output:
.1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.10 = INTEGER: 5356
.1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.11 = INTEGER: 872
.1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.12 = INTEGER: 4222
.1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.13 = INTEGER: 4398
.1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.14 = INTEGER: 498
My XML query:

Code: Select all

<query>
	<name>Get Brocade ADX VIPs</name>
	<description>Queries a Brocade ADX for a list of monitorable VIPs</description>
	<oid_index>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid_index>
	<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
	<index_order_type>numeric</index_order_type>
	<index_title_format>|chosen_order_field|</index_title_format>
	
	<fields>
		<ifIP>
			<name>VIP Address</name>
			<method>walk</method>
			<source>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifIP>
		<ifSessions>
			<name>Sessions</name>
			<method>walk</method>
			<source>VALUE/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifSessions>
	</fields>
</query>
Output from the verbose query in Cacti:

Code: Select all

+ Running data query [11].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/cacti-brocade-adx-vips.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15' Index Count: 164
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.10' value: '5482'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.11' value: '792'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.12' value: '3626'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.15' value: '3668'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.23' value: '458'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.10' results: 'xx.yy.zz.10'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.11' results: 'xx.yy.zz.11'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.12' results: 'xx.yy.zz.12'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.15' results: 'xx.yy.zz.15'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.23' results: 'xx.yy.zz.23'
+ Located input field 'ifIP' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15'
+ Found item [ifIP='xx.yy.zz.10'] index: xx.yy.zz.10 [from regexp oid parse]
+ Found item [ifIP='xx.yy.zz.11'] index: xx.yy.zz.11 [from regexp oid parse]
+ Found item [ifIP='xx.yy.zz.12'] index: xx.yy.zz.12 [from regexp oid parse]
+ Found item [ifIP='xx.yy.zz.15'] index: xx.yy.zz.15 [from regexp oid parse]
+ Found item [ifIP='xx.yy.zz.23'] index: xx.yy.zz.23 [from regexp oid parse]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: IPs in SNMP OIDs

Post by gandalf »

Please use

Code: Select all

<source>value</source>
for the <fields> as you already have the correct index.
You may want to have a read at the "Alteon Loadbalancer Templates" that I published years ago. This may help understanding
R.
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

gandalf wrote:Please use

Code: Select all

<source>value</source>
for the <fields> as you already have the correct index.
You may want to have a read at the "Alteon Loadbalancer Templates" that I published years ago. This may help understanding
R.
Thanks for the reply :)

I tried changing that line, but it still doesn't appear to work:

Code: Select all

<query>
	<name>Get Brocade ADX VIPs</name>
	<description>Queries a Brocade ADX for a list of monitorable VIPs</description>
	<oid_index>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid_index>
	<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
	<index_order>ifIP</index_order>
	<index_order_type>numeric</index_order_type>
	<index_title_format>|chosen_order_field|</index_title_format>
	
	<fields>
		<ifIP>
			<name>VIP Address</name>
			<method>walk</method>
			<source>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifIP>
		<ifSessions>
			<name>Sessions</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifSessions>
	</fields>
</query>
I think I tried about 15 different modifications of the ifSessions field last night (changing methods, sources, adding a . to the oid, omitting the oid entirely, etc), all to to no avail.

Any other ideas?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: IPs in SNMP OIDs

Post by gandalf »

Change input to output on ifSessions and do a verbose query. You should see numbers, then, as a proof for my assumption. Else, I have to dig deeper ...
R.
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

gandalf wrote:Change input to output on ifSessions and do a verbose query. You should see numbers, then, as a proof for my assumption. Else, I have to dig deeper ...
R.
If I change output to input (which is what I think you meant?) then I do get numbers:

Code: Select all

+ Located input field 'ifSessions' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15'
+ Found item [ifSessions='8114'] index: xx.yy.zz.10 [from value]
+ Found item [ifSessions='456'] index: xx.yy.zz.11 [from value]
+ Found item [ifSessions='3924'] index: xx.yy.zz.12 [from value]
+ Found item [ifSessions='3842'] index: xx.yy.zz.15 [from value]
+ Found item [ifSessions='426'] index: xx.yy.zz.23 [from value]
However from reading the docs, I thought input was designed for things that don't change (or change very rarely), and output was for things like sessions, packet counts, etc?
http://www.cacti.net/downloads/docs/html/snmp_query_xml.html wrote:A rule of thumb is that input fields contain semi-static data that is not graphable, while the output fields contain the data that will be graphed.
Thanks :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: IPs in SNMP OIDs

Post by gandalf »

JediFr3d wrote:If I change output to input (which is what I think you meant?) then I do get numbers:

Code: Select all

+ Located input field 'ifSessions' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15'
+ Found item [ifSessions='8114'] index: xx.yy.zz.10 [from value]
+ Found item [ifSessions='456'] index: xx.yy.zz.11 [from value]
+ Found item [ifSessions='3924'] index: xx.yy.zz.12 [from value]
+ Found item [ifSessions='3842'] index: xx.yy.zz.15 [from value]
+ Found item [ifSessions='426'] index: xx.yy.zz.23 [from value]
That is, what I expected
However from reading the docs, I thought input was designed for things that don't change (or change very rarely), and output was for things like sessions, packet counts, etc?
Sure, you're right. This was for testing only! But now you SEE the data you expect to graph. Please change back to "output" again and perform same procedure for all <fields>
R.
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

gandalf wrote:Sure, you're right. This was for testing only! But now you SEE the data you expect to graph. Please change back to "output" again and perform same procedure for all <fields>
After changing that one word, the verbose output no longer contains any mention of my ifSessions field.

Complete XML file:

Code: Select all

<query>
	<name>Get Brocade ADX VIPs</name>
	<description>Queries a Brocade ADX for a list of monitorable VIPs</description>
	<oid_index>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid_index>
	<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
	<index_order>ifIP</index_order>
	<index_order_type>numeric</index_order_type>
	<index_title_format>|chosen_order_field|</index_title_format>
	
	<fields>
		<ifIP>
			<name>VIP Address</name>
			<method>walk</method>
			<source>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifIP>
		<ifSessions>
			<name>Sessions</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
		</ifSessions>
	</fields>
</query>
Without wanting to jump to conclusions, could this be a bug?

Thanks for your continued help :)
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

Quick update: I've tried the same SNMP queries on a fresh 0.8.7g installation (on the same system) as well as another older 0.8.8a system and they also didn't work on either.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: IPs in SNMP OIDs

Post by gandalf »

Code: Select all

<query>
   <name>Get Brocade ADX VIPs</name>
   <description>Queries a Brocade ADX for a list of monitorable VIPs</description>
   <oid_index>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid_index>
   <oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
   <index_order>ifIP</index_order>
   <index_order_type>numeric</index_order_type>
   <index_title_format>|chosen_order_field|</index_title_format>
   
   <fields>
      <ifIP>
         <name>VIP Address</name>
         <method>walk</method>
         <source>index</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
      </ifIP>
      <ifSessions>
         <name>Sessions</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.1991.1.1.4.23.1.1.15</oid>
      </ifSessions>
   </fields>
</query>
Please try this one
R.
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

gandalf wrote:Please try this one
R.
Results look more-or-less the same:

Code: Select all

+ Running data query [11].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/cacti-brocade-adx-vips.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15' Index Count: 164
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.10' value: '7826'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.11' value: '1818'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.12' value: '8994'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.15' value: '6946'
+ Index found at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.23' value: '578'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.10' results: 'xx.yy.zz.10'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.11' results: 'xx.yy.zz.11'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.12' results: 'xx.yy.zz.12'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.15' results: 'xx.yy.zz.15'
+ index_parse at OID: '1.3.6.1.4.1.1991.1.1.4.23.1.1.15.xx.yy.zz.23' results: 'xx.yy.zz.23'
+ Located input field 'ifIP' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1991.1.1.4.23.1.1.15'
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

Any more bright ideas or progress with this issue?
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

Another thought... Is it worth trying 0.8.9 from SVN?

Thanks :)
Soup
Cacti User
Posts: 66
Joined: Tue Aug 07, 2012 10:02 am

Re: IPs in SNMP OIDs

Post by Soup »

JediFr3d wrote:
gandalf wrote:Sure, you're right. This was for testing only! But now you SEE the data you expect to graph. Please change back to "output" again and perform same procedure for all <fields>
After changing that one word, the verbose output no longer contains any mention of my ifSessions field.
[...]
Without wanting to jump to conclusions, could this be a bug?

Thanks for your continued help :)
I don't think your Data query debug will/should show the values it's going to poll, it's a debug to make sure your indexes work correctly (and it appears as though they are).

Changing the direction (input/output) was a test to make sure you were getting data from the SNMP query... you are... now you should be able to change the direction back and move onto the next step and create your data sources/graphs/etc....
phxbails
Posts: 2
Joined: Fri Oct 05, 2012 12:52 pm

Re: IPs in SNMP OIDs

Post by phxbails »

Looking for a ADX templete, did you finish one?
JediFr3d
Posts: 9
Joined: Fri Jul 13, 2012 3:45 pm

Re: IPs in SNMP OIDs

Post by JediFr3d »

phxbails wrote:Looking for a ADX templete, did you finish one?
No, I never got it to work :(
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest