Re: dhcpd.leases parser


Subject: Re: dhcpd.leases parser
From: Chris (clear@bigpond.net.au)
Date: Fri Nov 02 2001 - 14:38:22 AKST


Mike Barsalou wrote:
>
> Anyone have or know of a dhcpd.leases file parser that will turn the
> dhcpd.leases file into a comma delimited file?
>
> I want to get the MAC address, computer name, IP address and maybe a few
> other items.
>
> Can anyone help?
>
> Mike

Mike not sure if this will help as I only have about 15 hosts but this
works for me:

========================================
cat $LEASES_FILE \
|egrep -v '^#' \ | sed -e 's/ //g' \
| sed -e 's/[{|}]//g' | egrep -v '^$' \
| sed -e 's/;//g' | sed -e 's/ $//g' \
| sed -e 's/ /,/g' > $OUTPUT_FILE
========================================

Variables should be more than explanatory.

see ya,

-- 

Chris

~\\clear@bigpond.net.au//~ < ~\\//~ https://changing.dyndns.org IseekU 2579.7959222^2 658D73(hex)

"One World, one Web, one Program" - Microsoft promotional ad "Ein Volk, ein Reich, ein Fuhrer" - Adolf Hitler



This archive was generated by hypermail 2a23 : Fri Nov 02 2001 - 15:00:16 AKST