Using NRPE for windows server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
skypete
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Post by skypete »

where would this be located again is that service command right?
skypete
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Post 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
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE for windows server

Post by scottwilkerson »

no it's a command you defined with a name restart-service
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
skypete
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Post 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$
}
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE for windows server

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
skypete
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Post by skypete »

Im sorry still not working.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE for windows server

Post 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)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked