[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mon
Subject:    0.99.2 simple fixes
From:       Roderick Schertler <roderick () argon ! org>
Date:       2001-09-14 12:18:34
[Download RAW message or body]

I've updated the Debian package of mon to 0.99.2.  Thanks for including
so much of the patches I'd mailed in, Jim.  I've got just 3 diffs against
the new version.

This is the first of them, it corrects some typos and makes a few trivial
fixes.

diff -ur 0.99.1/doc/mon.8 work/doc/mon.8
--- 0.99.1/doc/mon.8	Sat Aug 18 15:37:53 2001
+++ work/doc/mon.8	Fri Sep  7 10:26:17 2001
@@ -75,7 +75,7 @@
 Read configuration from
 .IR file .
 This defaults to
-IR /etc/mon/mon.cf " if the " /etc/mon
+.IR /etc/mon/mon.cf " if the " /etc/mon
 directory exists, otherwise to
 .IR /etc/mon.cf .
 .TP
@@ -241,7 +241,7 @@
 monitor fping.monitor -t 4000 -r 2
 \fR
 .br
-then the exectuable "fping.monitor" will be executed with these
+then the executable "fping.monitor" will be executed with these
 parameters:
 .br
 \fC
@@ -382,6 +382,7 @@
 parameter, or in the
 .I /usr/local/lib/mon/alert.d
 and
+.I /usr/lib/mon/alert.d
 directories if not specified.  They are invoked with the following command-line
 parameters:
 
@@ -551,8 +552,11 @@
 .B \-s
 command-line parameter.
 
-Multiple alert paths may be specified by separating them with
-a colon. All paths must be absolute.
+Multiple monitor paths may be specified by separating them with
+a colon.  Non-absolute paths are taken to be relative to the
+base directory
+.RI ( /usr/lib/mon
+by default).
 
 When the configuration file is read, all monitors referenced from the
 configuration will be looked up in each of these paths, and the
diff -ur 0.99.1/mon work/mon
--- 0.99.1/mon	Sat Aug 18 15:37:53 2001
+++ work/mon	Fri Sep  7 10:20:26 2001
@@ -1538,10 +1538,13 @@
     # reap children that may be running
     #
     foreach my $pid (keys %runningpid) {
-	my ($group, $service) = split (/\//, $runningpid{$pid});
     	kill 15, $pid;
-	waitpid ($pid, 0);
-	syslog ('info', "reset killed child $pid, exit status $?");
+	# XXX don't wait forever
+	if (waitpid ($pid, 0) == $pid) {
+	    syslog ('info', "reset killed child $pid, exit status $?");
+	} else {
+	    syslog ('notice', "reset couldn't reap child $pid ($!)");
+	}
 	remove_proc ($pid);
     }
 
@@ -1709,7 +1712,7 @@
     socket (TRAPSERVER, PF_INET, SOCK_DGRAM, $udpproto) ||
     	die_die ("err", "could not create UDP socket: $!");
     bind (TRAPSERVER, sockaddr_in ($CF{"TRAPPORT"}, $bindaddr)) ||
-    	die_die ("err", "could not bind UDP server port: $!");
+    	die_die ("err", "could not bind UDP trap port $CF{'TRAPPORT'}: $!");
     configure_filehandle (*TRAPSERVER) ||
     	die_die ("err", "could not configure UDP trap port: $!");
     
@@ -1721,7 +1724,7 @@
     socket (SNMPSERVER, PF_INET, SOCK_DGRAM, $udpproto) ||
     	die_die ("err", "could not create UDP socket: $!");
     bind (SNMPSERVER, sockaddr_in ($CF{"SNMPPORT"}, INADDR_ANY)) ||
-    	die_die ("err", "could not bind UDP server port: $!");
+    	die_die ("err", "could not bind UDP SNMP port $CF{'SNMPPORT'}: $!");
     configure_filehandle (*SNMPSERVER) ||
     	die_die ("err", "could not configure UDP SNMP port: $!");
 }
diff -ur 0.99.1/mon.d/dialin.monitor.wrap.c work/mon.d/dialin.monitor.wrap.c
--- 0.99.1/mon.d/dialin.monitor.wrap.c	Sat Aug 26 15:22:34 2000
+++ work/mon.d/dialin.monitor.wrap.c	Fri Sep  7 09:55:54 2001
@@ -11,6 +11,7 @@
  *
 */
 
+#include <stdio.h>
 #include <unistd.h>
 
 #ifndef REAL_DIALIN_MONITOR
@@ -20,10 +21,11 @@
 int
 main (int argc, char *argv[])
 {
-    char *real_img = REAL_DIALIN_MONITOR;
+    char *me = argv[0];
 
-    argv[0] = real_img;
-
-    /* exec */
-    execv (real_img, argv);
+    argv[0] = REAL_DIALIN_MONITOR;
+    execv (argv[0], argv);
+    fprintf (stderr, "%s: can't exec ", me);
+    perror (argv[0]);
+    return 1;
 }
diff -r -X /home/roderick/.diff-exclude -u base.1/mon.d/file_change.monitor mon/mon.d/file_change.monitor
--- base.1/mon.d/file_change.monitor	Fri Jul 27 11:39:59 2001
+++ mon/mon.d/file_change.monitor	Thu Sep 13 22:20:24 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 #
 # mon monitor to watch for file changes
 #
diff -r -X /home/roderick/.diff-exclude -u base.1/mon.d/up_rtt.monitor mon/mon.d/up_rtt.monitor
--- base.1/mon.d/up_rtt.monitor	Fri Jul 27 11:39:59 2001
+++ mon/mon.d/up_rtt.monitor	Thu Sep 13 22:20:22 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 #
 # mon monitor to check for circuit up and measure RTT
 #

-- 
Roderick Schertler
roderick@argon.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic