SOURCES: icmpmonitor.conf (NEW), icmpmonitor.init (NEW), icmpmonit...

areq areq at pld-linux.org
Sun Jun 17 15:31:31 CEST 2007


Author: areq                         Date: Sun Jun 17 13:31:31 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- init files for icmpmonitor

---- Files affected:
SOURCES:
   icmpmonitor.conf (NONE -> 1.1)  (NEW), icmpmonitor.init (NONE -> 1.1)  (NEW), icmpmonitor.sysconfig (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/icmpmonitor.conf
diff -u /dev/null SOURCES/icmpmonitor.conf:1.1
--- /dev/null	Sun Jun 17 15:31:31 2007
+++ SOURCES/icmpmonitor.conf	Sun Jun 17 15:31:26 2007
@@ -0,0 +1,16 @@
+# $Id$
+#
+#Name,  ping_interval, max_delay, upcmd, downcmd, startup condition
+
+# Monitor these hosts when they go down
+#r90                1  5  "echo r90  up| mail lord" "echo r90  down| mail lord"
+#noir.crocodile.org 60 10 "echo noir up| mail lord" "echo noir down| mail lord"
+#crocodile.org      60 10 "echo home up| mail lord" "echo home down| mail lord"
+#lizard             1  5  "echo lizard  up| mail lord" "echo lizard  down| mail lord"
+
+# Monitor this host when it is started
+#windoze		   60 10 "echo warning windoze is running| mail lord" "echo internet clean again| mail lord" down
+
+# If and only if the fast gateway goes down switch to another, slower one.
+# Assume no valid configuration on startup.
+#gate.ether         1  5  "ifup -s ether" "ifup -s phone" none

================================================================
Index: SOURCES/icmpmonitor.init
diff -u /dev/null SOURCES/icmpmonitor.init:1.1
--- /dev/null	Sun Jun 17 15:31:31 2007
+++ SOURCES/icmpmonitor.init	Sun Jun 17 15:31:26 2007
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# icmpmonitor	Check is some hosts are alive
+#
+# chkconfig:	345 11 89
+#
+# description:	icmpmonitor multiple host monitoring tool
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+[ -f /etc/sysconfig/icmpmonitor ] && . /etc/sysconfig/icmpmonitor
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down icmpmonitor
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/icmpmonitor ]; then
+		msg_starting icmpmonitor
+		daemon icmpmonitor $ICMPMONITOR_OPTS
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/icmpmonitor
+	else
+		msg_already_running icmpmonitor
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/icmpmonitor ]; then
+		# Stop daemons.
+		msg_stopping icmpmonitor
+		killproc icmpmonitor
+		rm -f /var/lock/subsys/icmpmonitor
+	else
+		msg_not_running icmpmonitor
+	fi
+}
+
+reload() {
+	if [ -f /var/lock/subsys/icmpmonitor ]; then
+		msg_reloading icmpmonitor
+		killproc icmpmonitor -HUP
+		RETVAL=$?
+	else
+		msg_not_running icmpmonitor
+		RETVAL=7
+	fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  reload)
+  	reload
+	;;
+  force-reload)
+	reload
+	;;
+  status)
+	status icmpmonitor
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL

================================================================
Index: SOURCES/icmpmonitor.sysconfig
diff -u /dev/null SOURCES/icmpmonitor.sysconfig:1.1
--- /dev/null	Sun Jun 17 15:31:31 2007
+++ SOURCES/icmpmonitor.sysconfig	Sun Jun 17 15:31:26 2007
@@ -0,0 +1,6 @@
+# Config file for icmpmonitor startup
+
+ICMPMONITOR_OPTS="-f icmpmonitor.conf -d"
+
+# This must be last line !
+# vi:syntax=sh
================================================================


More information about the pld-cvs-commit mailing list