Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Feb 2001 10:50:39 -0600
From:      Lucas Bergman <lucas@slb.to>
To:        Joe.Warner@smed.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Help me make FreeBSD shine
Message-ID:  <20010205105039.A163@billygoat.slb.to>
In-Reply-To: <852569EA.0056CD6F.00@Deimos.smed.com>; from Joe.Warner@smed.com on Mon, Feb 05, 2001 at 08:51:52AM -0700
References:  <852569EA.0056CD6F.00@Deimos.smed.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Is there a way that I could write up some simple shell script that
> would ping the IP addresses of these systems and then log the output
> into a file that I could make accessible through a web browser?  If
> so, I could set it to run in the CRON scheduler every four hours at
> specific times/days.

Look at

  http://www.slb.to/~lucas/hacks/iplist-1.0.tar.gz

This contains two scripts, iplist.sh and iplist2html.sh.  The first
pings all the IP addresses on an 8-bit IP network and logs when each
was last heard from (in Unix time format, seconds since midnight on
19700101).  The second script creates a web page that shows which IP
addresses are "free" (have not been heard from in greater than some
number of seconds, by default twenty days).  This helps out my old
employer who refused to use DHCP but who wanted an easy way to assign
free IP addresses.

The package also contains a trivial C program which prints the current
time in seconds since the Unix epoch.

I have a cron job that runs `sh /path/to/iplist.sh' every few hours
and `sh /path/to/iplist2html.sh >/path/to/freeip.html' afterward.  I
would advise *not* running these scripts as root.  Also, ideally you
would run `sh iplist2html.sh >freeip.html.tmp && mv freeip.html.tmp
freeip.html' so that freeip.html isn't truncated if iplist2html.sh
bombs in the middle of a run.  iplist.sh does not corrupt its data
file if it crashes.

Hopefully, this is similar enough to what you want to do that it will
get you started.

Lucas


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010205105039.A163>