Page 1 of 1

Reading email body from Nagios

Posted: Thu May 11, 2017 8:28 am
by gravis70
Hi,

I have a scenario to read the email body which has the planned outage sent from OTRS.

Change Request is raised for planned maintenance. This Change Request creates ticket in OTRS.

OTRS triggers an email notification to email-id configured in Nagios with maintenance start and end time.

How to read the email body which has maintenance start and end time from Nagios?

Appreciate your help.

Thanks
Ravi

Re: Reading email body from Nagios

Posted: Thu May 11, 2017 11:17 am
by dwhitfield
You could use check_http to check for the string in OTRS (instead of an email) and then use an event handler to edit these cron jobs https://exchange.nagios.org/directory/A ... on/details

If you don't need/want that check in your Nagios interface, then you could run the whole thing in cron, but have two different crons probably makes sense from a management perspective.

If you really want nagios to read an email, then the email will need to go to an inbox Nagios has access to.

Re: Reading email body from Nagios

Posted: Thu May 11, 2017 12:32 pm
by gravis70
Thanks for your valuable inputs.

I will try your suggestions and get back with the results.

Thanks
Ravi

Re: Reading email body from Nagios

Posted: Thu May 11, 2017 12:43 pm
by dwhitfield
Another suggestion would be to set up some of the Web checks in Nagios XI and use the commands created there in your Core setup. Nagios XI comes with a 60-day trial. If it's easy to spin up a VM, then this is a great option. If you have to jump through hoops to make that happen, then it may not be worth it. You may also find that the setup with XI is easier and just want to move to that. Website, Website Defacement, and Web Transaction would be the three wizards I would look at.

Something like https://exchange.nagios.org/directory/P ... ut/details might give you some ideas for the actual text checking if you decide to go the email route. Despite the similar username, I did not write that plugin.