Page 1 of 2
Nagios interface 2
Posted: Wed Sep 12, 2018 4:46 am
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
Re: Nagios interface 2
Posted: Wed Sep 12, 2018 12:07 pm
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
Then post the results of both
thanks
Re: Nagios interface 2
Posted: Thu Sep 13, 2018 1:14 am
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
Re: Nagios interface 2
Posted: Thu Sep 13, 2018 8:40 am
by scottwilkerson
Actually, I wanted you to run the check that nagios is running for this service, not an snmpwalk
Re: Nagios interface 2
Posted: Tue Sep 25, 2018 7:48 am
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
Re: Nagios interface 2
Posted: Tue Sep 25, 2018 7:50 am
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 $?
Re: Nagios interface 2
Posted: Wed Sep 26, 2018 1:24 am
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
Re: Nagios interface 2
Posted: Wed Sep 26, 2018 7:44 am
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?
Re: Nagios interface 2
Posted: Thu Sep 27, 2018 1:19 am
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
}
Re: Nagios interface 2
Posted: Thu Sep 27, 2018 10:05 am
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
}