SteScho / manubulon-snmp

Set of Icinga/Nagios plugins to check hosts and hardware with the SNMP protocol.
GNU General Public License v2.0
73 stars 71 forks source link

check_snmp_load.pl with -T netsl uses wrong oid #66

Open hboetes opened 5 years ago

hboetes commented 5 years ago

Using the latest version from git I get this:

# ./check_snmp_load.pl -v -H habocp1 -C public -2 -T netsl -w 5,5,4 -c 7,7,5
Alarm in 5 seconds
SNMP v2c login
Checking linux load
ERROR: Description table : The requested table is empty or does not exist.

And that's because the wrong oid is requested.

 00:00:00.000000 5a:61:54:8f:4c:42 > ac:1f:6b:28:03:c0, ethertype IPv4 (0x0800), length 87: 10.10.8.17.33869 > 10.10.10.230.161:  GetBulk(30)  N=0 M=25 .1.3.6.1.2.1.25.3.3.1.1

If I'd request the right oid I do get an answer:

# snmpwalk -v2c -c public habocp1 .1.3.6.1.4.1.2021.10.1.3.3                
iso.3.6.1.4.1.2021.10.1.3.3 = STRING: "0.28"

Reading the code:

# Generic with host-ressource-mib                                                                                              
my $base_proc = "1.3.6.1.2.1.25.3.3.1";      # oid for all proc info                                                           
my $proc_id   = "1.3.6.1.2.1.25.3.3.1.1";    # list of processors (product ID)                                                 
my $proc_load = "1.3.6.1.2.1.25.3.3.1.2";    # %time the proc was not idle over last minute                                    

# Linux load                                                                                                                   

my $linload_table = "1.3.6.1.4.1.2021.10.1";      # net-snmp load table                                                        
my $linload_name  = "1.3.6.1.4.1.2021.10.1.2";    # text 'Load-1','Load-5', 'Load-15'                                          
my $linload_load  = "1.3.6.1.4.1.2021.10.1.3";    # effective load table                                                       
dnsmichi commented 5 years ago

I don't have access to such a test system, can you send a PR please?

hboetes commented 5 years ago

I don't have access to such a test system, can you send a PR please?

Hello @dnsmichi, thanks for your reply. What do you mean with a PR? This is on an ubuntu 18.04 host.

dnsmichi commented 5 years ago

A patch for the source code sent in here as a Pull Request. https://github.com/dnsmichi/manubulon-snmp#contributing

hboetes commented 5 years ago

Hello @dnsmichi,

Ah, now I get it. If I would know the solution I would have made a PR. Alas, the code is beyond me.

On Fri, 8 Nov 2019, 15:55 Michael Friedrich, notifications@github.com wrote:

A patch for the source code sent in here as a Pull Request. https://github.com/dnsmichi/manubulon-snmp#contributing

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dnsmichi/manubulon-snmp/issues/66?email_source=notifications&email_token=AARN5KI3YTNBI7Y72QJM7PDQSV4VHA5CNFSM4JKVY5I2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDSLEYA#issuecomment-551858784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARN5KPDMK43NEVRPBXTA63QSV4VHANCNFSM4JKVY5IQ .