Nice, but you should really try monit. And M/Monit.
Am 19.08.2013, 16:18 Uhr, schrieb Reindl Harald <[email protected]>:
Hi
i recently wrote a PHP Skript which is running in
an endless-loop and try to connect every 10 seconds
to 127.0.0.1 and receive the service-greeting
if the connection fails or there is no response
"killall dbmail-imapd" or "killall dbmail-pop3d"
on systemd-systems with "Restart=always" the "killall"
triggers the restart by systemd while prevent that
a for whatever reason manually stopped daemon get
fired up by a restart and this should catch the cases
from thursday where the processes refused to respond
another script greps the syslog for "time over, scheduling restart"
twice an hour and triggers cronmails to take notice of this but
that does a lot of other things on the infrastructure and so no
way to publish ist
anybody feel free to reuse these two units and the worker
on systemd-installations (yes, i know PHP is not the first
language for services, but the one i use regulary *gg*)
________________________________________________________
[root@mail:~]$ systemctl status monitor-dbmail-imapd.service
monitor-dbmail-imapd.service - monitor dbmail-imapd
Loaded: loaded (/etc/systemd/system/monitor-dbmail-imapd.service;
enabled)
Active: active (running) since Mo 2013-08-19 16:07:16 CEST; 5min ago
Main PID: 5209 (check-dbmail-se)
CGroup: name=systemd:/system/monitor-dbmail-imapd.service
└─5209 /usr/bin/php /usr/local/bin/check-dbmail-service.php
143 dbmail-imapd
[root@mail:~]$ systemctl status monitor-dbmail-pop3d.service
monitor-dbmail-pop3d.service - monitor dbmail-pop3d
Loaded: loaded (/etc/systemd/system/monitor-dbmail-pop3d.service;
enabled)
Active: active (running) since Mo 2013-08-19 16:07:16 CEST; 5min ago
Main PID: 5210 (check-dbmail-se)
CGroup: name=systemd:/system/monitor-dbmail-pop3d.service
└─5210 /usr/bin/php /usr/local/bin/check-dbmail-service.php
110 dbmail-pop3d
--
Harald Leithner
ITronic
Vogelweidplatz 12, 1150 Wien, Austria
Tel: +43-1-786 23 88
Fax: +43-1-98 52 077
Mobil: +43-699-123 78 4 78
Mail: [email protected] | itronic.at
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail