mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
dhcp-pool: implement autoconf
This commit is contained in:
parent
ced47decaf
commit
341de2c2b9
1 changed files with 14 additions and 1 deletions
|
@ -29,6 +29,9 @@
|
|||
# config (required)
|
||||
#
|
||||
# Version 1.0, 2-12-2008
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
use POSIX;
|
||||
use Time::Local;
|
||||
|
@ -38,7 +41,17 @@ my $CONFFILE = exists $ENV{'conffile'} ? $ENV{'conffile'} : "/etc/dhcpd.conf";
|
|||
my $LEASEFILE = exists $ENV{'leasefile'} ? $ENV{'leasefile'} : "/var/lib/dhcp/dhcpd.leases";
|
||||
|
||||
if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
|
||||
|
||||
if (-e ${CONFFILE} and -e ${LEASEFILE}) {
|
||||
my %pools;
|
||||
%pools = determine_pools();
|
||||
if (%pools) {
|
||||
print "yes\n";
|
||||
} else {
|
||||
print "no (no pools defined in config)\n";
|
||||
}
|
||||
} else {
|
||||
print "no (no config or lease file)\n";
|
||||
}
|
||||
}
|
||||
elsif ( defined $ARGV[0] and $ARGV[0] eq "config" ) {
|
||||
my (%pools, $start, $label);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue