I hacked together (mainly ripped out some stuff and reversed a comparison) a tcp.down.monitor using the tcp.monitor script. I was going to just build it in to the tcp.monitor script with a "-n" cmd line to negate the compare, but gave up after it started to look like it would probably take more than 2 minutes to figure it out...
Below is the diff between tcp.monitor and tcp.down.monitor. Of course, being as how I'm not a perl coder BY ANY STRETCH OF THE DEFINITION (Seriously. Clueless.), I may have inadvertantly mucked something up...so USE AT YOUR OWN RISK...but it seems to work for me: -------clip------- [EMAIL PROTECTED] OLD]# ./tcp.down.monitor -p 666 -t 1 www.google.com [EMAIL PROTECTED] OLD]# echo $? 0 [EMAIL PROTECTED] OLD]# ./tcp.down.monitor -p 80 -t 1 www.google.com www.google.com www.google.com connected on port 80 [EMAIL PROTECTED] OLD]# echo $? 1 -------clip------- Yeah, I'm logged in as root...What of it? :) -------diff------- 81c81 < if ($@) { --- > if (defined $r) { 83,97c83 < < if ($@ eq "alarm\n") { < push @detail, "$host timeout"; < < } else { < push @detail, "$host interrupted syscall: $!"; < } < < close (S); < next; < } < < if (!defined $r) { < push @failures, $host; < push @detail, "$host could not connect: $!"; --- > push @detail, "$host connected on port $PORT"; ------/diff------- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frank Isemann Sent: Monday, November 14, 2005 12:12 PM To: mon@linux.kernel.org Subject: Re: firewall check hi, sure, rewrite the tcp.monitor, or ask the developer if he can add your feature :) greetz eXplasm Daniel K. Gebhart schrieb: >Hi! > > Is it possible to negate rules in mon? I wanna check if our firewalls are > running. Therefor I check if a port on a remote host is filtered or > closed. When I use tcp.monitor, I get notified when the port is closed. > But I want to get notified when it's opened. Any idea? > >lg/br, > daniel k. gebhart > > > _______________________________________________ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon _______________________________________________ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon