[Top][All Lists]

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

Re: monitor remote service,and mail queue

From: Martin Pala
Subject: Re: monitor remote service,and mail queue
Date: Fri, 09 Jul 2004 22:28:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040704 Debian/1.7-4

Vlada Macek wrote:
Related question, lets' say I want to notifed if the mail queue goes above
a certain number of messages, indicating some delay on an internal mail
server or similar. What is the best way to monitor this via monit?

This need is the same that I have. In my recent long proposing e-mail
entitled "Some feature notes for monit", I was describing an "external
procedures", feature of an arbitrary program whose output is examined in
the ways usual in monit.

This feature does not exist in monit yet, but the proposal is
optimistically accepted, so maybe someday...

Until then I'll check the mail queue and other server health status
currently unsupported by monit by the shell script that will produce
exactly the same output when all is okay. This script will be run
periodically from cron and write the status (for `mailq | wc' command
say the string "The mail queue is below 10 pieces") to the file say

Monit will monitor this file's checksum and timestamp (it must not be
older than e.g. one and a half the cron period) and alerts in case of

This way you could test anything you want with just little risk of
inaccurance. Your script could of course alert you itself (but, hey, the
mail queue is now full, the alerts may not reach you, funny; the use of
another SMTP server may be needed:). But I prefer the single
communication channel and one look to m/monit (or whatever) dashboard to
see if all servers are generally healthy.

Just a hint. :-)



To unsubscribe:

This is correct way :) My friend is monitoring metadevices on solaris with the same trick:

1.) start testing script from crontab every 30 minutes:

30 * * * * /root/ > /dev/null 2>&1

2.) testing script:

address@hidden # cat /root/
/usr/sbin/metastat -s dg01 | /usr/xpg4/bin/grep -q maintenance
if [ $? -ne 0 ]; then
  touch /metaset_test.ckp

3.) monitrc:

check file metaset_test.ckp with path /metaset_test.ckp
  if timestamp > 70 minutes then alert
  alert address@hidden
  alert address@hidden


reply via email to

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