From: Dinko Korunic Date: Sat, 13 Oct 2007 17:04:10 +0000 (+0000) Subject: r9: - dodao aosi X-Git-Tag: v4.10.1-3~28 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=monit-cn.git;a=commitdiff_plain;h=007a5f05615fb2be7823645ec159c980da1a89fc r9: - dodao aosi - modificirao *ftp servise da pricaju ftp - popravio ssh template (nedostajuci =) - update-monit.d sad provjerava i init skripte - monitrc -> 900 sec izmedju checkova - freeradius prica 1812 udp - update README --- diff --git a/README.CARNet b/README.CARNet index f6117ab..a62b17e 100644 --- a/README.CARNet +++ b/README.CARNet @@ -16,11 +16,11 @@ odgovarajuci servis koji ispravno radi. Za sljedece servise dolaze gotovi predlosci: - amavisd cron mysqld samba tomcat5 - apache1 dhcpd3 ntpd sendmail vsftpd - apache2 dovecot openldap sophie - bind8 exim postfix sshd - bind9 freeradius proftpd syslogd - clamd monitrc qpopper thttpd + amavisd.conf clamd.conf monitrc qpopper.conf thttpd.conf + aosi.conf cron.conf mysqld.conf samba.conf tomcat5.conf + apache1.conf dhcpd3.conf ntpd.conf sendmail.conf vsftpd.conf + apache2.conf dovecot.conf openldap.conf sophie.conf + bind8.conf exim.conf postfix.conf sshd.conf + bind9.conf freeradius.conf proftpd.conf syslogd.conf -- Dinko Korunic at Mon, 24 Sep 2007 18:51:14 +0200 diff --git a/debian/rules b/debian/rules index 5c69e32..ab981fb 100755 --- a/debian/rules +++ b/debian/rules @@ -42,7 +42,7 @@ binary-indep: build install dh_testroot dh_installchangelogs dh_installdocs - dh_install + dh_install -X.svn # dh_installexamples # dh_installmenu # dh_installdebconf diff --git a/monit-cn/aosi.conf b/monit-cn/aosi.conf new file mode 100644 index 0000000..b0e1553 --- /dev/null +++ b/monit-cn/aosi.conf @@ -0,0 +1,7 @@ +# aosi monit-cn template + +check aosi with pidfile "/var/run/aosi/aosi.pid" + start program = "/etc/init.d/aosi start" + stop program = "/etc/init.d/aosi stop" + if failed host 127.0.0.1 port 1443 type tcp + then restart diff --git a/monit-cn/freeradius.conf b/monit-cn/freeradius.conf index 4fc3ac1..a3ba685 100644 --- a/monit-cn/freeradius.conf +++ b/monit-cn/freeradius.conf @@ -2,4 +2,6 @@ check freeradius with pidfile "/var/run/freeradius/freeradius.pid" start program = "/etc/init.d/freeradius start" - stop program = "/etc/init.d/freeradius stop" + stop program = "/etc/init.d/freeradius stop" + if failed host 127.0.0.1 port 1812 type udp + then restart diff --git a/monit-cn/monitrc b/monit-cn/monitrc index a49a0c9..d626e79 100644 --- a/monit-cn/monitrc +++ b/monit-cn/monitrc @@ -1,6 +1,6 @@ # monit-cn template -set daemon 300 +set daemon 900 set logfile syslog facility log_daemon set mail-format { diff --git a/monit-cn/proftpd.conf b/monit-cn/proftpd.conf index d71f454..467ab2d 100644 --- a/monit-cn/proftpd.conf +++ b/monit-cn/proftpd.conf @@ -2,4 +2,6 @@ check process proftpd with pidfile "/var/run/proftpd.pid" start program = "/etc/init.d/proftpd start" - stop program = "/etc/init.d/proftpd stop" + stop program = "/etc/init.d/proftpd stop" + if failed host 127.0.0.1 port 21 protocol ftp + then restart diff --git a/monit-cn/sshd.conf b/monit-cn/sshd.conf index 8ce1fe4..9bbd5e2 100644 --- a/monit-cn/sshd.conf +++ b/monit-cn/sshd.conf @@ -1,8 +1,8 @@ # sshd monit-cn template check process sshd with pidfile "/var/run/sshd.pid" - start program "/etc/init.d/ssh start" - stop program "/etc/init.d/ssh stop" + start program = "/etc/init.d/ssh start" + stop program = "/etc/init.d/ssh stop" if failed host 127.0.0.1 port 22 protocol ssh with timeout 15 seconds then restart diff --git a/monit-cn/vsftpd.conf b/monit-cn/vsftpd.conf index 6e89be2..3bcae87 100644 --- a/monit-cn/vsftpd.conf +++ b/monit-cn/vsftpd.conf @@ -2,4 +2,6 @@ check process vsftpd with pidfile "/var/run/vsftpd/vsftpd.pid" start program = "/etc/init.d/vsftpd start" - stop program = "/etc/init.d/vsftpd stop" + stop program = "/etc/init.d/vsftpd stop" + if failed host 127.0.0.1 port 21 protocol ftp + then restart diff --git a/update-monit.d b/update-monit.d index 4ed19e1..05472e9 100755 --- a/update-monit.d +++ b/update-monit.d @@ -1,4 +1,11 @@ #!/bin/sh +# +# Copyright (C) 2007 Dinko Korunic, CARNet, Grupa za izradu paketa +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. MONIT_DIR=/etc/monit.d TEMPLATES_DIR=/usr/share/monit-cn @@ -12,13 +19,26 @@ check_service() { return 1 fi - script='BEGIN { RS = "[ \t\n]+" } + scriptpid='BEGIN { RS = "[ \t\n]+" } { line[NR] = $0 "" } END { for (j in line) if (line[j] == "pidfile") print line[j + 1] }' - pidfiles=$(awk "$script" < "$filename" | sed -e 's/"//g') + pidfiles=$(awk "$scriptpid" < "$filename" | sed -e 's/"//g') check_pidfile $pidfiles + + if [ $RET -eq 1 ]; then + return 1 + fi + + scriptinit='BEGIN { RS = "[ \t\n]+" } + { line[NR] = $0 "" } + END { for (j in line) + if (((line[j] == "start") || (line[j] == "stop")) && (line[j + 1] == "program")) + print line[j + 3] }' + initscripts=$(awk "$scriptinit" < "$filename" | sed -e 's/"//g') + check_initscript $initscripts + return $RET } @@ -41,6 +61,20 @@ check_pidfile() { return 0 } +check_initscript() { + RET=0 + + while [ -n "$1" ]; do + if [ ! -x "$1" ]; then + RET=1 + return 1 + fi + shift + done + + return 0 +} + check_pid() { RET=0