NetReg: UPDATED: a better lease parser

New Message Reply Date view Thread view Subject view Author view Attachment view

From: Clark, Bobby (Bobby.Clark@eku.edu)
Date: Mon Sep 03 2001 - 12:35:09 CDT


sorry, i left out a | in the open(OMSHELL ... line
this eliminates the need to open the dhcpd.leases and parse it.

#--------------------------------getlease.pl---------------#
#!/usr/bin/perl
# getlease.pl
# by: Bobby Clark (bobby.clark@eku.edu)
# purpose: return lease information from isc dhcpd using omshell (omapi)

# usage: getlease.pl ipaddress
# example: getlease.pl 192.168.0.130
$ipaddress = @ARGV[0];

open(OMSHELL, "/usr/bin/omshell |") || die("Could not open omshell\n");
print OMSHELL "connect\n";
print OMSHELL "new lease\n";
print OMSHELL "set ip-address = $ipaddress\n";
print OMSHELL "open\n";
close(OMSHELL) || die("Could not close omshell\n");
exit(0);
#--------------------------------getlease.pl---------------#
**********************************************************************
To unsubscribe from this list, send an e-mail message to
majordomo@southwestern.edu containing a single line with the words:
unsubscribe netreg
Send requests for assistance to: owner-netreg@southwestern.edu
**********************************************************************


New Message Reply Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.4 : Thu Aug 12 2004 - 12:01:36 CDT