Page 10 of 10

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 2:15 pm
by skypete
where would this be located again is that service command right?

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 2:23 pm
by skypete
define service {
host_name Testserver1
service_description Print Spooler
check_command check_nrpe!check_process!process=spoolsv.exe!show-all
max_check_attempts 1
event_handler restart-service
check_interval 3
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
_SERVICE Spooler
}

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 2:49 pm
by scottwilkerson
no it's a command you defined with a name restart-service

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 3:23 pm
by skypete
This where i copied it too


################################################################################
# NOTE: The following 'check_...' commands are used to monitor services on
# both local and remote hosts.
################################################################################




# 'restart-service' command definition
define command {
command_name restart-service
command_line $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$T$
}

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 3:45 pm
by npolovenko
@skypete, Looks like you haven't replaced the "restart-service" command definition(see my post on the page#6).

From:

Code: Select all

define command {
    command_name     restart-service
    command_line    $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$T$
}
To:

Code: Select all

define command {
    command_name     restart-service
    command_line    $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$
}
Please replace the command and then restart the nagios service with:

Code: Select all

service nagios restart
Let us know if the event handler starts working.

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 3:46 pm
by scottwilkerson
You have a typo there...

lets replace this

Code: Select all

command_line $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$T$
with this

Code: Select all

command_line $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$
then restart the nagios service

Code: Select all

service nagios restart
Then it should work

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 4:45 pm
by skypete
Im sorry still not working.

Re: Using NRPE for windows server

Posted: Fri Mar 02, 2018 5:16 pm
by scottwilkerson
skypete wrote:Im sorry still not working.
Please copy and paste the command out of your config again..

Please verify you restarted nagios.

Please describe how you tested that it is working (e.g. how long you waited until after you stopped the service)