Problem with Check_Snmp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Problem with Check_Snmp

Post by itf009 »

Hi, I have a Problem with my nagios 4.3.4 (Raspbian)

I want to check for example the WAN-IP of My Router. Its an Lancom 1781AW

I have configured the Switch.cfg File as follows:

Code: Select all

 define service{
use generic-service ; Inherit values from a template
host_name GM-PS
service_description WAN IP
check_command check_snmp!-C public -o .1.3.6.1.4.1.2356.11.1.4.13.1.1.3 -m all

}

The MIB File is located : /usr/share/snmp/mibs

the nagios web interface service shows:

CRITICAL - Plugin timed out while executing system call

I have check_snmp Plugin in /usr/local/nagioslibexec



The SNMP Service is enabled in the Router . The Community names public

I have checked SNMP manually and I get response and Lots of Oids are shown:

Command: snmpwalk -v2c 192.168.172.1 -c public

Part of what Snmpwalk shows:

Code: Select all

iso.3.6.1.2.1.1.1.0 = STRING: "LANCOM 1781AW 10.12.0084 / 19.10.2017 4002851518100372"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.2356.11.8.607
iso.3.6.1.2.1.1.3.0 = Timeticks: (32504991) 3 days, 18:17:29.91
iso.3.6.1.2.1.1.4.0 = ""
iso.3.6.1.2.1.1.5.0 = STRING: "GM-PS"
iso.3.6.1.2.1.1.6.0 = ""
iso.3.6.1.2.1.1.7.0 = INTEGER: 14
iso.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
When I run ./check_snmp -H 192.168.172.1 -C public -o .1.3.6.1.4.1.2356.11.1.4.13.1 -m allfor example

I get an Timeout

CRITICAL - Plugin timed out while executing system call

Part of my MIB file:

Code: Select all

-- {ROW} 1.3.6.1.4.1.2356.11.1.4.13.1.1
lcsStatusWanIpAddressesIpv4Entry OBJECT-TYPE
SYNTAX LcsStatusWanIpAddressesIpv4Entry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX {
lcsStatusWanIpAddressesIpv4EntryPeer
}
::= { lcsStatusWanIpAddressesIpv4Table 1 }

LcsStatusWanIpAddressesIpv4Entry ::= SEQUENCE {
lcsStatusWanIpAddressesIpv4EntryPeer DisplayString,
lcsStatusWanIpAddressesIpv4EntryType INTEGER,
lcsStatusWanIpAddressesIpv4EntryIpAddress IpAddress,
lcsStatusWanIpAddressesIpv4EntryIpNetmask IpAddress,
lcsStatusWanIpAddressesIpv4EntryGateway IpAddress,
lcsStatusWanIpAddressesIpv4EntryDnsDefault IpAddress,
lcsStatusWanIpAddressesIpv4EntryDnsBackup IpAddress,
lcsStatusWanIpAddressesIpv4EntryNbnsDefault IpAddress,
lcsStatusWanIpAddressesIpv4EntryNbnsBackup IpAddress,
lcsStatusWanIpAddressesIpv4EntryDomain DisplayString
}

-- {COLUMN} 1.3.6.1.4.1.2356.11.1.4.13.1.1.1
lcsStatusWanIpAddressesIpv4EntryPeer OBJECT-TYPE
SYNTAX DisplayString (SIZE(0..16))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"-- empty --"
::= { lcsStatusWanIpAddressesIpv4Entry 1 }

