mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 10:39:53 +00:00
dhcp-pool: count only active leases, not free ones
Lease can be within time limits, but freed. Don't count them.
This commit is contained in:
parent
bc998e2007
commit
2fd01d998d
1 changed files with 2 additions and 0 deletions
|
@ -160,6 +160,8 @@ sub determine_active_leases {
|
||||||
}
|
}
|
||||||
elsif ($line =~ /ends \d ([\d]{4})\/([\d]{2})\/([\d]{2}) ([\d]{2}):([\d]{2}):([\d]{2})/) {
|
elsif ($line =~ /ends \d ([\d]{4})\/([\d]{2})\/([\d]{2}) ([\d]{2}):([\d]{2}):([\d]{2})/) {
|
||||||
$enddate = mktime($6, $5, $4, $3, $2-1, $1-1900, 0, 0);
|
$enddate = mktime($6, $5, $4, $3, $2-1, $1-1900, 0, 0);
|
||||||
|
}
|
||||||
|
elsif ($line =~ /binding state active/) {
|
||||||
if (defined($enddate) && defined($startdate) && defined($lease)) {
|
if (defined($enddate) && defined($startdate) && defined($lease)) {
|
||||||
if ($startdate < time() && $enddate > time()) {
|
if ($startdate < time() && $enddate > time()) {
|
||||||
push (@activeleases, $lease);
|
push (@activeleases, $lease);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue