Anyone know of a plug-in that will parse incoming mail and log/alert via Nagios XI?
Thanks!
-Jeff
Parsing Incoming Mail
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Parsing Incoming Mail
There are lots of plugins for checking the status of the mail server, size of the queue, etc., but I don't know of any that parse the actual mail itself. What is it you're trying to do with it, and with what sort of mail server & mailbox setup?
Re: Parsing Incoming Mail
I want to be able to have an email come directly to the Nagios server to be parsed. Currently the email goes to an Exchange mail box. If there is a way to parse the Exchange mailbox, that would work as well.
Thanks!
Thanks!
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Parsing Incoming Mail
Parsed for what? Are you looking for a particular string in an individual message, size of the user's mailbox, etc. Are you trying to just check the contents of a message, or take some action based on it?
Re: Parsing Incoming Mail
A particular string in an individual message or messages.
Re: Parsing Incoming Mail
Hi Tony,
I am looking for exactly what you have listed there. We are trying to use Nagios to parse and e-mail and depending on the content of the e-mail flag it as important or not. All of the messages will have a standard output depending on the severity level except for the customer name changing. Will nagios support this functionality ?
Thanks
Andrew
I am looking for exactly what you have listed there. We are trying to use Nagios to parse and e-mail and depending on the content of the e-mail flag it as important or not. All of the messages will have a standard output depending on the severity level except for the customer name changing. Will nagios support this functionality ?
Thanks
Andrew
Re: Parsing Incoming Mail
Get Nagios to do this is simply a matter of either finding or creating a check plugin that will do this. I'd recommend looking around on the exchange.nagios.org website and see if you can find something that will do this. You could also look at some log monitoring plugins, because those essentially search for a string in a file. OR, depending on your comfort level with scripting, all you'd have to do is write a simple script that reads the file, looking for the string, and returns an exit code (0-3) and a simple message depending on what it found. Once you have that all you have to do is add it as a check command and set it up as a service.
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Parsing Incoming Mail
I haven't found any pre-built ones for doing this with Exchange, and dealing with something sent directly to the Nagios server would depend on mailbox format chosen, etc. So, I'll offer this general guidance and hopefully that gets you pointed in the right direction. You would need to write a "check plugin" to do the actual parsing based on what you know about the format you expect, in the language of your choice, and then tell Nagios to use it. You can find general information about how plugins work on http://nagios.sourceforge.net/docs/3_0/pluginapi.html, and detailed plugin "best practices" on http://nagiosplug.sourceforge.net/devel ... lines.html.