How do we have Nagios XI, automatically start resending email alerts if no action has been taken on a problem that has been acknowledged?
Specific example.
A warning or Critical alert is acknowledged and the system stops sending email alerts. But the state of that problem hasn't changed in over a week. Because they may have forgotten about the problem, we would want Nagios to start sending the alert emails again.
We had an acknowledged warning that went untouched for 24 days, we believe they forgot about it. So we'd like the acknowledgement to age and at a certain point, reset, as if it was never acknowledged.
I'm going through the administrator guide, but my boss has given me a real short turn around on this one.
Thanks
Send Email Alerts X # of Days After It's Been Acknowledged
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Send Email Alerts X # of Days After It's Been Acknowledg
Thats not possible out of the box, once it's acknowledged thats it there will be no more notifications.
You could create a cron job that daily checked all the acknowledged items and then unacknowledged them.
In XI 5.x you can use the backend API. Documentation for it is in Help > Nagios XI API Docs
Here's how you can execute a curl command to get that data:
This will output JSON.
You could then parse the data and look at this field:
"last_hard_state_change": "2015-10-19 08:34:01",
And then calculate how many days that has been.
Then you can remove the acknowledgement with this command:
Some useful commands:
https://old.nagios.org/developerinfo/ex ... and_id=117
https://old.nagios.org/developerinfo/ex ... ndlist.php
https://github.com/NagiosEnterprises/na ... cmd_list.c
You could create a cron job that daily checked all the acknowledged items and then unacknowledged them.
In XI 5.x you can use the backend API. Documentation for it is in Help > Nagios XI API Docs
Here's how you can execute a curl command to get that data:
Code: Select all
curl -k -XGET "http://xitest/nagiosxi/api/v1/objects/servicestatus?apikey=5goacg8s&problem_acknowledged=1&pretty=1"You could then parse the data and look at this field:
"last_hard_state_change": "2015-10-19 08:34:01",
And then calculate how many days that has been.
Then you can remove the acknowledgement with this command:
Code: Select all
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] REMOVE_SVC_ACKNOWLEDGEMENT;host1;service1\n" $now > $commandfilehttps://old.nagios.org/developerinfo/ex ... and_id=117
https://old.nagios.org/developerinfo/ex ... ndlist.php
https://github.com/NagiosEnterprises/na ... cmd_list.c
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Re: Send Email Alerts X # of Days After It's Been Acknowledg
Thanks,
I'll pass that info on. Appreciate the details.
I'll pass that info on. Appreciate the details.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Send Email Alerts X # of Days After It's Been Acknowledg
No worries 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.