Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Monit sends an alert every time the monit daemon is stopped or started. This is obnoxious and not useful information.

According to the docs, I set:

set alert user@mycompany.com but not on { instance }

...which should send alerts to that e-mail, unless they are in the "instance" category, which is defined as starts/stops.

However, I still get alerts generated. This is super annoying. Clearly I must be missing something.

We're running Monit 5.2.4

share|improve this question
    
Is this covered by this question? –  ewwhite Aug 12 '13 at 21:24
add comment

4 Answers 4

Per http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement, monit generates a number of alerts:

   alert foo@bar on { action
                  checksum
                  connection
                  content
                  data
                  exec
                  fsflags
                  gid
                  icmp
                  invalid
                  nonexist
                  permission
                  pid
                  ppid
                  resource
                  size
                  status
                  timeout
                  timestamp
                  uid
                  uptime }

We were able to fix this on our side by setting (addresses changed to protect the innocent):

SET ALERT important-messages@projectlocker.com ON { invalid, nonexist, timeout, resource, size, timestamp}
SET ALERT less-important-messages@projectlocker.com ON {action, permission, pid, ppid, instance, status}

This successfully routes the messages to the adresses we care about. You can set them globallly or locally, but our alerts are just global.

The subheadings under SERVICE TESTS at: http://mmonit.com/monit/documentation/monit.html correspond fairly neatly to the types above.

For each scheduled process or feature of your server, you should be able to come up with what matters to you in plain English, and match that desire to one of the tests mentioned in SERVICE TESTS. For example, if I'm running Apache, I know that I care about:

  • Is the PID in the PID file still running? (nonexist)
  • Did the PID change without my knowledge? (pid)
  • Is the service responding in a timely fashion to a restart? (timeout)

For a custom daemon that polls, I may care about whether the log file is getting updated with status messages regularly (timestamp).

share|improve this answer
1  
How do you tell what you care about? I wasn't able to find good documentation on what those actions actually mean. For example, "uptime" seems pretty useful, but you don't have it on your list. –  dfrankow Aug 7 '13 at 18:50
    
I'll edit my answer to comment. –  brokenbeatnik Aug 12 '13 at 21:14
add comment

I'm using Monit version 5.2.5 and using the following has stopped monit alerts coming through

set alert example@gmail.com not {instance}

share|improve this answer
add comment
up vote 1 down vote accepted

I was unable to fix this within monit and had to build a layer of processing on the monit e-mail to filter out these monit instance notifications before delivery, by intercepting them.

We're using pager duty to accumulate and dispatch notices from monit and several other systems, so in this case I added a filtering rule on the Monit service using a subject based regex to filter out monit instance notice e-mails.

share|improve this answer
add comment

Simply tell it to knock it off after a certain number of retries in N time period according to these examples.

share|improve this answer
    
This is not the notification of a given watched process or service stopping or starting (which is news) but of the monit daemon itself stopping/starting, which is always intentional and not news. –  Winfield Apr 20 '11 at 13:00
1  
Ooooh, what if you remove the "set alert" line in global, and put explicit alerts in your service stanzas? –  Ben Lutgens Apr 20 '11 at 13:12
    
this works better.. just set the alert emails in the checks.. remove the global one. –  Mike Dec 13 '11 at 23:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.