DHCP lease count
-
how can i show the count of online dhcp lease like below?

 -
You want graphical row numbers or do you want an online/active dhcp total?
For total leases in file
cat /var/dhcpd/var/db/dhcpd.leases | grep -c lease
-
I want online/active dhcp total?
-
I want online/active dhcp total?
cat /var/dhcpd/var/db/dhcpd.leases | grep -c "binding state active;"
online gets a bit tougher because it checks arpdata.
-
If you are on 2.1 backup your status_dhcp_leases.php and put the attached version in its place. Or if you are on a different version you can try placing this code chunk in after the parsing switch statement.
$countactive = 0; $countonline = 0; foreach ($leases as $item) { if ($item['act'] === 'active') { $countactive++; } if ($item['online'] === 'online') { $countonline++; } } echo "Active: " . $countactive . " "; echo "Online: " . $countonline;


status_dhcp_leases.php.txt -
where the dhcp lease file located? i mean status_dhcp_leases.php file
-
where the dhcp lease file located? i mean status_dhcp_leases.php file
/usr/local/www/
if you need to find things on command line you can use find
find / -name filename
if you need wildcards use
find / -name \*filename\*