Marc Engrie | 9 Dec 07:09 2014

Re: SNMP_util.pm problem

Hello Mike,

 

Indeed, “use Net_SNMP_util”  solved my issue.

Thx for explaining  how this issue occurs and how to solve it.

 

Knowing this, I wonder how MRTG, that is using these SNMP libs, is dealing with this kind of data.  I guess not in the correct way.

 

Kind Regards and have a great day

 

Marc Engrie

 

From: Mike Mitchell [mailto:Mike.Mitchell <at> sas.com]
Sent: Monday, December 08, 2014 10:24 PM
To: Marc Engrie
Subject: RE: SNMP_util.pm problem

 

I don't believe this is a problem with SNMP_util.pm

 

If we compare the two returned values, the "working" one ends with

04 01 30

and the "non-working" one ends with

42 05 00 ff ff ff ff

 

These are BER-encoded values. BER encoding starts with a data-type byte, then a length byte, followed by the data. A data-type of '04' is an octet-string, in other words a series of ASCII-printable bytes. So '04 01 30' says 'a one-byte string, hex 30'. Hex 30 is ascii '0'.

 

A data-type of 42 is "Application integer". So '42 05 00 ff ff ff' says 'an integer, five bytes long, value 0x00ffffff'.

 

No wonder you get different values printed. The two are in different data formats.

 

SNMP_util.pm is just a wrapper for SNMP_Session.pm. It is SNMP_Session.pm and BER.pm that are doing all the work.

 

There is also Net_SNMP_util.pm, with the exact same API as SNMP_util.pm. You could try using Net_SNMP_util.pm by just replacing the "use SNMP_util" line with "use Net_SNMP_util". Net_SNMP_util.pm is a wrapper for Net::SNMP, a different implementation of SNMP. You'll have to install the Net::SNMP perl module if you haven't already.

 

Mike Mitchell

 

From: mrtg <mrtg-bounces+mike.mitchell=sas.com <at> lists.oetiker.ch> on behalf of Marc Engrie <marc.engrie <at> sanoma.com>
Sent: Monday, December 8, 2014 1:40 AM
To: mrtg <at> lists.oetiker.ch
Subject: [mrtg] SNMP_util.pm problem

 

Hello,

 

I have been using MRTg and related lib for year now without problems but now I come against something strange and my guess is it is due to 64 bit integers.

I have been using the SNMP informant tool up to version 2013 without issues to query Windows machines for several info’s.  2013 was 32 bit oriented. The new version, 2014, is 64bit oriented.

 

When I use SNMP_util (version 1.15) in my own Perl scripts to query the CPU instances it returns me up nicely all instances when query is against version 2013.

Eg.

 

 

$VAR1 = [for CPU's ...

          '1.48:0',

          '1.49:1',

          '6.95.84.111.116.97.108:_Total'

        ];

 

When I use SNMP_util to query the CPU instances it returns me higher values when query is against version 2014.

 

$VAR1 = [for CPU's ...

          '1.48:4294967295',

          '1.49:4294967295',

          '6.95.84.111.116.97.108:4294967295'

        ];

 

One would think that the problem is due to SNMP Informant but when I use  GetIf, or Mib Browser from MG-soft  or Mib Browser from ManageEngine, they all return me the ‘right’ values: 0, 1, …

 

Using ManageEngine, one can debug the data and there I see that the return packet from the 2013 look like this

 

Sent Type: GET. RequestID: 54 to "10.2.144.33:161".

Sent Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 40

DATA

30 26 02 01 00 04 06 70 75 62 6c 69 63 a0 19 02 01 36 02 01

00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 02 00 05 00

Sent Type: GETNEXT. RequestID: 55 to "10.2.144.33:161".

Sent Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 44

DATA

30 2a 02 01 00 04 06 70 75 62 6c 69 63 a1 1d 02 01 37 02 01

00 02 01 00 30 12 30 10 06 0c 2b 06 01 04 01 cb 00 01 02 41

01 01 05 00

 

Packet from: 10.2.144.33:161 RequestID: 54

Received Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 52

DATA:

30 32 02 01 00 04 06 70 75 62 6c 69 63 a2 25 02 01 36 02 01

00 02 01 00 30 1a 30 18 06 08 2b 06 01 02 01 01 02 00 06 0c

2b 06 01 04 01 82 37 01 01 03 01 02

 

 

Packet from: 10.2.144.33:161 RequestID: 55

Received Time: Mon Dec 01 09:09:07:622 CET 2014

Length of SNMP DATA: 47

DATA:

30 2d 02 01 00 04 06 70 75 62 6c 69 63 a2 20 02 01 37 02 01

00 02 01 00 30 15 30 13 06 0e 2b 06 01 04 01 cb 00 01 02 41

01 01 01 30 04 01 30

 

 

 While looking at a 2014 result it looks like

 

Sent Type: GET. RequestID: 49 to "10.2.144.155:161".

Sent Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 40

DATA

30 26 02 01 00 04 06 70 75 62 6c 69 63 a0 19 02 01 31 02 01

00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 02 00 05 00

Sent Type: GETNEXT. RequestID: 50 to "10.2.144.155:161".

Sent Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 44

DATA

30 2a 02 01 00 04 06 70 75 62 6c 69 63 a1 1d 02 01 32 02 01

00 02 01 00 30 12 30 10 06 0c 2b 06 01 04 01 cb 00 01 02 41

01 01 05 00

 

Packet from: 10.2.144.155:161 RequestID: 49

Received Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 52

DATA:

30 32 02 01 00 04 06 70 75 62 6c 69 63 a2 25 02 01 31 02 01

00 02 01 00 30 1a 30 18 06 08 2b 06 01 02 01 01 02 00 06 0c

2b 06 01 04 01 82 37 01 01 03 01 02

 

 

Packet from: 10.2.144.155:161 RequestID: 50

Received Time: Mon Dec 01 09:08:34:689 CET 2014

Length of SNMP DATA: 51

DATA:

30 31 02 01 00 04 06 70 75 62 6c 69 63 a2 24 02 01 32 02 01

00 02 01 00 30 19 30 17 06 0e 2b 06 01 04 01 cb 00 01 02 41

01 01 01 30 42 05 00 ff ff ff ff

 

 

And there I see that an extra  ff ff ff ff  is return which SNMP_util interpretes in a different way.

 

Is there a way to tell SNMP_util that it needs to handle this kind of data as 64 bit integer, as I guess this is a 64 bit integer) and not as something else?

 

Thx for helping me to solve this puzzle of 32 & 64 bit stuff.

 

Kind regards

 

Marc Engrie
ICT Infrastructure Manager

Tel: +32 15 67 8398
GSM: +32 476 52 35 45

 

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Marc Engrie | 8 Dec 07:40 2014

SNMP_util.pm problem

Hello,

 

I have been using MRTg and related lib for year now without problems but now I come against something strange and my guess is it is due to 64 bit integers.

I have been using the SNMP informant tool up to version 2013 without issues to query Windows machines for several info’s.  2013 was 32 bit oriented. The new version, 2014, is 64bit oriented.

 

When I use SNMP_util (version 1.15) in my own Perl scripts to query the CPU instances it returns me up nicely all instances when query is against version 2013.

Eg.

 

 

$VAR1 = [for CPU's ...

          '1.48:0',

          '1.49:1',

          '6.95.84.111.116.97.108:_Total'

        ];

 

When I use SNMP_util to query the CPU instances it returns me higher values when query is against version 2014.

 

$VAR1 = [for CPU's ...

          '1.48:4294967295',

          '1.49:4294967295',

          '6.95.84.111.116.97.108:4294967295'

        ];

 

One would think that the problem is due to SNMP Informant but when I use  GetIf, or Mib Browser from MG-soft  or Mib Browser from ManageEngine, they all return me the ‘right’ values: 0, 1, …

 

Using ManageEngine, one can debug the data and there I see that the return packet from the 2013 look like this

 

Sent Type: GET. RequestID: 54 to "10.2.144.33:161".

Sent Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 40

DATA

30 26 02 01 00 04 06 70 75 62 6c 69 63 a0 19 02 01 36 02 01

00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 02 00 05 00

Sent Type: GETNEXT. RequestID: 55 to "10.2.144.33:161".

Sent Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 44

DATA

30 2a 02 01 00 04 06 70 75 62 6c 69 63 a1 1d 02 01 37 02 01

00 02 01 00 30 12 30 10 06 0c 2b 06 01 04 01 cb 00 01 02 41

01 01 05 00

 

Packet from: 10.2.144.33:161 RequestID: 54

Received Time: Mon Dec 01 09:09:06:748 CET 2014

Length of SNMP DATA: 52

DATA:

30 32 02 01 00 04 06 70 75 62 6c 69 63 a2 25 02 01 36 02 01

00 02 01 00 30 1a 30 18 06 08 2b 06 01 02 01 01 02 00 06 0c

2b 06 01 04 01 82 37 01 01 03 01 02

 

 

Packet from: 10.2.144.33:161 RequestID: 55

Received Time: Mon Dec 01 09:09:07:622 CET 2014

Length of SNMP DATA: 47

DATA:

30 2d 02 01 00 04 06 70 75 62 6c 69 63 a2 20 02 01 37 02 01

00 02 01 00 30 15 30 13 06 0e 2b 06 01 04 01 cb 00 01 02 41

01 01 01 30 04 01 30

 

 

 While looking at a 2014 result it looks like

 

Sent Type: GET. RequestID: 49 to "10.2.144.155:161".

Sent Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 40

DATA

30 26 02 01 00 04 06 70 75 62 6c 69 63 a0 19 02 01 31 02 01

00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 02 00 05 00

Sent Type: GETNEXT. RequestID: 50 to "10.2.144.155:161".

Sent Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 44

DATA

30 2a 02 01 00 04 06 70 75 62 6c 69 63 a1 1d 02 01 32 02 01

00 02 01 00 30 12 30 10 06 0c 2b 06 01 04 01 cb 00 01 02 41

01 01 05 00

 

Packet from: 10.2.144.155:161 RequestID: 49

Received Time: Mon Dec 01 09:08:34:673 CET 2014

Length of SNMP DATA: 52

DATA:

30 32 02 01 00 04 06 70 75 62 6c 69 63 a2 25 02 01 31 02 01

00 02 01 00 30 1a 30 18 06 08 2b 06 01 02 01 01 02 00 06 0c

2b 06 01 04 01 82 37 01 01 03 01 02

 

 

Packet from: 10.2.144.155:161 RequestID: 50

Received Time: Mon Dec 01 09:08:34:689 CET 2014

Length of SNMP DATA: 51

DATA:

30 31 02 01 00 04 06 70 75 62 6c 69 63 a2 24 02 01 32 02 01

00 02 01 00 30 19 30 17 06 0e 2b 06 01 04 01 cb 00 01 02 41

01 01 01 30 42 05 00 ff ff ff ff

 

 

And there I see that an extra  ff ff ff ff  is return which SNMP_util interpretes in a different way.

 

Is there a way to tell SNMP_util that it needs to handle this kind of data as 64 bit integer, as I guess this is a 64 bit integer) and not as something else?

 

Thx for helping me to solve this puzzle of 32 & 64 bit stuff.

 

Kind regards

 

Marc Engrie
ICT Infrastructure Manager

Tel: +32 15 67 8398
GSM: +32 476 52 35 45

 

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Christian Arnaut | 25 Nov 23:05 2014
Picon

SNMP Disk Space Negative Values

Am attempting to use MRTG to monitor disk space on a Windows Server as I have done on multiple servers and workstations in the past. However, this time the local storage capacity on the local drive partition is nearly 15TB.
 
It appears that I have exceeded an SNMP threshold where the integer values are now negative numbers. For example to monitor total space on the C: drive I used (simplified)... iso.3.6.1.2.1.25.2.3.1.4.2 * iso.3.6.1.2.1.25.2.3.1.6.2
 
iso.3.6.1.2.1.25.2.3.1.3.2 = STRING: "C:\\ Label:"
iso.3.6.1.2.1.25.2.3.1.3.4 = STRING: "E:\\ Label:"
iso.3.6.1.2.1.25.2.3.1.4.2 = INTEGER: 4096
iso.3.6.1.2.1.25.2.3.1.4.4 = INTEGER: 4096
iso.3.6.1.2.1.25.2.3.1.5.2 = INTEGER: 10350335
iso.3.6.1.2.1.25.2.3.1.5.4 = INTEGER: -268468737
iso.3.6.1.2.1.25.2.3.1.6.2 = INTEGER: 6261795
iso.3.6.1.2.1.25.2.3.1.6.4 = INTEGER: -527400222
 
With the E: drive, iso.3.6.1.2.1.25.2.3.1.4.4 correctly shows the cluster size (4096). However, I am sure the total number of clusters isn't '-527400222'. Even if I used the absolute value of 527400222, the numbers don't add up to the 15TB partition size.
 
Any suggestions? Or have I reached the limitation of MRTG for the purpose I am looking for?
 
 
Thank you, in advance, for any assistance!

~Christian
_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Christian Arnaut | 19 Nov 17:45 2014
Picon

Same config, differing results...

<!-- .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 12pt; font-family:Calibri } -->
I have a test (virtual) Debian server that I use for testing new applications, configs, etc. before they are deployed to my production Debian server. MRTG is amongst the apps that I use the virtual server for.
 
Currently I am using the identical cfg file to monitor bandwidth on a Windows 7 wireless network adaptor on my laptop. On the test server, the graphed results are exactly what I intended. However, the exact cfg file on the production server produces dramatically different results. On the production environment, the graph is a continually growing saw-tooth graph that almost appears to be showing the uptime of the interface. If, after a few hours, I turn off the wireless interface and turn it back on, the graph drops to zero and the saw-tooth begins again. Conversely, on the test server, the bandwidth logs continue to be logged and displayed exactly as intended.
 
Two servers, both running the same OS (Debian 7.7), both running the same version of MRTG (2.7.14) and both running the same config for the intended interface (below). What am I possibly missing?
 
 
Thanks, in advance, for any suggestions!
~Christian
 
(cfg file below)
 
EnableIPv6: no
Options[_]: gauge
WorkDir: /var/www/mrtg/user

Target[user-eth1]: 12:xxxxpublic <at> 192.168.0.77:
SetEnv[user-eth1]: MRTG_INT_IP="192.168.3.55" MRTG_INT_DESCR="Intel(R)-Centrino(R)-Advanced-N-6205"
MaxBytes[user-eth1]: 16250000
Options[_]: bits
Title[user-eth1]: Traffic Analysis for user -- WiFi Connection
PageTop[user-eth1]: <h1>Traffic Analysis for user -- WiFi Connection</h1>
                <div id="sysdetails">
                        <table>
                                <tr>
                                        <td>System:</td>
                                        <td>user-2519.xxxx.local in </td>
                                </tr>
                                <tr>
                                        <td>Maintainer:</td>
                                        <td>user <at> xxxx.org</td>
                                </tr>
                                <tr>
                                        <td>Description:</td>
                                        <td>Intel(R)-Centrino(R)-Advanced-N-6205  </td>
                                </tr>
#                                <tr>
#                                        <td>ifType:</td>
#                                        <td>Radio Spread Spectrum (802.11) (71)</td>
#                                </tr>
                                <tr>
                                        <td>ifName:</td>
                                        <td>WiFi Connection</td>
                                </tr>
                                <tr>
                                        <td>Max Speed:</td>
                                        <td>104.0 Mbits/s</td>
                                </tr>
                                <tr>
                                        <td>Ip:</td>
                                        <td>192.168.3.55 (user-2519.xxxx.local)</td>
                                </tr>
                        </table>
                </div>
_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Dave Heritage | 10 Nov 20:56 2014

Re: HTML not beign generated

Windows.

The interface html pages are not updating.  The base index.html is fine.

All of the graphs are correct if I manually build an interfacename.html (as if it had made it on its own).

I just re-verified the clock on the server is correct (TZ and time date itself).

I have not tried to just run mrtg once (as the .cfg files have daemon:yes in them).

 

The graphs are not the issue as far as I can tell.  It is just that the interface html pages are not created (or updated).  If I open one that used to update properly, it still shows the last update time as weeks ago.  Additionally, I run three mrtg (wperl) processes with different config files that output to different directories.  My two 'newer' cfg files are creating the graphs fine, but it has never created the interface html files at all.

 

Dave

 

From: Courtney, Wrolf [mailto:Wrolf.Courtney <at> mtahq.org]
Sent: Monday, November 10, 2014 9:19 AM
To: Dave Heritage; 'mrtg <at> lists.oetiker.ch'
Subject: RE: [mrtg] HTML not beign generated

 

Is this Linux or Windoze?

 

Exactly what is not updating? The graphs on the index.html for the device, or the graphs when you drill down to the individual interfaces?

 

Do the pages update OK if you do a manual refresh page?

 

Is the clock set right on the server?

 

If you manually run mrtg from the command line on the server, do the graphs update?

 

Wrolf

 

From: mrtg [mailto:mrtg-bounces+wrolf.courtney=nyct.com <at> lists.oetiker.ch] On Behalf Of Dave Heritage
Sent: Monday, November 10, 2014 10:11 AM
To: 'mrtg <at> lists.oetiker.ch'
Subject: Re: [mrtg] HTML not beign generated

 

I have had MRTG set up and running for some time.  All of a sudden (About 4 weeks ago now) the html pages for the graphs stopped being generated.  I have re-run cfgmaker and compared the newly generated file against what I am running with no changes seen.  All of the graphs are created properly.  Indexmaker created the index page without issue.  Any ideas?

 

David Heritage

dave <at> onxinc.com

ONX, Inc.

918.660.2880

888.664.2880

Read my blog at http://www.mymsfight.com

 

 

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Dave Heritage | 10 Nov 16:10 2014

Re: HTML not beign generated

I have had MRTG set up and running for some time.  All of a sudden (About 4 weeks ago now) the html pages for the graphs stopped being generated.  I have re-run cfgmaker and compared the newly generated file against what I am running with no changes seen.  All of the graphs are created properly.  Indexmaker created the index page without issue.  Any ideas?

 

David Heritage

dave <at> onxinc.com

ONX, Inc.

918.660.2880

888.664.2880

Read my blog at http://www.mymsfight.com

 

 

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Fred Weston | 4 Nov 23:19 2014
Picon

Graph under reporting utilization

I am running MRTG 2.16.2, which I realize is quite old.  I haven't had
occassion or need to upgrade it in quite some time.

I use it to monitor several network links and it works very well for
all but one.  I am using it to monitor the interface utilization of a
1 Gb/s ethernet port on a Cisco 3850 switch and while MRTG does get
data and creates a graph, I don't believe the data it is presenting is
accurate.

Here is the config snippet from my mrtg.cfg:

Target[colo-metro-ethernet-utilization]: 50:public <at> 192.168.198.1:
SetEnv[colo-metro-ethernet-utilization]: MRTG_INT_IP=""
MRTG_INT_DESCR="GigabitEthernet1/0/48"
MaxBytes[colo-metro-ethernet-utilization]: 125000000
Title[colo-metro-ethernet-utilization]: Traffic Analysis for 50 -- COLO-STACK

Here is an example of the daily graph that is generated by MRTG:
https://lpga.box.com/shared/static/vefa3l9dxhmdgifgpw6f.png

The problem is that these numbers do not seem correct to me (they seem
to be significantly under reporting utilization).

That seems to be confirmed by what the switch itself says:

5 minute input rate 46968000 bits/sec, 14177 packets/sec
5 minute output rate 306860000 bits/sec, 28679 packets/sec

This was taken from the switch around the same time the graph above
was generated.  The switch seems to indicate the 5 min utilization
rate is about 58.5 MB/s while MRTG is only showing about 18.2 MB/s.

I'm not sure why there's a discrepancy.  Am I doing something wrong or
missing something simple?

Thanks,
FW
Werner | 28 Oct 12:01 2014
Picon

How can I maximize the Y values​​?

The curve creeps just above the x-axis.
How can I maximize the Y values​​?
--

-- 
W e r n e r  G "u n z l
Professor i.R.
Pappelweg 9
78713 SCHRAMBERG-Sulgen
Tel.: 07422/8550
FAX:  07422/52798
Email: wguenzl <at> guenzl.net

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Waqas Asghar | 15 Oct 12:24 2014
Picon

Plot only in traffic

Hi

I want to only plot in traffic of a cisco router interface any idea how that can be achieved ?


Regards,
Waqas Asghar
+923335495619
_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Christian | 3 Oct 15:00 2014
Picon

sysName persistence across reboot?

Hi,

I apologize in advance if my question is not relevant to this mailing list. It's not about mrtg functionality but general SNMP protocol.

 

I just want to know if there is a standard or specification that dictates SNMP objects persistence after a reboot. Specifically the sysName, sysLocation and sysContact. I've come across some devices that reset these to their default factory value after each reboot.

 

Is this a common behavior? How many devices like that have you seen? What's your experience with sysName, etc.?

 

Thank you

Christian

_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Yunus Adejumo | 2 Oct 16:14 2014
Picon

How can I capture wlan0 interface of EAP150

Dear All,

Please, how do I specify and receive capture logs from EAP150. It is easier getting data from the eth0 interface but the wireless does not return any value.

Thank you.
 
Yunus Adejumo
Information Technology and Communications Unit (INTECU)
Obafemi Awolowo University, Ile-Ife
Tel:08054149570, 07051091415
_______________________________________________
mrtg mailing list
mrtg <at> lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Gmane