Hi
Im trying to create an event handler to affect a hostgroup service.
I want the eventhandler to affect only the host that has a service affected and I am not sure I am doing this correctly.
What I have configured:
define service {
use generic-service,service-pnp
hostgroup_name ourgroup
service_description CHECK ASERVICE SERVICE
check_command check_nrpe!check_aservice_server
max_check_attempts 3
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts theadmin
event_handler_enabled 1
#event_handler restart-aservice
}
define command {
command_name restart-aservice
command_line $USER1$/eventhandlers/restart-aservice $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTNAME$
}
Please is this correct?
How to add $HOSTNAME$ to hostgroup service eventhandler
-
- Posts: 14
- Joined: Wed Apr 16, 2014 3:06 am
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to add $HOSTNAME$ to hostgroup service eventhandler
That looks correct to me, with the exception that the event_handler line is commented outsinaowolabi wrote:Please is this correct?
-
- Posts: 14
- Joined: Wed Apr 16, 2014 3:06 am
Re: How to add $HOSTNAME$ to hostgroup service eventhandler
Thanks a lot!
Sorry the commented line was an oversight.
Sorry the commented line was an oversight.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How to add $HOSTNAME$ to hostgroup service eventhandler
An easy mistake any one of us has made at some point
Is there anything else in relation to this that you need help with or can we lock this thread?
Is there anything else in relation to this that you need help with or can we lock this thread?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.