ispCP - Board - Support
[How-to] Configure MONIT to monitorize your server - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [How-to] Configure MONIT to monitorize your server (/thread-815.html)

Pages: 1 2 3 4


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 12:51 AM

Here some config stuff to monitoring courier authdaemon/popd/imapd

Code:
# courier_authdaemon
check process authdaemon with pidfile /var/run/courier/authdaemon/pid
   group services
   start program = "/etc/init.d/courier-authdaemon start"
   stop  program = "/etc/init.d/courier-authdaemon stop"
   if 5 restarts within 5 cycles then timeout

# courier_imapd
check process imapd with pidfile /var/run/courier/imapd.pid
   group services
   start program = "/etc/init.d/courier-imap start"
   stop  program = "/etc/init.d/courier-imap stop"
   if 5 restarts within 5 cycles then timeout
   if failed port 143 protocol imap then restart

## courier_imapd-ssl
#check process imapd-ssl with pidfile /var/run/courier/imapd-ssl.pid
#   group services
#   start program = "/etc/init.d/courier-imap-ssl start"
#   stop  program = "/etc/init.d/courier-imap-ssl stop"
#   if 5 restarts within 5 cycles then timeout

# courier_pop3d
check process pop3 with pidfile /var/run/courier/pop3d.pid
   group services
   start program = "/etc/init.d/courier-pop start"
   stop  program = "/etc/init.d/courier-pop stop"
   if failed port 110 protocol pop then restart
   if 5 restarts within 5 cycles then timeout

## courier_pop3d-ssl
#check process pop3-ssl with pidfile /var/run/courier/pop3d-ssl.pid
#group services
#start program = "/etc/init.d/courier-pop-ssl start"
#stop program = "/etc/init.d/courier-pop-ssl stop"
#if failed port 995 then restart
#if 5 restarts within 5 cycles then timeout

I have already prepared the ssl mode of imapd and popd because i think ispcp will support it in the future ( or i write some how to Wink )


RE: [How-to] Configure MONIT to monitorize your server - BeNe - 06-27-2007 01:06 AM

Fine!
Quote:I have already prepared the ssl mode of imapd and popd because i think ispcp will support it in the future ( or i write some how to )
There is already one in the Wiki --> http://www.isp-control.net/ispcp/wiki/howto_secure


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 01:09 AM

BeNe Wrote:Fine!
Quote:I have already prepared the ssl mode of imapd and popd because i think ispcp will support it in the future ( or i write some how to )
There is already one in the Wiki --> http://www.isp-control.net/ispcp/wiki/howto_secure

Okay great. I work on config for clamd amavis and so on. i post it later.


RE: [How-to] Configure MONIT to monitorize your server - BeNe - 06-27-2007 01:11 AM

Quote:Okay great. I work on config for clamd amavis and so on. i post it later.

Do you mean a AntiSpam system like Maia ? --> http://www.isp-control.net/ispcp/wiki/maia


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 01:17 AM

BeNe Wrote:
Quote:Okay great. I work on config for clamd amavis and so on. i post it later.

Do you mean a AntiSpam system like Maia ? --> http://www.isp-control.net/ispcp/wiki/maia

yes monitoring of clamv freshclam spamasing monit ....


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 01:31 AM

Some new mixed monitoring stuff

Code:
# amavis
check process amavisd with pidfile /var/run/amavis/amavisd.pid
   group services
   start program = "/etc/init.d/amavis start"
   stop  program = "/etc/init.d/amavis stop"
   if failed port 10024 then restart
   if 5 restarts within 5 cycles then timeout

# clamav-daemon
check process clamd with pidfile o/var/run/clamav/clamd.pid[align=center]
   group services
   start program = "/etc/init.d/clamav-daemon start"
   stop  program = "/etc/init.d/clamav-daemon stop"
   if 5 restarts within 5 cycles then timeout

# clamav-freshclam
check process  freshclam with pidfile /var/run/clamav/freshclam.pid
   group services
   start program = "/etc/init.d/clamav-freshclam start"
   stop  program = "/etc/init.d/clamav-freshclam stop"
   if 5 restarts within 5 cycles then timeout

# cron
check process cron with pidfile /var/run/crond.pid
   group services
   start program = "/etc/init.d/cron start"
   stop  program = "/etc/init.d/cron stop"
   if 5 restarts within 5 cycles then timeout

# munin-node
check process munin-node with pidfile /var/run/munin/munin-node.pid
   group services
   start program = "/etc/init.d/munin-node start"
   stop  program = "/etc/init.d/munin-node stop"
   if 5 restarts within 5 cycles then timeout

# Syslogd
check process syslogd with pidfile /var/run/syslogd.pid
   start program = "/etc/init.d/sysklogd start"
   stop program = "/etc/init.d/sysklogd stop"
   if 5 restarts within 5 cycles then timeout
check file syslogd_file with path /var/log/syslog
   if timestamp > 65 minutes then alert # Have you seen "-- MARK --
or if you use syslog-ng instead of of syslogd
Code:
# syslog-ng
check process syslog-ng with pidfile /var/run/syslog-ng.pid
   group services
   start program = "/etc/init.d/syslog-ng start"
   stop  program = "/etc/init.d/syslog-ng stop"
   if 5 restarts within 5 cycles then timeout

Have fun with it
Can someone of the dev add it into the trac wiki?


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 03:03 AM

And here some two little script which checks if an packages upgrade from apt is avaible or not

/etc/monit/monitrc
Code:
# aptupgrade_check
check file aptupgrade_check path /tmp/aptupgrade_check
   if failed checksum and
   expect the sum 9bef78b12cd45bf489e1fac427dcf3b6
   then alert
/etc/cron.daily/aptupgrade_check
Code:
#! /bin/sh
#
# cron script to check apt for packages upgrades
#
# Written by Mattheus Happe <mhappe@gmail.com>

export LANG=C

/usr/bin/apt-get update && /usr/bin/apt-get upgrade -s > /tmp/aptupgrade_check

/usr/local/sbin/aptupgrade_reset
Code:
#! /bin/sh
#
# script to check apt for packages upgrades
#
# Written by Mattheus Happe <mhappe@gmail.com>

export LANG=C

echo "Reading package lists...
Building dependency tree...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." > /tmp/aptupgrade_check

then type
Code:
chmod +x /etc/cron.daily/aptupgrade_check &&
chmod +x /etc/cron.daily/aptupgrade_check
After upgrade your packages run /usr/local/sbin/aptupgrade_reset

For the future i will try to change the monit message checksumme failed into " apt upgrade available"

I hope someone will use it^^


RE: [How-to] Configure MONIT to monitorize your server - BeNe - 06-27-2007 03:58 AM

Great Stuff - why don´t you post it in the Wiki ?


RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 03:59 AM

BeNe Wrote:Great Stuff - why don´t you post it in the Wiki ?

How i can get an wiki account?


RE: [How-to] Configure MONIT to monitorize your server - BeNe - 06-27-2007 04:02 AM

Everybody can write in the Wiki - you need no Account --> Feel free to edit our manuals.