From owner-freebsd-isp Sat May 2 11:16:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA29252 for freebsd-isp-outgoing; Sat, 2 May 1998 11:16:28 -0700 (PDT) (envelope-from owner-freebsd-isp@FreeBSD.ORG) Received: from bofh.shmooze.net (markjr@bofh.shmOOze.net [205.210.42.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA29247 for ; Sat, 2 May 1998 11:16:26 -0700 (PDT) (envelope-from markjr@bofh.shmooze.net) Received: (from markjr@localhost) by bofh.shmooze.net (8.8.5/8.8.3) id OAA20648 for freebsd-isp@FreeBSD.ORG; Sat, 2 May 1998 14:16:25 -0400 Message-ID: X-Mailer: XFMail 1.3-beta-042198 [p0] on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <98May1.134318edt.6218@netgate.iectech.com> Date: Sat, 02 May 1998 14:16:25 -0400 (EDT) Reply-To: Stunt Pope Organization: Private World Communications From: Stunt Pope To: "freebsd-isp@FreeBSD.org" Subject: RE: Named disappeared (chk script enclosed) Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org There's been at least one other "chk named" script posted here to the list since I memtioned the one I coded for a solaris box. Since then I've gotten numerous requests for the script, so I'm posting it here. Also, a program which checks for the bind "fake inverse query overflow problem" recently came across Bugtraq, which you can find at: http://www.geek-girl.com/bugtraq/1998_2/0057.html (I've tested it on several freeBSD 2.2.2-current boxes and they all report "not vulnerable") here's that script: keep in mind it was coded on solaris 2.5.1, and may need tweaking for other o/s's. Also, it uses syslog, so if your perl is < 5.004_04, you're Syslog.pm is broken. Comment out line 92: #$host = hostname() unless $host; # set $Syslog::host to change -mark #!/bin/perl # # chkdns.pl v1.0 # no-brainer to make sure named is still working # Mark Jeftovic # Oct/15/97 $PS="/bin/ps"; $PID_FILE="/etc/named.pid"; $NAMED="/usr/sbin/in.named"; $CAT="/bin/cat"; $SENDMAIL="/usr/lib/sendmail"; $VERBOSE=0; $USE_SYSLOG=1; if($USE_SYSLOG) { require 5.001; use Sys::Hostname; use Sys::Syslog; } $NOW=localtime(time()); # comma seperate multiple emails $NOTIFY=''; # subject for email $SUBJECT="chkdns"; chomp($PID=`$CAT $PID_FILE`); print "named is: $PID\n" if($VERBOSE); `$PS -p $PID`; if($?!=0) { print "ps -p $PID = $?\n" if($VERBOSE); `$NAMED`; print "running $NAMED\n" if($VERBOSE); openlog("chkdns", 'pid', 'daemon'); syslog('notice', "restarted $NAMED"); closelog(); ¬ify($NOTIFY,$?) if($NOTIFY); } sub notify { my($list,$val)=@_; open(MAIL, "| $SENDMAIL $list") || die $!; print MAIL <<"EOF"; Subject: $SUBJECT Just ran $NAMED at $NOW. Exit value was: $val. . EOF close(MAIL); } --- Mark Jeftovic aka: mark jeff or vic, stunt pope. markjr@shmOOze.net http://www.shmOOze.net/~markjr Private World's BOFH http://www.PrivateWorld.com irc: L-bOMb Keep `em Guessing To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message