Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Fri Nov 28, 2014 11:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Question on SNMP response (and how to use them)
PostPosted: Sat Feb 18, 2012 5:29 pm 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
Hi,

I have probably a dumb question, but I'm stuck for the moment and maybe someone has a easy and fast solution for me.

I try to poll a Cisco router SHDSL Interface. I have lots of routers, most of them running in 2-wire or 4-wire mode.

I'm interested in graphing the quality of the links, specially the ATTENUATION and the NOISE MARGIN, also in CRC ERROR tracking ecc.

When I poll the interface for example for the ATTENUATION using the following OID: .1.3.6.1.2.1.10.48.1.5.1.1 I get the following answer

Code:
HDSL2-SHDSL-LINE-MIB::hdsl2ShdslEndpointCurrAtn.15.xtuC.customerSide.wirePair1 = INTEGER: 0 dB
HDSL2-SHDSL-LINE-MIB::hdsl2ShdslEndpointCurrAtn.15.xtuR.networkSide.wirePair1 = INTEGER: 1 dB


for the NOISE MARGIN OID: .1.3.6.1.2.1.10.48.1.5.1.2

Code:
HDSL2-SHDSL-LINE-MIB::hdsl2ShdslEndpointCurrSnrMgn.15.xtuC.customerSide.wirePair1 = INTEGER: 0 dB
HDSL2-SHDSL-LINE-MIB::hdsl2ShdslEndpointCurrSnrMgn.15.xtuR.networkSide.wirePair1 = INTEGER: 18 dB


The thing is I'm not interested in the xtuC values, only xtuR as this are the values seen by the router.

Is there a way to "cancel" them out? Maybe by a regex? Someone has an idea for me?

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Sun Feb 19, 2012 8:58 am 
Offline
Developer
User avatar

Joined: Thu Feb 20, 2003 10:16 am
Posts: 1596
Location: Canada
If you post the output from the snmpwalk using the -On option, to display only numeric, I might be able to help.

When you post the plain language output, it is impossible to see if there is a more specific OID you could be calling to get the value you want.

_________________
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Sun Feb 19, 2012 9:13 am 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
here the result of .1.3.6.1.2.1.10.48.1.5.1.2:

Code:
.1.3.6.1.2.1.10.48.1.5.1.2.15.1.2.1 = INTEGER: 0
.1.3.6.1.2.1.10.48.1.5.1.2.15.2.1.1 = INTEGER: 17


while .1.3.6.1.2.1.10.48.1.5.1.1:
Code:
.1.3.6.1.2.1.10.48.1.5.1.1.15.1.2.1 = INTEGER: 0
.1.3.6.1.2.1.10.48.1.5.1.1.15.2.1.1 = INTEGER: 4


the thing is that I'm not interested in the 0 value. But on the other side I can't call directly .1.3.6.1.2.1.10.48.1.5.1.1.15.2.1.1 for example, because if I have a interface working in 4wire mode in this way I will get only the result of one wire.

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Sun Feb 19, 2012 9:59 am 
Offline
Developer
User avatar

Joined: Thu Feb 20, 2003 10:16 am
Posts: 1596
Location: Canada
Why not just create two output entries in your XML, one for the customer side, and one for the network side, then in your graph just remove the one that isn't valid after creation?

Or have two graph templates, and apply the correct one when you create it.

_________________
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Sun Feb 19, 2012 10:41 am 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
mmmmmhhh

my XML file looks like this:

Code:
<interface>
        <name>SHDSL Line Statistics</name>
        <description>Query the SHDSL Attenuation Margin</description>
        <oid_index>.1.3.6.1.2.1.10.48.1.5.1.2</oid_index>
        <index_order>SNRDisp:ATNDisp</index_order>

   <fields>
        <SNRDisp>
                <name>SNR Disp</name>
                <method>walk</method>
                <source>value</source>
                <direction>input</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.2</oid>
        </SNRDisp>
        <ATNDisp>
                <name>ATN Disp</name>
                <method>walk</method>
                <source>value</source>
                <direction>input</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.1</oid>
        </ATNDisp>
        <SNR>
                <name>SNR Margin</name>
                <method>walk</method>
                <source>value</source>
                <direction>output</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.2</oid>
        </SNR>
        <ATN>
                <name>Attenuation</name>
                <method>walk</method>
                <source>value</source>
                <direction>output</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.1</oid>
        </ATN>
   </fields>
</interface>


do you think there is something wrong? I still can't get it to work, my graphs are always empty....

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Sun Feb 19, 2012 2:38 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
You did follow the step-by-step procedure for creating a new SNMP data query? See 1st link of my sig and scroll down to that very chapter.
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Tue Feb 21, 2012 1:51 pm 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
Yes I did it now 3 times. Always my graphs are empty. I'm sure it's just a small problem but I can't get it fixed.

This is what a rrd looks like:

.....
Code:
rrd_version = "0003"
step = 60
last_update = 1329850046
ds[atn_value].type = "COUNTER"
ds[atn_value].minimal_heartbeat = 120
ds[atn_value].min = 0.0000000000e+00
ds[atn_value].max = NaN
ds[atn_value].last_ds = "U"
ds[atn_value].value = NaN
ds[atn_value].unknown_sec = 28
ds[snr_value].type = "COUNTER"
ds[snr_value].minimal_heartbeat = 120
ds[snr_value].min = 0.0000000000e+00
ds[snr_value].max = NaN
ds[snr_value].last_ds = "U"
ds[snr_value].value = NaN
ds[snr_value].unknown_sec = 28
rra[0].cf = "AVERAGE"
rra[0].rows = 500



As already told above the result of the query on the command line looks like:
.1.3.6.1.2.1.10.48.1.5.1.2:
Code:
.1.3.6.1.2.1.10.48.1.5.1.2.15.1.2.1 = INTEGER: 0
.1.3.6.1.2.1.10.48.1.5.1.2.15.2.1.1 = INTEGER: 19

and
.1.3.6.1.2.1.10.48.1.5.1.1
Code:
.1.3.6.1.2.1.10.48.1.5.1.1.15.1.2.1 = INTEGER: 0
.1.3.6.1.2.1.10.48.1.5.1.1.15.2.1.1 = INTEGER: 1


I use in the data template as max and as min value always "0". As data source type I use "COUNTER".

When going under "Create graph for this host I see:
Attachment:
Console - Create New Graphs - Google Chrome_2012-02-21_19-49-42.png
Console - Create New Graphs - Google Chrome_2012-02-21_19-49-42.png [ 4.21 KiB | Viewed 867 times ]


Anyone an idea?

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Tue Feb 21, 2012 5:03 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
hmorandell wrote:
I use in the data template as max and as min value always "0". As data source type I use "COUNTER".
Why using COUNTER, when SNMP tells you it's an INTEGER? Use a GAUGE instead!
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Wed Feb 22, 2012 4:56 am 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
changed the data template but still not working.
I'm sure it must be a problem with the XML file. I try to fix it. It's definitely no problem of the data and graph template, that's for sure.

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Wed Feb 22, 2012 6:11 am 
Offline
Cacti Guru User

Joined: Thu Aug 05, 2010 2:04 am
Posts: 1573
Location: Japan
hmorandell wrote:
changed the data template but still not working.
I'm sure it must be a problem with the XML file. I try to fix it. It's definitely no problem of the data and graph template, that's for sure.

