monit-general
[Top][All Lists]
Advanced

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

Question about check url and mail alert message


From: address@hidden
Subject: Question about check url and mail alert message
Date: Wed, 5 Jan 2011 18:45:19 +0100 (CET)

I have monit 5.2.3 up and running on a Centos 5.5 32 bit. I'm very satisfied 
about it but I have a problem that I'm not able to solve.

Before to make the question, I'll post my monitrc file:

set daemon  60 # Poll at 1-minute interval
#set logfile syslog facility log_daemon # Log according syslog daemon
set logfile /var/log/monit.log # Log in a custom log file
set mailserver localhost # Define the mailser to which relay the email
set mail-format {
     from: address@hidden
     subject: [ $SERVICE ] $EVENT - $DATE
     message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION
     If you have any doubt please contact your sysadmin
     }
set alert address@hidden # Define the recipient of alerts
set httpd port 2812 # Define the listening port
      allow localhost # Define who can access Munin Web Interface
      allow 192.168.1.0/255.255.255.0 # Define who can access Munin Web 
Interface

#     SSL ENABLE
#     PEMFILE  /var/certs/monit.pem
#     allow admin:test

check system server.example.com
    group SystemResources
    if loadavg (1min) > 6 then alert
    if loadavg (5min) > 4 then alert
    if memory usage > 90% for 5 cycles then alert
    if cpu usage (user) > 70% for 5 cycles then alert
    if cpu usage (system) > 30% for 5 cycles then alert
    if cpu usage (wait) > 20% for 5 cycles then alert

check filesystem rootfs with path /
   group Filesystem
   if space usage > 90% for 5 cycles then alert

check filesystem usrfs with path /usr
   group Filesystem
   if space usage > 90% for 5 cycles then alert

check filesystem varfs with path /var
   group Filesystem
   if space usage > 90% for 5 cycles then alert

check process sshd with pidfile /var/run/sshd.pid
   start program  "/etc/init.d/sshd start"
   stop program  "/etc/init.d/sshd stop"
   if failed port 22 protocol ssh then restart
   if 5 restarts within 5 cycles then timeout

check process mysql with pidfile /var/run/mysqld/mysqld.pid
   start program = "/etc/init.d/mysqld start"
   stop program = "/etc/init.d/mysqld stop"
   if failed host 127.0.0.1 port 3306 then restart
   if 5 restarts within 5 cycles then timeout

check process apache with pidfile /var/run/httpd.pid
   start program = "/etc/init.d/httpd start"
   stop program  = "/etc/init.d/httpd stop"
   if failed host example1.com port 443 type tcpSSL protocol HTTP then alert
   if failed url https://example1.com/munin timeout 10 seconds for 1 cycles 
then alert
   if failed url http://example1.com:2812/ timeout 10 seconds for 1 cycles 
then alert
   if cpu is greater than 60% for 3 cycles then alert
   if cpu > 80% for 5 cycles then restart
   if totalmem > 500 MB for 5 cycles then restart
   if children > 250 then restart
   if loadavg(5min) greater than 10 for 8 cycles then stop
   if 3 restarts within 5 cycles then timeout

check host centos55slave with address 192.168.1.4
    group RemoteHostsPing
    if failed icmp type echo count 3 with timeout 3 seconds then alert
    if failed port 22 protocol ssh with timeout 15 seconds then alert


Problem:
if http://example1.com/munin goes down, the Web interface show me the followin 
error:

Port Response Time: connection failed to example1.com:443/munin [HTTP via 
TCPSSL]

This is perfect because I immediately understand that the problem is related 
to (and ONLY to) the url '/munin' but, in the mail alert that I receive, this 
text is not present.

address@hidden example1.com]# mail
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 address@hidden  Wed Jan  5 17:58  18/806   "[ apache ] Connection 
failed - Wed, 05 Jan 2011 17:58:27 +0100"
& 1
Message 1:
>From address@hidden  Wed Jan  5 17:58:27 2011
From: address@hidden
To: address@hidden
Subject: [ apache ] Connection failed - Wed, 05 Jan 2011 17:58:27 +0100
Date: Wed, 05 Jan 2011 17:58:27 +0100
X-Mailer: monit 5.2.3
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Monit alert apache at Wed, 05 Jan 2011 17:58:27 +0100 on centos55: failed 
protocol test [HTTP] at INET[example1.com:443] via TCPSSL
     If you have any doubt please contact your sysadmin


I absolutely need to have in the mail alert body, the same message that I see 
in the Web:
"Port Response Time: connection failed to example1.com:443/munin [HTTP via 
TCPSSL]"

This would help the understanding of the problem without the need to connect 
to the web interface! Also because I'm plan to forward this kind of messages to 
our helpdesk operators but at the moment the message is not clear and I'm 
forced to always check what is happened using Web.

Thanks in advance

Marco



reply via email to

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