Nagios snmp_check problem


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring Nagios snmp_check problem
# 1  
Old 03-30-2013
Nagios snmp_check problem

Hi,

I am configuring nagios for snmp monitoring and I havent go further after getting a timeout error from the monitoring console from Nagios.
As far as I can see everything is well configured. But this is my first nagios implementation and I am not sure as I am learning on the way.
I am making snmpgets from the command line which are succesfull but Nagios system gets a timeout. Any idea what is the problem. Any tip hardly appreciated.

details from behavior and configuration below.

Thanks!
--------------------------------------------------------------------------------------------------
Linux nagios01 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Packet nagios3

Package nagios3:
i 3.2.3-3ubuntu1

----------------------------------------------------------------------------------------------
Error from web interface

nagios02


CPU Load

UNKNOWN 2013-03-29 16:18:43 0d 21h 28m 14s 4/4 External command error: Timeout: No Response from 192.168.1.250:161.

CPU Stats

UNKNOWN 2013-03-29 16:14:58 0d 22h 21m 36s 4/4 External command error: Timeout: No Response from 192.168.1.250:161.

-----------------------------------------------------------------------------
Test from CLI


sudo /usr/lib/nagios/plugins/check_snmp -H 192.168.1.250 -C pedropicapiedra -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%'

SNMP OK - CPU usage (user system idle) 0 % 0 99 | CPU usage (user system idle)=0 iso.3.6.1.4.1.2021.11.10.0=0 iso.3.6.1.4.1.2021.11.11.0=99



sudo /usr/lib/nagios/plugins/check_snmp -H 192.168.1.250 -C pedropicapiedra -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :70,:70,:70 -c :90,:90,:90 -l load

SNMP OK - load 0 1 5 | load=0 iso.3.6.1.4.1.2021.10.1.5.2=1 iso.3.6.1.4.1.2021.10.1.5.3=5

-----------------------------------------------------------------------------

Service Definition

define service{
use generic-service
name CPU-stats
check_command snmp_cpustats!supersecreto
service_description CPU Stats
host_name nagios02
notification_interval 0
notification_options c,r
notification_period 24x7
register 0
}

define service{
use generic-service
name CPU Load
check_command snmp_load!supersecreto!70!90
service_description CPU Load
host_name nagios02
notification_interval 0
notification_options c,r
notification_period 24x7
register 0
}


Host Definition

define host{

use generic-host

host_name nagios02

alias unix nagios 02

address 192.168.1.250
}


command definition

nagios01:/etc/nagios-plugins/config$ pwd
/etc/nagios-plugins/config

snmp.cfg

#define service{
# use generic-service ; Name of service template to use
# host_name nagios02
# service_description CPU load
# check_command snmp_load -H $HOSTADDRESS$ -C supersecreto -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w 70 -c 90 -l load
# }



#define service{
# use generic-service ; Name of service template to use
# host_name nagios02
# service_description CPU usage
# check_command snmp_cpustats -H '$HOSTADDRESS$' -C supersecreto -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%'
# }


nagios.cfg

# Debian also defaults to using the check commands defined by the debian
# nagios-plugins package
cfg_dir=/etc/nagios-plugins/config

All configuration files are located in the right directories and defined in the nagios.cfg

------------------------------------------------------------------------------------------------

