[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit alerting

From: Richard T. Robino
Subject: Re: monit alerting
Date: Fri, 22 Apr 2005 22:49:00 -0700

On Apr 21, 2005, at 9:24 AM, Tom O'Brien wrote:

On Apr 19, 2005, at 12:09 PM, SorinS wrote:

>> I was wondering - can monit send alerts to a plain file as opossed to
>> sending an email? In my prod environment email is disabled.
>> Does anybody think this would be a usefull feature?
>Send the mail to pipe alias.  You can do anything you want with the
>mail as input there, especially as you can specify the format of the
>messages in monit.  If standard tools like procmail aren't enough for
>you, see Dan Bernstein's mess822.

Sounds good, but doesn't monit connect directly to the port (25 normally) of the server specified in the monit config file? Even a local delivery to your own server would go through your MTA...which might be down, or not running.

I'm too lazy to verify this, but that sounds correct. Note that the server does not have to be local, nor does it have to use port 25. I'm not sure what else could be done as far as eliminating an MTA altogether, if an email delivery is what you want to rely on then that would be difficult to do any other way. Many of us run server farms and don't want to have any of the pertinent monit info stay on the server. <shrug>

Monit is a very good *software tool*, even for it's relatively broad scope compared to most unix tools. It has a respectable number of output options, so you should be able to figure out something. For example: the ATT Korn shell (not pdksh!) can use sockets directly, via /dev/tcp or /dev/udp. If you don't have that then you could use a tool like netcat (nc). Either of these would make the task of capturing an email on some arbitrary port (preferably high, like 25587) a rather simple matter. You could then parse with an 822mess-based too, formail, etc and have your plain text file. Format a query to your pgsql database on another server, the field of possibilities is very open.

Personally, I think it would be a mistake to bloat monit with something can (and arguably should) be handed off to something else more suited for the job. You could even bypass mail altogether by doing more in the start/stop scripts - another while loop reading a timestamped logfile that you generate whatever level of detail you want in the plain text file. I have one driver script that is portable between SysV and BSD to do all of my starting and stopping of standard services, makes sure that pid-files exist, and a few of the other things I mentioned above. Wasn't hard to do and with monit it really streamlines my overlays for different platforms. This is a _feature_ of the software tools approach. There's more than one way to do it ;-)

Richard T. Robino

reply via email to

[Prev in Thread] Current Thread [Next in Thread]