summaryrefslogtreecommitdiff
path: root/roles/install_monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'roles/install_monitoring')
-rw-r--r--roles/install_monitoring/templates/ffmyk-influx/dhcp.php.j24
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/install_monitoring/templates/ffmyk-influx/dhcp.php.j2 b/roles/install_monitoring/templates/ffmyk-influx/dhcp.php.j2
index 66371ef..7b81328 100644
--- a/roles/install_monitoring/templates/ffmyk-influx/dhcp.php.j2
+++ b/roles/install_monitoring/templates/ffmyk-influx/dhcp.php.j2
@@ -2,9 +2,9 @@
require('func.php');
- $data = file_get_contents('/var/lib/dhcp/dhcpd.leases');
+ $data = shell_exec("grep -e 'lease [[:digit:]\.]\+ {' -e '\s\+ends' /var/lib/dhcp/dhcpd.leases");
- preg_match_all('/lease ([\d\.]+) \{[^\}]+ends \d+ (\d{4}\/\d{2}\/\d{2} \d+:\d{2}:\d{2});[^\}]+}/s', $data, $match);
+ preg_match_all('/lease ([\d\.]+) \{\n\s+ends \d+ (\d{4}\/\d{2}\/\d{2} \d+:\d{2}:\d{2});/s', $data, $match);
unset($data, $match[0]);