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 <kreator@carnet.hr> at  Mon, 24 Sep 2007 18:51:14 +0200
 
        dh_testroot
        dh_installchangelogs
        dh_installdocs
-       dh_install
+       dh_install -X.svn
 #      dh_installexamples
 #      dh_installmenu
 #      dh_installdebconf
 
--- /dev/null
+# 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
 
 
 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
 
 # monit-cn template
 
-set daemon 300
+set daemon 900
 set logfile syslog facility log_daemon
 
 set mail-format {
 
 
 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
 
 # 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
 
 
 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
 
 #!/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
         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
 }
 
     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