snmp query and graph with multiple oid tree

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

Moderators: Developers, Moderators

Post Reply
annapatil
Posts: 35
Joined: Wed Oct 13, 2010 3:22 am

snmp query and graph with multiple oid tree

Post by annapatil »

Hi All,

I am trying to poll Interface Optical power detail, I want to take interface alias from .1.3.6.1.2.1.31.1.1.1.18 against each interface and Optical power from .1.3.6.1.4.1.2011.5.25.31.1.1.3.1.x. snmp query with no error but I am getting below unexpected output while creating graphs. Post finishing Index, alias are showing.

Please suggest changes.

Code: Select all

<query>
	<name>Get SNMP Interfaces Optical Power</name>
	<description>Queries a host for a list of monitorable interfaces</description>
	<oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
	<oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
	<index_order_type>numeric</index_order_type>
        <oid_index_parse>OID/REGEXP:^.*\.([0-9]{6,8}).*</oid_index_parse>
	 <index_order>ifIndex:ifAlias</index_order>
         <index_title_format>|chosen_order_field|</index_title_format>


        
	<fields>
                <ifIndex>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<source>OID/REGEXP:^.*\.([0-9]{6,8}).*</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.47.1.1.1.1.7</oid>
		</ifIndex>

		<!--<ifIndex>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.2.2.1.1</oid>
		</ifIndex>
		<ifOperStatus>
			<name>Status</name>
			<method>walk</method>
			<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-]{1})+\)$</source>
			<direction>input-output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.8</oid>
		</ifOperStatus>
		<ifAdminStatus>
			<name>AdminStatus</name>
			<method>walk</method>
			<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-]{1})+\)$</source>
			<direction>input-output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.7</oid>
		</ifAdminStatus>
		<ifDescr>
			<name>Description</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.2.2.1.2</oid>
		</ifDescr> -->
		<ifName>
			<name>Name (IF-MIB)</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.31.1.1.1.1</oid>
		</ifName>
		<ifAlias>
			<name>Alias (IF-MIB)</name>
			<method>walk</method>
			<output_format>ascii</output_format>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.31.1.1.1.18</oid>
		</ifAlias>
		<ifRx>
		   <name>Rx Power (dBm)</name>
		  <method>walk</method>
		  <source>value</source>
		  <direction>output</direction>
		  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8</oid>
		</ifRx>
		<ifTx>
		  <name>Tx Power (dBm)</name>
		  <method>walk</method>
		  <source>value</source>
		  <direction>output</direction>
		  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9</oid>
		</ifTx>
		<ifVoltage>
		  <name>Voltage (mV)</name>
		  <method>walk</method>
		  <source>value</source>
		  <direction>output</direction>
		  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.6</oid>
		</ifVoltage>
		<ifCurrent>
		  <name>Current (mA)</name>
		  <method>walk</method>
		  <source>value</source>
		  <direction>output</direction>
		  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.7</oid>
		</ifCurrent>
		<ifTemp>
		  <name>Temperature (ยบC)</name>
		  <method>walk</method>
		  <source>value</source>
		  <direction>output</direction>
		  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.5</oid>
		</ifTemp>
                <OpticalRxLowThreshold>
                  <name>OpticalRxLowThreshold</name>
                  <method>walk</method>
                  <source>value</source>
                  <direction>output</direction>
                  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.13</oid>
                </OpticalRxLowThreshold>
                <OpticalRxHighThreshold>
                  <name>OpticalRxHighThreshold</name>
                  <method>walk</method>
                  <source>value</source>
                  <direction>output</direction>
                  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.14</oid>
                </OpticalRxHighThreshold>
                <OpticalTxLowThreshold>
                  <name>OpticalTxLowThreshold</name>
                  <method>walk</method>
                  <source>value</source>
                  <direction>output</direction>
                  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.15</oid>
                </OpticalTxLowThreshold>
                  <OpticalTxHighThreshold>
                  <name>OpticalTxHighThreshold</name>
                  <method>walk</method>
                  <source>value</source>
                  <direction>output</direction>
                  <oid>.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.16</oid>
                </OpticalTxHighThreshold>

	</fields>
</query>
Attachments
snmp_query_error.JPG
snmp_query_error.JPG (70.17 KiB) Viewed 1884 times
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: snmp query and graph with multiple oid tree

Post by bmfmancini »

Try this index order

Code: Select all

<index_order>ifName:ifDescr:ifHwAddr:ifIndex</index_order>
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests