hello,

this is my first post. i try to monitor the post 8080 of a server to see if the 
squid-daemon is running and if it isn't i want to restart the daemon.

this is my /etc/mon/mon.cf:

# cfbasedir = /etc/mon
alertdir = /usr/lib/mon/alert.d
mondir = /usr/lib/mon/mon.d
logdir = /var/log/mon
histlength = 100
# authfile = /etc/mon/auth.cf


#
#       downtime logging
#

dtlogging = yes
dtlogfile = dtlog


#
#       define hostgroups
#

hostgroup squidHTTPport 190.190.129.195 


#
#       watch definitions for hostgroups
#

watch squidHTTPport
        service tcp
        interval 10s
        monitor tcp.monitor -p 8080
                period wd {Sun-Sat}
                numalerts 10
                alert squid.alert
                upalert mail.alert
                alertevery 6s
                alertafter 2


and this is the /usr/lib/mon/alert.d/squid.alert-scrpit:

/etc/init.d/squid start


to test the config, I started squid and mon. when both daemons are running i 
stoped the squid-daemon und watched the syslog, it looks like this:

Jul  5 03:29:26 LX01 squid[3360]: FD 38 Closing HTTP connection 
Jul  5 03:29:37 LX01 mon[3400]: failure for squidHTTPport tcp 1152062977 
190.190.129.195 
Jul  5 03:29:47 LX01 mon[3400]: failure for squidHTTPport tcp 1152062987 
190.190.129.195 
Jul  5 03:29:47 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:29:57 LX01 mon[3400]: failure for squidHTTPport tcp 1152062997 
190.190.129.195 
Jul  5 03:29:57 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:29:57 LX01 squid[3360]: Shutting down... 
Jul  5 03:29:57 LX01 squid[3360]: FD 39 Closing ICP connection 
Jul  5 03:29:57 LX01 squid[3360]: Closing unlinkd pipe on FD 36 
Jul  5 03:29:57 LX01 squid[3360]: storeDirWriteCleanLogs: Starting... 
Jul  5 03:29:57 LX01 squid[3360]:   Finished.  Wrote 137 entries. 
Jul  5 03:29:57 LX01 squid[3360]:   Took 0.0 seconds (90488.8 entries/sec). 
Jul  5 03:29:57 LX01 squid[3360]: Squid Cache (Version 2.5.STABLE13): Exiting 
normally. 
Jul  5 03:29:57 LX01 squid[3349]: Squid Parent: child process 3360 exited with 
status 0
Jul  5 03:30:07 LX01 mon[3400]: failure for squidHTTPport tcp 1152063007 
190.190.129.195 
Jul  5 03:30:07 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:30:17 LX01 mon[3400]: failure for squidHTTPport tcp 1152063017 
190.190.129.195 
Jul  5 03:30:17 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:30:27 LX01 mon[3400]: failure for squidHTTPport tcp 1152063027 
190.190.129.195 
Jul  5 03:30:27 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:30:37 LX01 mon[3400]: failure for squidHTTPport tcp 1152063037 
190.190.129.195 
Jul  5 03:30:37 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:30:47 LX01 mon[3400]: failure for squidHTTPport tcp 1152063047 
190.190.129.195 
Jul  5 03:30:47 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:30:57 LX01 mon[3400]: failure for squidHTTPport tcp 1152063057 
190.190.129.195 
Jul  5 03:30:57 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:31:07 LX01 mon[3400]: failure for squidHTTPport tcp 1152063067 
190.190.129.195 
Jul  5 03:31:07 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195 
Jul  5 03:31:17 LX01 mon[3400]: failure for squidHTTPport tcp 1152063077 
190.190.129.195 
Jul  5 03:31:17 LX01 mon[3400]: calling alert squid.alert for squidHTTPport/tcp 
(/usr/lib/mon/alert.d/squid.alert,) 190.190.129.195


mon recognizes at 03:29:37 & 03:29:47 that the port 8080 is closed and calls 
the squid.alert at 03:29:47 but then nothing happens.
I don't now where the misconfiguration is. 

I try to change the squid.alert-script to this:

#!/bin/sh
#
#
/etc/init.d/squid start

the acl for squid.alert is set to 755, this should also be alright.

does anyone has any sugestions?

kind regards

felix
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to