Parsing Incoming Mail

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jengstro
Posts: 8
Joined: Tue Nov 30, 2010 6:51 pm

Parsing Incoming Mail

Post by jengstro »

Anyone know of a plug-in that will parse incoming mail and log/alert via Nagios XI?

Thanks!
-Jeff
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Parsing Incoming Mail

Post by tonyyarusso »

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?
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
jengstro
Posts: 8
Joined: Tue Nov 30, 2010 6:51 pm

Re: Parsing Incoming Mail

Post by jengstro »

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!
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Parsing Incoming Mail

Post by tonyyarusso »

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?
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
jengstro
Posts: 8
Joined: Tue Nov 30, 2010 6:51 pm

Re: Parsing Incoming Mail

Post by jengstro »

A particular string in an individual message or messages.
compqact
Posts: 2
Joined: Fri Dec 03, 2010 7:41 am

Re: Parsing Incoming Mail

Post by compqact »

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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Parsing Incoming Mail

Post by mguthrie »

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

Post by tonyyarusso »

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.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
Locked