Socket timeout check_nt


#1

Greetings!
I have tried to add a check_nt service to nagios to check the cpu load.
The NSClient is running on the machine and I can get a result when running the command in a terminal window.
When I try to make it work in nagios i get a Critical stating:“Socket timeout …”.
Does anyone know what might be the problem?

Regrards,

/rogzon
:shock:


#2

What does your service definition look like?

I have a service that checks disk space. It looks like this:
define service{
use generic-service
host_name someserver1,someserver2
service_description DISK-C
is_volatile 0
check_period workhours
max_check_attempts 3
normal_check_interval 10
retry_check_interval 30
contact_groups win-admins
notification_interval 240
notification_period workhours
notification_options c,r
check_command check_nt_disk!C!70!90
}

and my checkcommands.cfg file contains this:
define command{
command_name check_nt_disk
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$
}

What does yours look like?

Another thing to check is run:
/usr/sbin/nagios -v /etc/nagios/nagios.cfg
and see if that gives you errors/warnings.


#3

Hi!
My services.cfg looks somewhat like yours, the difference is the notification_options and the use-generic-sevice and when it comes to the checkcommands.cfg it is exactly like yours.
Starting nagios with -v gives no errors and no warnings.

Question: Does your check_nt work?
I tried running the check_nt command from the command line and it worked fine!!

Regards

/rogzon


#4

put -t 30 on the end of the check command (or less if you think it’s too much) THe check_nt checks sometimes take a little while to perform and nagios get’s bored waiting.


#5

Yes, my check_nt works for useddiskspace and fileage. I actually went back to an older version of check_nt because the fileage switch was returning seconds from 1970 rather than %Year/%Month/%Day.

The old check_nt and the new check_nt both successfully got a result though. I see no reason why yours will not work.

Have you tried any other checks like diskspace or memusage? Can you get any check_nt option to work?
Edited Thu Mar 10 2005, 05:20PM ]


#6

The problem is solved!
The check_nt plugin doesn’t work exactly as the other ones!
The $HOSTNAME$ variable isn’t resolved to a proper ip-adress using the information in hosts.cfg.
Instead it uses the /etc/hosts file or DNS to resolve the ip-adress.
Putting the correct ebtry into /etc/hosts solved my problem!

Thanks!

/rogzon


#7

Oh brother, that was a great find rogzon. Makes you wonder if some of this stuff was ever really tested.