-- {COLUMN} 1.3.6.1.4.1.2356.11.1.4.13.1.1.2
lcsStatusWanIpAddressesIpv4EntryType OBJECT-TYPE
SYNTAX INTEGER {
eStatic (1),
eDhcp (2),
ePpp (3),
eAutoconfig (4)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"-- empty --"
::= { lcsStatusWanIpAddressesIpv4Entry 2 }

-- {COLUMN} 1.3.6.1.4.1.2356.11.1.4.13.1.1.3
lcsStatusWanIpAddressesIpv4EntryIpAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"-- empty --"
::= { lcsStatusWanIpAddressesIpv4Entry 3 }

-- {COLUMN} 1.3.6.1.4.1.2356.11.1.4.13.1.1.4
lcsStatusWanIpAddressesIpv4EntryIpNetmask OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"-- empty --"
::= { lcsStatusWanIpAddressesIpv4Entry 4 }

-- {COLUMN} 1.3.6.1.4.1.2356.11.1.4.13.1.1.5
lcsStatusWanIpAddressesIpv4EntryGateway OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"-- empty --"
::= { lcsStatusWanIpAddressesIpv4Entry 5 }
-----------------------------------------------------------------------------------------------------------------------------------------------
Part of my Logfile:

Code: Select all

[1517695043] HOST ALERT: GM-PS;DOWN;SOFT;1;CRITICAL - Network Unreachable (192.168.172.1)
[1517739798] Warning: A system time change of 44732 seconds (0d 12h 25m 32s forwards in time) has been detected. Compensating...
[1517739839] HOST ALERT: GM-PS;UP;SOFT;2;PING OK - Packet loss = 0%, RTA = 1.21 ms
[1517739842] SERVICE NOTIFICATION: nagiosadmin;GM-PS;HostName;CRITICAL;notify-service-by-email;CRITICAL - Plugin timed out while executing system call
[1517739842] wproc: NOTIFY job 0 from worker Core Worker 650 is a non-check helper but exited with return code 127
[1517739842] wproc: host=GM-PS; service=HostName; contact=nagiosadmin
[1517739842] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[1517739842] wproc: stderr line 01: /bin/sh: 1: /bin/mail: not found
[1517739842] wproc: stderr line 02: /usr/bin/printf: write error: Broken pipe
[1517739898] SERVICE NOTIFICATION: nagiosadmin;GM-PS;Name;CRITICAL;notify-service-by-email;CRITICAL - Plugin timed out while executing system call
[1517739898] wproc: NOTIFY job 1 from worker Core Worker 651 is a non-check helper but exited with return code 127
[1517739898] wproc: host=GM-PS; service=Name; contact=nagiosadmin
[1517739898] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[1517739898] wproc: stderr line 01: /bin/sh: 1: /bin/mail: not found
[1517739898] wproc: stderr line 02: /usr/bin/printf: write error: Broken pipe
[1517739999] SERVICE NOTIFICATION: nagiosadmin;GM-PS;Port 1 Bandwidth Usage;UNKNOWN;notify-service-by-email;check_mrtgtraf: Unable to open MRTG log file
[1517739999] wproc: NOTIFY job 2 from worker Core Worker 650 is a non-check helper but exited with return code 127
[1517739999] wproc: host=GM-PS; service=Port 1 Bandwidth Usage; contact=nagiosadmin
[1517739999] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[1517739999] wproc: stderr line 01: /bin/sh: 1: /bin/mail: not found
[1517739999] wproc: stderr line 02: /usr/bin/printf: write error: Broken pipe
[1517740122] SERVICE NOTIFICATION: nagiosadmin;GM-PS;Uptime;CRITICAL;notify-service-by-email;CRITICAL - Plugin timed out while executing system call
[1517740122] wproc: NOTIFY job 3 from worker Core Worker 651 is a non-check helper but exited with return code 127
[1517740122] wproc: host=GM-PS; service=Uptime; contact=nagiosadmin
[1517740122] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[1517740122] wproc: stderr line 01: /bin/sh: 1: /bin/mail: not found
[1517740122] wproc: stderr line 02: /usr/bin/printf: write error: Broken pipe
[1517740178] SERVICE NOTIFICATION: nagiosadmin;GM-PS;WAN IP;CRITICAL;notify-service-by-email;CRITICAL - Plugin timed out while executing system call
[1517740178] wproc: NOTIFY job 4 from worker Core Worker 654 is a non-check helper but exited with return code 127
[1517740178] wproc: host=GM-PS; service=WAN IP; contact=nagiosadmin
[1517740178] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[1517740178] wproc: stderr line 01: /bin/sh: 1: /bin/mail: not found
[1517740178] wproc: stderr line 02: /usr/bin/printf: write error: Broken pipe
Looking forward for help :)
Last edited by dwhitfield on Mon Feb 05, 2018 11:24 am, edited 1 time in total.
Reason: code blocks FTW
kyang

Re: Problem with Check_Snmp

Post by kyang »

You mentioned that the snmpwalk ran just fine. Could you post the output from that walk?

Code: Select all

snmpwalk 192.168.172.1 -c public -v2c -On
After performing the snmpwalk, use one of those OID's from that walk and use it with against check_snmp

My example.

Code: Select all

./check_snmp -H 192.168.4.125 -C StrOngCOmmunity -o .1.3.6.1.2.1.25.6.3.1.2.223 -m all
SNMP OK - "php-pdo-5.3.3-49.el6" |
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

I have copied a Part of the SNMPwalk

here:
iso.3.6.1.2.1.1.1.0 = STRING: "LANCOM 1781AW 10.12.0084 / 19.10.2017 4002851518100372"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.2356.11.8.607
iso.3.6.1.2.1.1.3.0 = Timeticks: (32504991) 3 days, 18:17:29.91
iso.3.6.1.2.1.1.4.0 = ""
iso.3.6.1.2.1.1.5.0 = STRING: "GM-PS"
iso.3.6.1.2.1.1.6.0 = ""
iso.3.6.1.2.1.1.7.0 = INTEGER: 14
iso.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:You mentioned that the snmpwalk ran just fine. Could you post the output from that walk?

Code: Select all

snmpwalk 192.168.172.1 -c public -v2c -On
After performing the snmpwalk, use one of those OID's from that walk and use it with against check_snmp

My example.

Code: Select all

./check_snmp -H 192.168.4.125 -C StrOngCOmmunity -o .1.3.6.1.2.1.25.6.3.1.2.223 -m all
SNMP OK - "php-pdo-5.3.3-49.el6" |

When I run:

./check_snmp -H 192.168.172.1 -C public -o .3.6.1.2.1.1.1.0 -m all