[1364570324.120066] [016.0] [pid=6041] Attempting to run scheduled check of service 'CPU Load' on host 'nagios02': check options=0, latency=0.120000
[1364570324.120183] [016.0] [pid=6041] Checking service 'CPU Load' on host 'nagios02'...
[1364570324.120253] [2320.2] [pid=6041] Raw Command Input: /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :'$ARG2$',:'$ARG3$',:'$ARG4$' -c :'$ARG5$',:'$ARG6$',:'$ARG7$' -l load
[1364570324.120274] [2320.2] [pid=6041] Expanded Command Output: /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :'$ARG2$',:'$ARG3$',:'$ARG4$' -c :'$ARG5$',:'$ARG6$',:'$ARG7$' -l load
[1364570324.120482] [016.1] [pid=6041] Check result output will be written to '/var/lib/nagios3/spool/checkresults/checktCrCxt' (fd=6)
ss (pid=6134)
[1364570327.129385] [016.0] [pid=6041] Starting to reap check results.
[1364570327.129523] [016.1] [pid=6041] Starting to read check result queue '/var/lib/nagios3/spool/checkresults'...
[1364570327.129581] [016.0] [pid=6041] Finished reaping 0 check results
[1364570330.177343] [016.2] [pid=6135] Moving temp check result file '/var/lib/nagios3/spool/checkresults/checktCrCxt' to queue file '/var/lib/nagios3/spool/checkresults/ckXBAPo'...
[1364570337.138898] [016.0] [pid=6041] Starting to reap check results.
[1364570337.138976] [016.1] [pid=6041] Starting to read check result queue '/var/lib/nagios3/spool/checkresults'...
[1364570337.139037] [016.1] [pid=6041] Processing check result file: '/var/lib/nagios3/spool/checkresults/ckXBAPo'
[1364570337.139315] [016.2] [pid=6041] Found a check result (#1) to handle...
[1364570337.139336] [016.1] [pid=6041] Handling check result for service 'CPU Load' on host 'nagios02'...
[1364570337.139353] [016.0] [pid=6041] ** Handling check result for service 'CPU Load' on host 'nagios02'...
[1364570337.139369] [016.1] [pid=6041] HOST: nagios02, SERVICE: CPU Load, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 3, OUTPUT: External command error: Timeout: No Response from 192.168.1.250:161.\n
[1364570337.139404] [016.2] [pid=6041] Parsing check output...
eout: No Response from 192.168.1.250:161.
[1364570337.139436] [016.2] [pid=6041] Long Output: NULL
[1364570337.139452] [016.2] [pid=6041] Perf Data: NULL
: 3
[1364570337.139485] [016.1] [pid=6041] Service is in a non-OK state!
s state to make sure...
[1364570337.139516] [016.1] [pid=6041] * Using last known host state: 0
[1364570337.139532] [016.1] [pid=6041] Current/Max Attempt(s): 4/4
# 2  
Old 04-11-2013
SOLVED Nagios snmp_check problem

SOLVED

First problem was the service definition were I added a register 0 definition. This is only used for macros.

Service Definition

define service{
use generic-service
name CPU-stats
check_command snmp_cpustats!supersecreto
service_description CPU Stats
host_name nagios02
notification_interval 0
notification_options c,r
notification_period 24x7
}

define service{
use generic-service
name CPU Load
check_command snmp_load!supersecreto!70!90
service_description CPU Load
host_name nagios02
notification_interval 0
notification_options c,r
notification_period 24x7
}

And the second problem was that the in the command definition the -C community parameter is not been taken by the check_snmp command giving a time out

# 'snmp_load' command definition
define command{
command_name snmp_load
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C
'$ARG1$' -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1. 5.2,.1.3.6.1.4.1.
2021.10.1.5.3 -w :'$ARG2$',:'$ARG3$',:'$ARG4$' -c :'$ARG5$',:'$ARG6$',:'$ARG7$'
-l load
}


# 'snmp_cpustats' command definition
define command{
command_name snmp_cpustats
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C
'$ARG1$' -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0 ,.1.3.6.1.4.1.202
1.11.11.0 -l 'CPU usage (user system idle)' -u '%'
}

After change this and harcode the community everything worked!!!

# 'snmp_load' command definition
define command{
command_name snmp_load
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C
supersecreto -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1. 5.2,.1.3.6.1.
4.1.2021.10.1.5.3 -w :'$ARG1$',:'$ARG2$',:'$ARG3$' -c :'$ARG4$',:'$ARG5$',:'$ARG
6$' -l load
}


# 'snmp_cpustats' command definition
define command{
command_name snmp_cpustats
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C
supersecreto -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0 ,.1.3.6.1.4.1
.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%'
}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

Nagios check dependent on second nagios server

We have a dual Nagios server setup. One is setup for internal server monitoring on our LAN, while the second Nagios server is hosted externally and is used for external checks only such as URL and ping checks form the WAN side. I was wondering if there is any way to setup cross dependencies... (1 Reply)
Discussion started by: eugenes18t
1 Replies

2. Infrastructure Monitoring

How secure using Nagios?

Hello Experts, I have my windows servers located at different data-centers across US and I am monitoring all of them using Nagios server configured on a CentOS. All communications are done via public IP address and I doubt it can invite some security threats too. Can anyone let me know if it is... (3 Replies)
Discussion started by: naw_deepak
3 Replies

3. Red Hat

Nagios Problem

Hi Everybody, I have configure nagios server and client on my lab machines which are running under VMWARE. Now i would like to know how the nagios working in my systems. For that, what i did is i filled up the / partition with some data above 95% in client. But still it is report good... (0 Replies)
Discussion started by: mastansaheb
0 Replies

4. Infrastructure Monitoring

Nagios Error

Im new to monitoring so i was testing few monitoring tools and I've had this problem with nagios, i downloaded the Nagios XI VM and im using virtualbox to run it and when i reach the GRUB i get this Error 16 : inconsistent file system structure, i have tried troubleshooting the problem but i... (1 Reply)
Discussion started by: HashB
1 Replies

5. Red Hat

Nagios Problem

Hello, I installed Nagios on the Centreon Platform <----"Centralized monitoring platform" anyways now every time i click on any of the tabs inside centreon interface, it gives me a Blank page, i have no idea what to do. i thought of resetting nagios to an earlier time when it was running... (2 Replies)
Discussion started by: waelkd
2 Replies

6. Infrastructure Monitoring

Nagios Auditing

Hi Folks, I have Nagios 3.0.6 which is monitoring 400+ servers in my environment and is administered by multiple administrators. I want to get notified if somebody enable or disable any notification of any of the hosts/services from GUI. Is it possible to configure? If so, how? (0 Replies)
Discussion started by: SiddhV
0 Replies

7. Solaris

nagios-plugins-1.4.15 Install Problem on Solaris 10

I am trying to install nagios-plugins-1.4.15 on a Solaris 10 box and when I run the ./configure script I get this error: checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in... (2 Replies)
Discussion started by: thatwaseasy
2 Replies

8. Infrastructure Monitoring

Nagios Problem with secondary_address

I'm running the latest version of Nagios (3.2.3). i discovered that the "secondary_address" object directive is no longer supported. does anyone know what it was replaced with? i cant find anything on it. i have a lot ofservers with secondary addresses and they kind of depend on this. how... (0 Replies)
Discussion started by: SkySmart
0 Replies

9. Solaris

Nagios problem

Dear Members, i make setup for nagios under linux Ubuntu Server 9.04 box i when i try to install NRPE on Unix Box i found this error 1- first step for installation -bash-3.00# pwd /download/nrpe-2.12 -bash-3.00# ./configure -with-ssl=/usr/sfw/ -with-ssl-lib=/usr/sfw/lib/ ***... (1 Reply)
Discussion started by: sharkux
1 Replies

10. Solaris

Nagios - How to install !

Hi , I want a clear a detailed manual or installation guide pls for Nagios . I tried many time to use the original manual but the commands is related to linux i think ,, I am using Solaris 9 Regards Adel (2 Replies)
Discussion started by: ArabOracle.com
2 Replies
Login or Register to Ask a Question