SUMMARY: DNS IP Cleanup

From: <jagga_at_chamkila.org>
Date: Thu Jul 31 2003 - 03:42:18 EDT
Hi Guys,

I apologize for not sending a Summary sooner but wanted to fix a couple of
things before I posted... Thanks to Douglas Palmer and everyone who
replied to my question... Alot of people suggested I use nmap which was
not an option so I was unable to do so.. but is a good choise if someone
else out there does have a similar issue and access to nmap.. but the
following is what I came up with..

___________________________________________________
if ($#argv < 2) then
        echo "Usage: static Building Subnet"
        echo "ex: static 26 95"
        exit
endif

cd /usr/local/adm/domain
touch notp
touch range

echo "Searching for Non-Active Ips in Building $argv[1] - Subnet
$argv[2]..."
egrep -vi origin\|^\; *hosts.b$argv[1]* |\
perl -e 'while (<>) {\
        m/(\d{1,3}\.\d{1,3}\.\d{1,3}.\d{1,3})/;\
        print "$1\n" if $1; }' | sort -u | sort -n > ips
awk -F . -v foo=$argv[2] '{if ($4 > 199 && $4 < 251 && $3 == foo) print
$0}' ips >> range

foreach addr(`cat range`)
        /sbin/ping -c 1 $addr
        if ($status != 0) then
                echo $addr >> notp
        endif
end
clear
echo "Emailing `whoami` a list of all non-responding Static
IP's in Subnet $argv[2]"
echo "Note: Null message means all Static IPs are responding"
cat notp | mail -s "Static IPs Not Responding - Subnet $argv[2] -
Building $argv[1]" `whoami`

rm -f range
rm -f notp
rm -f ips
________________________________________________

Thanks again for all the suggestions and for taking the time to answer my
question..

-Simran H.


> Hi Guys,
>
> We have dns files for about 54 buildings that we are maintaining and I
> would like to do some IP cleanup since we are running out of statics and I
> would like to free up the ones that are not being used.  Our statics are
> in the range of 200 - 250 for every subnet and the rest are reserved for
> dhcp and other networking purposes.  Has anyone ever done something
> similar to this before?  I am thinking that the best way to go about doing
> this would be to create a script that touches each of these files and
> pings the ips to see if it is responding and if not then stores that ip
> into a different file.  Please let me know if someone has done this before
> and what would be the best approach for doing this.  Also, if someone has
> a script that does something similar I would be grateful if you could
> share.  Any suggestions or comments would be appreciated.
>
> Thanks in advance,
> Simran H.
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Jul 31 03:44:03 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:17 EST