Or ./check_snmp -H 192.168.172.1 -C public -o Iso.3.6.1.2.1.1.1.0 -m all

I get this message from the console : bash: ./check_snmp: No such file or directory
kyang

Re: Problem with Check_Snmp

Post by kyang »

Are you in the right directory to run the check_snmp plugin?

What is the output of this?

Code: Select all

find / -name check_snmp

Also, could you send your nagios.cfg file?

Code: Select all

find / -name nagios.cfg
I'm not sure where it's at in Raspbian, but maybe /usr/local/nagios/etc/nagios.cfg.
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:Are you in the right directory to run the check_snmp plugin?

What is the output of this?

Code: Select all

find / -name check_snmp

Also, could you send your nagios.cfg file?

Code: Select all

find / -name nagios.cfg
I'm not sure where it's at in Raspbian, but maybe /usr/local/nagios/etc/nagios.cfg.

I did cd /usr/local/nagios/libexec
and then /check_snmp -H 192.168.172.1 -C public -o .3.6.1.2.1.1.1.0 -m all

I get an Timeout
kyang

Re: Problem with Check_Snmp

Post by kyang »

Please run your snmpwalk for us and post the output.

Code: Select all

snmpwalk 192.168.172.1 -c public -v2c -On
Also, could you run your command like this and show us the output.

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .3.6.1.2.1.1.1.0 -v
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:Please run your snmpwalk for us and post the output.

Code: Select all

snmpwalk 192.168.172.1 -c public -v2c -On
Also, could you run your command like this and show us the output.

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .3.6.1.2.1.1.1.0 -v

Output of the SNMPWalk (To much Characters I can send it via DM):

.1.3.6.1.2.1.1.1.0 = STRING: "LANCOM 1781AW 10.12.0084 / 19.10.2017 4002851518100372"
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.2356.11.8.607
.1.3.6.1.2.1.1.3.0 = Timeticks: (35274635) 4 days, 1:59:06.35
.1.3.6.1.2.1.1.4.0 = ""
.1.3.6.1.2.1.1.5.0 = STRING: "GM-PS"
.1.3.6.1.2.1.1.6.0 = ""
.1.3.6.1.2.1.1.7.0 = INTEGER: 14
.1.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
.1.3.6.1.2.1.1.9.1.2.1 = OID: .1.3.6.1.2.1.67
.1.3.6.1.2.1.1.9.1.2.2 = OID: .1.2.840.10036
.1.3.6.1.2.1.1.9.1.2.3 = OID: .1.3.6.1.2.1.17
.1.3.6.1.2.1.1.9.1.2.4 = OID: .1.0.8802.1.1.2
.1.3.6.1.2.1.1.9.1.2.5 = OID: .1.3.6.1.2.1.2
.1.3.6.1.2.1.1.9.1.2.6 = OID: .1.3.6.1.2.1.3
.1.3.6.1.2.1.1.9.1.2.7 = OID: .1.3.6.1.2.1.4
.1.3.6.1.2.1.1.9.1.2.8 = OID: .1.3.6.1.2.1.5
.1.3.6.1.2.1.1.9.1.2.9 = OID: .1.3.6.1.2.1.6
.1.3.6.1.2.1.1.9.1.2.10 = OID: .1.3.6.1.2.1.10.132
.1.3.6.1.2.1.1.9.1.2.11 = OID: .1.3.6.1.2.1.10.20
.1.3.6.1.2.1.1.9.1.2.12 = OID: .1.3.6.1.2.1.10.7
.1.3.6.1.2.1.1.9.1.2.13 = OID: .1.3.6.1.2.1.7
.1.3.6.1.2.1.1.9.1.2.14 = OID: .1.3.6.1.2.1.25
.1.3.6.1.2.1.1.9.1.2.15 = OID: .1.3.6.1.2.1.26
.1.3.6.1.2.1.67.2.1.1.1.12.0 = Counter32: 0
.1.3.6.1.2.1.67.2.1.1.1.13.0 = Counter32: 0
.1.3.6.1.2.1.67.2.2.1.1.1.0 = Counter32: 0
.1.3.6.1.2.1.67.2.2.1.1.2.0 = STRING: "GM-PS"

Output of the command /usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .3.6.1.2.1.1.1.0 -v

=
/usr/bin/snmpget -Le -t 10 -r 5 -m '' -v 1 [context] [authpriv] 192.168.172.1:161 .3.6.1.2.1.1.1.0
External command error: snmp_build: unknown failure
snmpget: Error building ASN.1 representation (Can't build OID for variable)
kyang

Re: Problem with Check_Snmp

Post by kyang »

Please run this command exactly like this with this OID.

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .1.3.6.1.2.1.1.1.0 
Post the output. thanks!
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:Please run this command exactly like this with this OID.

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .1.3.6.1.2.1.1.1.0 
Post the output. thanks!

Its works !

SNMP OK - "LANCOM 1781AW 10.12.0084 / 19.10.2017 4002851518100372" |


How I change the switch.cfg file now ?
Locked