monit-general
[Top][All Lists]
Advanced

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

Re: Global set alert does not work with included files


From: Martin Pala
Subject: Re: Global set alert does not work with included files
Date: Fri, 12 Aug 2005 22:43:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050802 Debian/1.7.10-1

Hello,

i looked on it but i don't understand what is your problem. The examples don't contain mentioned 'address@hidden', thus i'm not sure what was your intent.

When you set global alert, monit will use it for any corresponding event for any service.

Your statement:

 set alert address@hidden

should cause monit to deliver any event type alert for any service to 'address@hidden' address. Because the outgoing 'from:' was not specified, monit will use 'address@hidden' as outgoing address.

Alert statement definition which is local (i.e. defined directly in particular service check) has precedence over global, in the case that the recipient match. Because you used such a configuration, the line in:

 check process Mysql ...
   ...
   alert address@hidden
     with mail-format { from: address@hidden }

will override the global alert for the same recipient - the only difference is the outgoing address.

Maybe your qmail doesn't allow the outgoing address of the form 'address@hidden' where $HOST is result of gethostname() call or just 'localhost'?

Martin


Francois FOURRIER wrote:
Hello everyone,

thanks for this cool monit program !

I have some hard time making a global email alert to work.

My /etc/monitrc file lools like :
###########################
set daemon     120
set logfile    syslog
set mailserver 127.0.0.1
set alert address@hidden

set httpd port 2812
        ssl     enable
        pemfile "/etc/monit/mycert.pem"
        allowselfcertification
        allow admin:xxxxxx

include /etc/monit/cron
include /etc/monit/syslog-ng
...

An so on....
###########################

The trouble is that when an event occurs my qmail-send log output this :
starting delivery 597: msg 4237878 to remote address@hidden

Which obviously means that monit did not use the default email adress...

The only solution i've found is to include the alert opion inside each file
like this :

/etc/monit/mysqld
###########################

check process Mysql with pidfile /var/run/mysqld/mysqld.pid
    start program = "/etc/init.d/mysql start"
    stop  program = "/etc/init.d/mysql stop"
    group database
    if failed unix "/tmp/mysql.sock" then restart
    alert address@hidden with mail-format { from: address@hidden
}
    if 5 restarts within 5 cycles then timeout
    depends mysqld_init
    depends mysqld_bin
    depends mysqldsafe_bin

check file mysqld_init with path /etc/init.d/mysql
    group database

check file mysqld_bin with path /usr/local/mysql/bin/mysqld
    group database

check file mysqldsafe_bin with path /usr/local/mysql/bin/mysqld_safe
    group database
###########################

Then it works... But I have to manually insert this option in each included
file wich is not cool at all...

I can't find what is wrong here...

Do you have any hints ?

Thanks

--
François FOURRIER
-----------------
Solutions Online/Offline - Hébergement & Infogérance


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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