Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a strange problem: Icinga (nagios) doesn't run check_nt which I've set up on a debian box.

What I do is that I schedule a forced check of both NSClient_version and PING. If I look in the log file, I can see that both commands are scheduled to run:

[1372774536] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sqlnota03.dbb.dk;NSClient_version;1372781738
[1372774536] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;sqlnota03.dbb.dk;PING;1372781738

After having switched on debugging, I get this:

[1372774536.502948] [016.2] [pid=3840] Found another service check event for service 'NSClient_version' on host 'sqlnota03.dbb.dk' @ Tue Jul  2 17:47:21 2013
[1372774536.502973] [016.2] [pid=3840] Keeping original service check event (ignoring the new one).

I've gone over the configuration many times and couldn't find any errors and Icinga reports that the configuration is ok when running icinga -v <icinga.cfg>.

Is there anyone who can spot what I am doing wrong?

The configuration is:

define host {
    use        windows-server
    host_name  <the host>
    address    192.168.1.61
    hostgroups mssql, termsrv, windows, nsclient_version
}

define service {
    use generic-service
    hostgroup_name nsclient_version
    service_description NSClient_version
    servicegroups nsclient_version
    check_command check_nt!CLIENTVERSION
}

# 'check_nt' command definition
define command {
    command_name    check_nt
    command_line    check_nt command_line /usr/lib/nagios/plugins/check_nt -p12489 -s <snip> -H '$HOSTADDRESS$' -v '$ARG1$' '$ARG2' '$ARG3'
}

It seems that there is a service check stuck somewhere in the system that keeps Icinga from running a new one?!?

I've replaced the check_nt command that should be run with a small script that just touches a local file in /tmp to see if it is being run at all. This isn't the case.

Edit

I used the old nagios web interface to schedule a new check and (finally) got this:

Processing: 'SERVICE ALERT: sqlnota03.db

b.dk;NSClient_version;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;The com mand defined for service NSClient_version does not exist

Now I'm unsure what the message means - that the executable check_nt can't be found or something else...?

share|improve this question
1  
Did you try turning on debugging in the NSClient to see if it sheds any light? –  uSlackr Jul 2 '13 at 14:59
1  
No need to. The command is never executed. I also tried to fire up Wireshark and verified this - there is no communication at all. Running check_nt by hand works. –  Michael Zedeler Jul 2 '13 at 15:04
    
Thanks for the help. –  Michael Zedeler Jul 2 '13 at 15:41

1 Answer 1

I found the error.

It was a combination of two things:

  • Icinga-web didn't schedule the checks properly. For some reason it just ignored the check command (I'll look into that later).
  • Once I got a check scheduled, it was clear that the path to command_line parameter was wrong.

So I changed this:

command_line    check_nt command_line /usr/lib/nagios/plugins/check_nt -p12489 -s <snip> -H '$HOSTADDRESS$' -v '$ARG1$' '$ARG2' '$ARG3'

To this:

command_line /usr/lib/nagios/plugins/check_nt -p12489 -s <snip> -H '$HOSTADDRESS$' -v '$ARG1$' '$ARG2' '$ARG3'

I am surprised how much time it took to make Icinga run an actual check so I could diagnose the error.

share|improve this answer
1  
Checking if commands are executed is targetted in various wiki articles. Also how to manually run those checks. wiki.icinga.org/display/testing/Icinga+Plugin+Testing –  dnsmichi Jul 3 '13 at 11:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.