Nagios interface 2

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.
Phill123
Posts: 9
Joined: Wed Sep 12, 2018 4:42 am

Nagios interface 2

Post by Phill123 »

Hello Guys

I have nagios core and configured for two switches, one switch when interface down it is show as critical and highlight with red and that's fine, but another device when interface down it is show snmp ok (2) with green highlight although both devices use same configuration check_snmp with oid;
My question is why second device when interface down not show as critical and highlight with red just show snmp ok (2)

Thx
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios interface 2

Post by scottwilkerson »

can you run each of the commands from the command line that nagios is running and then run the following immediately following it

Code: Select all

echo $?
Then post the results of both

thanks
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Phill123
Posts: 9
Joined: Wed Sep 12, 2018 4:42 am

Re: Nagios interface 2

Post by Phill123 »

Here are the result for second device which just show green with snmp ok 2, but actually it is down
# snmpwalk -v 2c -c TEST 192.168.99.7 1.3.6.1.2.1.2.2.1.8.28
IF-MIB::ifOperStatus.28 = INTEGER: down(2)
# echo $?
0
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios interface 2

Post by scottwilkerson »

Actually, I wanted you to run the check that nagios is running for this service, not an snmpwalk
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Phill123
Posts: 9
Joined: Wed Sep 12, 2018 4:42 am

Re: Nagios interface 2

Post by Phill123 »

This is the command i used to check interface status
check_snmp!-C TEST -o 1.3.6.1.2.1.2.2.1.8.28, so I run this command manually using below step:

#./check_snmp -C TEST -o .1.3.6.1.2.1.2.2.1.8.28 -H 192.168.99.7
SNMP OK - 2 | iso.3.6.1.2.1.2.2.1.8.28=2
# echo
nothing outcome from echo
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios interface 2

Post by scottwilkerson »

The echo need to be followed by $?, this gives us the exit code of the command

Please run

Code: Select all

./check_snmp -C TEST -o .1.3.6.1.2.1.2.2.1.8.28 -H 192.168.99.7 
echo $?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Phill123
Posts: 9
Joined: Wed Sep 12, 2018 4:42 am

Re: Nagios interface 2

Post by Phill123 »

Here are the results;

# ./check_snmp -C TEST -o .1.3.6.1.2.1.2.2.1.8.28 -H 192.168.99.7
SNMP OK - 2 | iso.3.6.1.2.1.2.2.1.8.28=2
# echo $?
0
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios interface 2

Post by scottwilkerson »

Phill123 wrote:Here are the results;

# ./check_snmp -C TEST -o .1.3.6.1.2.1.2.2.1.8.28 -H 192.168.99.7
SNMP OK - 2 | iso.3.6.1.2.1.2.2.1.8.28=2
# echo $?
0
And this is the OID and host that is being checked that is showing CRITICAL (red)?

Can you share your configuration for this service as well as the command definition it is executing?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Phill123
Posts: 9
Joined: Wed Sep 12, 2018 4:42 am

Re: Nagios interface 2

Post by Phill123 »

it suppose to show red, but actually it show green for that not send notification and status information "SNMP OK - 2"
i use this command "check_snmp" that come built-in with nagios, but I don't know why some interfaces does not work correctly;

Code: Select all

define service{
       use                              generic-service
       host_name                   GRS-BB01
       service_description       Ports G
       check_command           check_snmp!-C TEST -o .1.3.6.1.2.1.2.2.1.8.28
       }
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios interface 2

Post by scottwilkerson »

Well you are not passing any warning or critical values to the plugin

Code: Select all

 -w, --warning=THRESHOLD(s)
    Warning threshold range(s)
 -c, --critical=THRESHOLD(s)
    Critical threshold range(s)
The below will be critical if the returned value is over 1
define service{
use generic-service
host_name GRS-BB01
service_description Ports G
check_command check_snmp!-C TEST -o .1.3.6.1.2.1.2.2.1.8.28 -w 1 -c 1
}
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked