Nagios define service for nrpe command in Windows environment

configurationnagiosnrpensclient++

I'm trying to configure Nagios to monitor our network which is all Windows based. I'm totally new to it, so please forgive my naiveness. Fact is: I'm banging my head over a task.

What I want to achieve is having Nagios tell me whether a remote service/process is running or not.
I have NSClilent++ installed and working on a client machine. In fact, if I execute the following code from command line in the Nagios server it works:

check_nrpe -H [ip_of_NSClient++] -c check_service -a 'service=[service_name]' "critical=state = 'stopped'"

My question is: how can I define aservice in the [host].cfg file to invoke the command above?

Right now I have this defined in my commands.cfg file:

   define command {
   $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG1$
    }

Which works to invoke simple services like [check_cpu] or [check_disk] but no more than that.

All the attempts I've done so far always led to(I think) erratic error messages, like:

  • (No output on stdout) stderr: Could not resolve hostname $: Name or service not known.
    or
  • CHECK_NRPE: Invalid packet type received from server.

Best Answer

There's a specific check buit in nrpe client for Windows service

It is:

check_command        check_windows_service!"<display name of the service>"

You have to enter the display name of the service as it appears in windows service manager.