Nagios interface 2
Nagios interface 2
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios interface 2
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
Code: Select all
echo $?
thanks
Re: Nagios interface 2
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
# 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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios interface 2
Actually, I wanted you to run the check that nagios is running for this service, not an snmpwalk
Re: Nagios interface 2
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios interface 2
The echo need to be followed by $?, this gives us the exit code of the command
Please run
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
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
# ./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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios interface 2
And this is the OID and host that is being checked that is showing CRITICAL (red)?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
Can you share your configuration for this service as well as the command definition it is executing?
Re: Nagios interface 2
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;
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
}
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios interface 2
Well you are not passing any warning or critical values to the plugin
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
}
Code: Select all
-w, --warning=THRESHOLD(s)
Warning threshold range(s)
-c, --critical=THRESHOLD(s)
Critical threshold range(s)
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
}