Maybe walking to ".1.3.6.1.2.1.10.48.1.5.1.2" is not appropriate as index.
Try to add this line:
Code:
<oid_index_parse>OID/REGEXP:.*\.([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)$</oid_index_parse>

Simulated verbose query:
Quote:
Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.10.48.1.5.1.2'
Index found at OID: '.1.3.6.1.2.1.10.48.1.5.1.2.15.1.2.1' value: '0'
Index found at OID: '.1.3.6.1.2.1.10.48.1.5.1.2.15.2.1.1' value: '19'
index_parse at OID: '.1.3.6.1.2.1.10.48.1.5.1.2.15.1.2.1' results: '15.1.2.1'
index_parse at OID: '.1.3.6.1.2.1.10.48.1.5.1.2.15.2.1.1' results: '15.2.1.1'
Located input field 'SNRDisp' [walk]
Executing SNMP walk for data @ '.1.3.6.1.2.1.10.48.1.5.1.2'
Found item [SNRDisp='0'] index: 15.1.2.1 [from value]
Found item [SNRDisp='19'] index: 15.2.1.1 [from value]
Located input field 'ATNDisp' [walk]
Executing SNMP walk for data @ '.1.3.6.1.2.1.10.48.1.5.1.1'
Found item [ATNDisp='0'] index: 15.1.2.1 [from value]
Found item [ATNDisp='1'] index: 15.2.1.1 [from value]


Top
 Profile  
 
 Post subject: Re: Question on SNMP response (and how to use them)
PostPosted: Wed Feb 22, 2012 6:31 am 
Offline
Cacti User

Joined: Mon May 03, 2010 11:48 am
Posts: 64
THX noname,

I did something similar to your solution and got it to work!!!

Here is how my XML file looks now:
Code:
<interface>
        <name>SHDSL Line Statistics</name>
        <description>Query the SHDSL Attenuation Margin</description>
        <oid_index>.1.3.6.1.2.1.10.48.1.5.1.2</oid_index>
        <oid_index_parse>OID/REGEXP:^.{24}[0-9]{1,2}\.(.*)</oid_index_parse>
        <index_order>Index</index_order>

   <fields>
                <Index>
                        <name>Index</name>
                        <source>index</source>
                        <direction>input</direction>
                </Index>
        <SNRDisp>
                <name>SNR Disp</name>
                <method>walk</method>
                <source>value</source>
                <direction>input</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.2</oid>
        </SNRDisp>
        <ATNDisp>
                <name>ATN Disp</name>
                <method>walk</method>
                <source>value</source>
                <direction>input</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.1</oid>
        </ATNDisp>
        <SNR>
                <name>SNR Margin</name>
                <method>walk</method>
                <source>value</source>
                <direction>output</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.2</oid>
        </SNR>
        <ATN>
                <name>Attenuation</name>
                <method>walk</method>
                <source>value</source>
                <direction>output</direction>
                <oid>.1.3.6.1.2.1.10.48.1.5.1.1</oid>
        </ATN>
   </fields>
</interface>

and this is a example verbose query (this is a CISCO with 3 SHDSL Interfaces!):

Quote:
Running data query [39].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/sdslStats.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.2.1.10.48.1.5.1.2' Index Count: 3
+ Index found at OID: '1.3.6.1.2.1.10.48.1.5.1.2.12.2.2.1' value: '15'
+ Index found at OID: '1.3.6.1.2.1.10.48.1.5.1.2.13.2.2.1' value: '13'
+ Index found at OID: '1.3.6.1.2.1.10.48.1.5.1.2.14.2.2.1' value: '13'
+ index_parse at OID: '1.3.6.1.2.1.10.48.1.5.1.2.12.2.2.1' results: '12.2.2.1'
+ index_parse at OID: '1.3.6.1.2.1.10.48.1.5.1.2.13.2.2.1' results: '13.2.2.1'
+ index_parse at OID: '1.3.6.1.2.1.10.48.1.5.1.2.14.2.2.1' results: '14.2.2.1'
+ Inserting index data for field 'Index' [value='12.2.2.1']
+ Inserting index data for field 'Index' [value='13.2.2.1']
+ Inserting index data for field 'Index' [value='14.2.2.1']
+ Located input field 'SNRDisp' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.10.48.1.5.1.2'
+ Found item [SNRDisp='15'] index: 12.2.2.1 [from value]
+ Found item [SNRDisp='13'] index: 13.2.2.1 [from value]
+ Found item [SNRDisp='13'] index: 14.2.2.1 [from value]
+ Located input field 'ATNDisp' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.10.48.1.5.1.1'
+ Found item [ATNDisp='19'] index: 12.2.2.1 [from value]
+ Found item [ATNDisp='18'] index: 13.2.2.1 [from value]
+ Found item [ATNDisp='18'] index: 14.2.2.1 [from value]


and this is one of the generated graphs. I will now do some finetuning, maybe add some more results (CRC errors), then if someone is interested I will post the scripts here.

Attachment:
ssssss.jpg
ssssss.jpg [ 33.04 KiB | Viewed 849 times ]

_________________
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group