logo       

Re: Global set alert does not work with included files: msg#00029

monitoring.monit.general

Subject: Re: Global set alert does not work with included files

Hello,

i looked on it but i don't understand what is your problem. The examples don't contain mentioned 'address@xxxxxxxxx', 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 francois@xxxxxxxxxxxx

should cause monit to deliver any event type alert for any service to 'francois@xxxxxxxxxxxx' address. Because the outgoing 'from:' was not specified, monit will use 'monit@$HOST' 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 francois@xxxxxxxxxxxx
with mail-format { from: alerte@xxxxxxxxxxxx }

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 'monit@$HOST' 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 francois@xxxxxxxxxxxx

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@xxxxxxxxxxxx

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 francois@xxxxxxxxxxxx with mail-format { from: alerte@xxxxxxxxxxxx
}
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


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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise