Alright, I've take this one as far as I can take it on my own. I have mail2mon and Postfix receiving the emails, and they're being stored and logged per the config I setup in mail2mon. The part I really need assistance with is the "filter" that needs to be written.
They include a default.fltr and mom.fltr as examples.
I'm doing the easiest form of email testing right now -- simply sending to [email protected] with subject and body of "test" and I want to match that to a host called "Test"
Could someone possibly lend a hand with modifying the filter rules for this? Searching around the web, a few people have given up at this point.
Can Nagios XI accept inbound emails and generate an alert?
Re: Can Nagios XI accept inbound emails and generate an aler
I know I said this before, but the author of that project is probably the best person to ask. We haven't really used it internally for anything, and we don't have any documentation or example code that I am aware of.
We can certainly keep this thread open for community contribution.
We can certainly keep this thread open for community contribution.
Former Nagios employee
Re: Can Nagios XI accept inbound emails and generate an aler
Yeah I haven't been able to reach the author. There some example code in the plugin tarball. I'll put this up for a bounty on oDesk or something.tmcdonald wrote:I know I said this before, but the author of that project is probably the best person to ask. We haven't really used it internally for anything, and we don't have any documentation or example code that I am aware of.
We can certainly keep this thread open for community contribution.
Re: Can Nagios XI accept inbound emails and generate an aler
I think I've figured out what he's trying to do in the code... Using external commands to modify the host/service state:
I'm looking at commands from this doc:
https://assets.nagios.com/downloads/nag ... mmand_file
In the plugin, he's doing something as follows:
I'm going to modify the code a bit to suit our needs. However, I do have a passive-check related question. Say I have this plugin process an email, it goes through the filters etc and we determine through the content of the email that this is going to run the above code and trigger a "CRITICAL" alert (or exit 2). The host state is going to stay in CRITICAL state until another email/alert is processed. Then THAT will be the current state... Since this is not really about reaching the device via network or other means, I'm wondering if there is a way for us to return the device state back to OK after a period/time of X ?
I suppose I could write a "check" for each passive host/service that changes the device state back to OK after 15 minutes or something. Any other suggestions?
I'm looking at commands from this doc:
https://assets.nagios.com/downloads/nag ... mmand_file
In the plugin, he's doing something as follows:
Code: Select all
open(FIFO, ">> $nagios_cmd") or die "Couldn't open $nagios_cmd: $!\n";
# print FIFO "[$epochtime] PROCESS_SERVICE_CHECK_RESULT;$filter_return{host};$filter_return{service_desc};$filter_return{service_state_id};$filter_return{content}\n";
print FIFO "[$epochtime] ";
print FIFO "PROCESS_SERVICE_CHECK_RESULT;";
print FIFO "$filter_return{host};";
print FIFO "$filter_return{service_desc};";
print FIFO "$filter_return{service_state_id};";
print FIFO "$filter_return{content}";
# print FIFO "\n";
close(FIFO);
I suppose I could write a "check" for each passive host/service that changes the device state back to OK after 15 minutes or something. Any other suggestions?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Can Nagios XI accept inbound emails and generate an aler
Enabling freshness checks do just that, after x amount of time run another plugin. check_dummy is often used with SNMP traps to set the state back to ok, for example:
Code: Select all
check_dummy 0 'Waiting for trap'As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Can Nagios XI accept inbound emails and generate an aler
YES! You totally showed me that before, thank you! Think I can make this all work. Going to talk to our programmer and see if he can clean up this code a bit. Will share on the Exchange if/when we get a final product.Box293 wrote:Enabling freshness checks do just that, after x amount of time run another plugin. check_dummy is often used with SNMP traps to set the state back to ok, for example:Code: Select all
check_dummy 0 'Waiting for trap'
Re: Can Nagios XI accept inbound emails and generate an aler
Awesome! We like improvements! 
Let us know if you have any further questions, or have an update for us.
Let us know if you have any further questions, or have an update for us.
Former Nagios Employee