OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 21-Aug-2004 20:04:55 Branch: HEAD Handle: 2004082119045400 Modified files: openpkg-src/monit monit.spec monitrc rc.monit Log: cleanup packaging Summary: Revision Changes Path 1.39 +12 -4 openpkg-src/monit/monit.spec 1.6 +65 -19 openpkg-src/monit/monitrc 1.16 +3 -3 openpkg-src/monit/rc.monit ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/monit/monit.spec ============================================================================ $ cvs diff -u -r1.38 -r1.39 monit.spec --- openpkg-src/monit/monit.spec 21 Aug 2004 08:47:23 -0000 1.38 +++ openpkg-src/monit/monit.spec 21 Aug 2004 18:04:54 -0000 1.39 @@ -76,6 +76,7 @@ } %prep + # unpack and patch distribution %setup -q %patch -p0 %{l_shtool} subst %{l_value -s -a} \ @@ -85,6 +86,7 @@ configure %build + # configure program cppflags="" libs="" case "%{l_platform -t}" in @@ -114,25 +116,31 @@ --without-ssl \ %endif $flags + + # build program %{l_make} %{l_mflags -O} %install + # install program rm -rf $RPM_BUILD_ROOT %{l_make} %{l_mflags} install \ DESTDIR="$RPM_BUILD_ROOT" \ INSTALL="%{l_shtool} install -c" + # install run-command script %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.monit} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ - %{l_shtool} mkdir -f -p -m 700 \ + # install default configuration + %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/monit %{l_shtool} install -c -m 600 %{l_value -s -a} \ %{SOURCE monitrc} $RPM_BUILD_ROOT%{l_prefix}/etc/monit/ - %{l_shtool} mkdir -f -p -m 700 \ + # create empty run-time directory + %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/var/monit # install OSSP fsl configuration @@ -141,12 +149,12 @@ %{SOURCE fsl.monit} \ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%not %dir %{l_prefix}/etc/fsl' \ '%config %{l_prefix}/etc/fsl/fsl.monit' \ - '%config %attr(0600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/monit/*' \ - '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/monit' + '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/monit/*' %files -f files @@ . patch -p0 <<'@@ .' Index: openpkg-src/monit/monitrc ============================================================================ $ cvs diff -u -r1.5 -r1.6 monitrc --- openpkg-src/monit/monitrc 20 Aug 2004 20:02:17 -0000 1.5 +++ openpkg-src/monit/monitrc 21 Aug 2004 18:04:54 -0000 1.6 @@ -2,35 +2,81 @@ ## @l_prefix@/etc/monit/monitrc - monit control file ## -# for examples, see http://www.tildeslash.com/monit/examples.html +## +## OPTIONS +## -# run as daemon with polling intervals of n seconds +# daemon polling interval set daemon 120 -# web interface +# daemon logging target +set logfile syslog + +# daemon remote control #set httpd -# port 99 +# port 99 # address 127.0.0.1 # allow 127.0.0.1 -#ssl disable +# ssl disable -# send alerts via following mail server -set mailserver 127.0.0.1 -set mail-format { from: [EMAIL PROTECTED] } - -# log via syslog (OSSP fsl) by default -set logfile syslog +# how to send out alert mails +set alert [EMAIL PROTECTED] +set mailserver 127.0.0.1 +set mail-format { + from: [EMAIL PROTECTED] + subject: Monit: $HOST: $SERVICE $EVENT ($ACTION) + message: +Date: $DATE +Host: $HOST +Service: $SERVICE +Event: $EVENT +Action: $ACTION +} + +## +## CHECKS +## # disk usage on root file system #check device fs-root with path / # if space usage > 90% then alert -# alert [EMAIL PROTECTED] -# MySQL -#check process mysql with pidfile @l_prefix@/var/mysql/mysqld.pid -# start program = "@l_prefix@/etc/rc mysql start" -# stop program = "@l_prefix@/etc/rc mysql stop" -# if failed host 127.0.0.1 port 3306 type TCP then restart -# if 5 restarts within 5 cycles then timeout -# alert [EMAIL PROTECTED] +# check for OpenSSH +#check process openssh +# with pidfile "@l_prefix@/var/openssh/openssh.pid" +# start program = "@l_prefix@/etc/rc openssh start" +# stop program = "@l_prefix@/etc/rc openssh stop" +# if failed host 127.0.0.1 port 22 protocol ssh then restart +# if 2 restarts within 3 cycles then timeout +# group server +# depends on sshd_config +#check file sshd_config +# with path @l_prefix@/etc/openssh/sshd_config +# if changed sha1 checksum then exec "@l_prefix@/etc/rc openssh stop start" + +# check for NTP +#check process ntpd +# with pidfile "@l_prefix@/var/ntp/ntpd.pid" +# start program = "@l_prefix@/etc/rc ntp start" +# stop program = "@l_prefix@/etc/rc ntp stop" +# if failed host 127.0.0.1 port 123 type udp then restart +# if 2 restarts within 3 cycles then timeout +# group server +# depends on ntp.conf +#check file ntp.conf +# with path @l_prefix@/etc/ntp/ntp.conf +# if changed sha1 checksum then exec "@l_prefix@/etc/rc ntp stop start" + +# check for Postfix +#check process postfix +# with pidfile "@l_prefix@/var/postfix/pid/master.pid" +# start program = "@l_prefix@/etc/rc postfix start" +# stop program = "@l_prefix@/etc/rc postfix stop" +# if failed host 127.0.0.1 port 25 protocol smtp then restart +# if 2 restarts within 3 cycles then timeout +# group server +# depends on main.cf +#check file main.cf +# with path @l_prefix@/etc/postfix/main.cf +# if changed sha1 checksum then exec "@l_prefix@/etc/rc postfix reload" @@ . patch -p0 <<'@@ .' Index: openpkg-src/monit/rc.monit ============================================================================ $ cvs diff -u -r1.15 -r1.16 rc.monit --- openpkg-src/monit/rc.monit 5 Feb 2004 08:46:46 -0000 1.15 +++ openpkg-src/monit/rc.monit 21 Aug 2004 18:04:54 -0000 1.16 @@ -28,11 +28,11 @@ echo "monit_usable=\"$monit_usable\"" echo "monit_active=\"$monit_active\"" -%start -u @l_susr@ +%start -p 900 -u @l_susr@ rcService monit enable yes || exit 0 @l_prefix@/bin/monit >/dev/null -%stop -u @l_susr@ +%stop -p 900 -u @l_susr@ rcService monit enable yes || exit 0 @l_prefix@/bin/monit quit @@ -49,7 +49,7 @@ rcService monit enable yes || exit 0 shtool rotate -f \ -n ${monit_log_numfiles} -s ${monit_log_minsize} -d \ - -z ${monit_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ + -z ${monit_log_complevel} -o @l_musr@ -g @l_mgrp@ -m 600 \ -P "${monit_log_prolog}" \ -E "${monit_log_epilog} && rc monit reload" \ @l_prefix@/var/monit/monit.log @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]