Page 1 of 1

Is there a way to check if Event Handler kicked in?

Posted: Thu Jan 04, 2018 1:20 pm
by Sampath.Basireddy
Hello There,

I have recently added Event Handler for few service checks to execute a script with set of instructions.

I just want to check if there is any way to find out if the Event Handler kicked in?

Thank You,
Sampath.

Re: Is there a way to check if Event Handler kicked in?

Posted: Thu Jan 04, 2018 1:44 pm
by kyang
Is your event handler a bash script?

If not, either way, you could add a message at the end of your event handler and send that .txt to /tmp on your Nagios Server.

Here's the example from the event handler guide.

Code: Select all

#!/bin/bash
DATE=$(date)
echo "The host has changed state at $DATE" > /tmp/hostinfo.txt
This is showing when the file was updated last.

Code: Select all

 ll /tmp/hostinfo.txt
-rw-r--r-- 1 nagios nagios 31 Jan  4 12:34 /tmp/hostinfo.txt
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

I hope this helps!