[mrtg] pulling snr data error

MMartin at jwpepper.com MMartin at jwpepper.com
Wed Jan 18 16:43:46 CET 2012


Lee,

It looks correct from here... If you already tried the things I suggested, 
and if it does work from the command line, then I'm not really sure what 
else it could be.

Here's a thought though. Is the IP Address you are running the snmpget 
from the command line, the same as the one that is running MRTG from..? 
Cause there could be some kind of IP Filtering on the device to only allow 
snmpget requests from a specific IP Address...?

Here is an example that I use that uses snmp version 2:  I use this cfg 
file to collect CPU-Usage Data from my firewall.

Target[firewall.cpu-5sec]: 
1.3.6.1.4.1.9.9.109.1.1.1.1.3.1&1.3.6.1.4.1.9.9.109.1.1.1.1.3.1:public at 192.168.3.1:::::2
Title[firewall.cpu-5sec]: PIX-ASA CPU Usage Average Per 5 Seconds
YLegend[firewall.cpu-5sec]: Percentage
ShortLegend[firewall.cpu-5sec]: %
Legend1[firewall.cpu-5sec]: CPU Use in %
Legend3[firewall.cpu-5sec]: Max Observed CPU Use
LegendI[firewall.cpu-5sec]:  CPU Use:
WithPeak[firewall.cpu-5sec]: ywm
MaxBytes[firewall.cpu-5sec]: 100
Options[firewall.cpu-5sec]: growright, gauge, nopercent, noo
routers.cgi*GraphStyle[firewall.cpu-5sec]: stack
routers.cgi*InSummary[firewall.cpu-5sec]: yes
routers.cgi*InCompact[firewall.cpu-5sec]: yes
routers.cgi*Graph[firewall.cpu-5sec]: CPU-Average Totals
PageTop[firewall.cpu-5sec]: <h1>ASADB CPU Use</h1>


Thanks,
Matt




From:   Lee Todd <ltodd2 at hallmark-uk.com>
To:     <MMartin at jwpepper.com>
Cc:     <mrtg at lists.oetiker.ch>
Date:   01/18/2012 10:29 AM
Subject:        Re: [mrtg] pulling snr data error
Sent by:        <mrtg-bounces+mmartin=jwpepper.com at lists.oetiker.ch>





Matt

Sorry I was meaning I have added the:::::2 at the end to make sure.
Here is the complete cfg


EnableIPv6: no
workdir:/var/www/mrtg/test
options[_]: growright,bits



XSize[_]: 500
YSize[_]: 100

Target[Gauge32]:.1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4.12:test at 172.20.129.2:::::2
Title[Gauge32]: Cisco 887 SNR Analysis
PNGTitle[Gauge32]: Cisco 887 SNR Analysis
Background[Gauge32]: #ffffff
PageTop[Gauge32]: <H1>Cisco 887 SNR Analysis</H1>
WithPeak[Gauge32]: wmy
MaxBytes[Gauge32]: 200000
Options[Gauge32]: gauge, nopercent
YLegend[Gauge32]: SNR Value
ShortLegend[Gauge32]: dB
Legend1[Gauge32]: Average
Legend2[Gauge32]:
Legend3[Gauge32]: Maximum
Legend4[Gauge32]:
LegendI[Gauge32]: Local SNR:
LegendO[Gauge32]: Remote SNR:




From:       MMartin at jwpepper.com
To:         Lee Todd <ltodd2 at hallmark-uk.com>,
Cc:         mrtg at lists.oetiker.ch
Date:       18/01/2012 15:20
Subject:    Re: [mrtg] pulling snr data error



Lee,

I'm sorry, what's the "5" for your adding..?

Can you send me your Target line directly from you cfg file?
Since it does work from the command line there must be some kind of simple
error or something in the Target line we're not seeing.

For your Target line, after the directive (i.e. "Target[my-target]:) it
should have the following format:

                                Target[my-target-name]: OID1&OID2:
communityName at IPaddress:::::2

Target Line Parts:
                OID1 = .1.3.6.1.2.1.10.94.1.1.3.1.4.12
                OID2 = .1.3.6.1.2.1.10.94.1.1.3.1.4.12
   Community name =  public     --> or whatever you have it set to.
(default is usually "public")
          IP Address = 172.20.129.2
        SNMP Options = :::::2            --> only if it's using verison
"2c"


Target[my-target-name]: .1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4.12:public at 172.20.129.2:::::2
                                                ---OR---
Target[my-target-name]: .1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4.12:public at 172.20.129.2
                                                ---OR---
Target[my-target-name]: 1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&1.3.6.1.2.1.10.94­.1.1.2.1.4.12:public at 172.20.129.2
                                                ---OR---
Target[my-target-name]: 1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&1.3.6.1.2.1.10.94­.1.1.2.1.4.12:public at 172.20.129.2:::::2
                                    ---Rest of Target Definition---

Title[my-target-name]: Cisco 887 SNR Analysis
PNGTitle[my-target-name]: Cisco 887 SNR Analysis
Legend1[my-target-name]: Average
Legend2[my-target-name]:
Legend3[my-target-name]: Maximum
Legend4[my-target-name]:
LegendI[my-target-name]: Local SNR:
LegendO[my-target-name]: Remote SNR:
YLegend[my-target-name]: SNR Value
Background[my-target-name]: #ffffff
WithPeak[my-target-name]: wmy
MaxBytes[my-target-name]: 200000
Options[my-target-name]: gauge,nopercent
ShortLegend[my-target-name]: dB
PageTop[my-target-name]: <H1>Cisco 887 SNR Analysis</H1>


Thanks,
Matt






From:        Lee Todd <ltodd2 at hallmark-uk.com>
To:        <MMartin at jwpepper.com>
Cc:        Ian <ian at acces.co.jp>, <mrtg at lists.oetiker.ch>
Date:        01/18/2012 09:55 AM
Subject:        Re: [mrtg] pulling snr data error





Matt

Tried removing the . and adding the 5 : at the end.  All I get now when
running it is

env LANG=C /usr/bin/mrtg /etc/mrtg/test.cfg
2012-01-18 14:49:14: ERROR: Target[gauge32][_IN_] '.1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4. $target->[0]{$mode} ' 
(kill):
Unrecognized character \xC2 at (eval 17) line 1.
2012-01-18 14:49:14: ERROR: Target[gauge32][_OUT_] '.1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4. $target->[0]{$mode} ' 
(kill):
Unrecognized character \xC2 at (eval 18) line 1.


SNMP must be working because the mrtg graphs even through contain no data
do have the systems host name at the top with the uptime so it is
communicating.

The spaces must be some strange formatting issue.  I have noticed that to
edit the cfg I have to open them from my workstation using gedit since vim
and nano do very strange things when I move the cursor across the OID
numbers.

I have got this working in NagiosXI but that is just a demo we have and
expires in 2 days so want to do it in mrtg and in time rrd.

Lee


From:       MMartin at jwpepper.com
To:         Lee Todd <ltodd2 at hallmark-uk.com>,
Cc:         Ian <ian at acces.co.jp>, mrtg at lists.oetiker.ch
Date:       18/01/2012 14:43
Subject:    Re: [mrtg] pulling snr data error



Lee,

       "do you get a good answer from this query?
      snmpget -c test -v 1 172.20.129.2 .1.3.6.1.2.1.10.­ 94.1.1.3.1.4.12
      snmpget -c test -v 1 172.20.129.2 .1.3.6.1.2.1.10.­ 94.1.1.2.1.4.12"

I'm assuming that the space between the 10 and 94 is just is typo. But
anyway there's is a few things I would try.

First try removing the "." that starts out the OID. That might help. But
most likely that's not the problem.
Also, in you cfg file for the device. When you do version "2" on the
"Target[_]:" line don't use the "c" I don't think MRTG recognizes that.

So for example, you would just use version "2" like this:
Target[my-target-name]:.1.3.6.1.2.1.10.­
94.1.1.3.1.4.12&.1.3.6.1.2.1.10.94­.1.1.2.1.4.12:test at 172.20.129.2:::::2
It should end with 5 ":" colons, followed by a 2.

This is from the cfgmaker man page:
--snmp-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]]
                         Specify default SNMP options to be appended to
all
                         routers following.  Individual fields can be
empty.
                        Routers following might override some or all of
the
                          options given to --snmp-options.


Also, your "Target:" name should be a unique name for each separate
device/interface or you can think of it as for each separate graph. 
Because
MRTG will use the target name as the filename for the RRD file.

One other thing you might try would be to telnet to the router and check
out what the "snmp" or "snmp-server" settings are. There you should be 
able
to see what the SNMP version is too.

-Matt



From:        Lee Todd <ltodd2 at hallmark-uk.com>
To:        Ian <ian at acces.co.jp>, <mrtg at lists.oetiker.ch>,
<MMartin at jwpepper.com>
Date:        01/18/2012 03:31 AM
Subject:        Re: [mrtg] pulling snr data error





Ian and  Matt

I can run snmpget and below is what I get from it

snmpget -t 1 -r 5 -m '' -v 2c -c test
172.20.129.16:161 .1.3.6.1.2.1.10.94.1.1.2.1.4.12
iso.3.6.1.2.1.10.94.1.1.2.1.4.12 = Gauge32: 72

snmpget -t 1 -r 5 -m '' -v 2c -c test
172.20.129.16:161 .1.3.6.1.2.1.10.94.1.1.3.1.4.12
iso.3.6.1.2.1.10.94.1.1.3.1.4.12 = Gauge32: 58

I have tried using -v 2c and -v 1 and both work



From:       Ian <ian at acces.co.jp>
To:         mrtg at lists.oetiker.ch,
Date:       18/01/2012 00:15
Subject:    Re: [mrtg] pulling snr data error
Sent by:    mrtg-bounces+ltodd2=hallmark-uk.com at lists.oetiker.ch



> I have been trying to pull snr data from a cisco 887 router.  I got a
base
> cfg from the web and changed what I think is correct but when I run it I
> get the following error.  Prob a really silly thing but im just not
seeing
> it.

do you get a good answer from this query?
snmpget -c test -v 1 172.20.129.2 .1.3.6.1.2.1.10.­ 94.1.1.3.1.4.12
snmpget -c test -v 1 172.20.129.2 .1.3.6.1.2.1.10.­ 94.1.1.2.1.4.12


_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg



Registered Office: Bingley Road, Bradford, BD9 6SD

Registered in England no. 03414540



The information contained in this e-mail and any accompanying documents

may contain information that is confidential or otherwise protected from

disclosure. If you are not the intended recipient of this message, or if

this message has been addressed to you in error, please immediately

alert the sender by reply e-mail and then delete this message, including

any attachments. Any dissemination, distribution or other use of the

contents of this message by anyone other than the intended recipient is

strictly prohibited.



Unless specifically stated in this e mail, the agreement and content

of this correspondence is subject to contract.

No contract is implied by this correspondence, unless specifically

stated as a contract (purchase order or sales order)



Think of the environment; please don't print this e-mail unless you

really need to




Registered Office: Bingley Road, Bradford, BD9 6SD

Registered in England no. 03414540



The information contained in this e-mail and any accompanying documents

may contain information that is confidential or otherwise protected from

disclosure. If you are not the intended recipient of this message, or if

this message has been addressed to you in error, please immediately

alert the sender by reply e-mail and then delete this message, including

any attachments. Any dissemination, distribution or other use of the

contents of this message by anyone other than the intended recipient is

strictly prohibited.



Unless specifically stated in this e mail, the agreement and content

of this correspondence is subject to contract.

No contract is implied by this correspondence, unless specifically

stated as a contract (purchase order or sales order)



Think of the environment; please don't print this e-mail unless you

really need to




Registered Office: Bingley Road, Bradford, BD9 6SD
Registered in England no. 03414540

The information contained in this e-mail and any accompanying documents
may contain information that is confidential or otherwise protected from
disclosure. If you are not the intended recipient of this message, or if
this message has been addressed to you in error, please immediately
alert the sender by reply e-mail and then delete this message, including
any attachments. Any dissemination, distribution or other use of the
contents of this message by anyone other than the intended recipient is
strictly prohibited.

Unless specifically stated in this e mail, the agreement and content 
of this correspondence is subject to contract. 
No contract is implied by this correspondence, unless specifically 
stated as a contract (purchase order or sales order)

Think of the environment; please don't print this e-mail unless you
really need to

_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20120118/e5412e7f/attachment-0001.htm 


More information about the mrtg mailing list