mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #11661 from SourceDoctor/app_dhcp_enhancement
Application DHCP Upgrade
This commit is contained in:
@@ -1279,6 +1279,7 @@ function get_postgres_databases($device_id)
|
||||
function get_arrays_with_application($device, $app_id, $app_name, $category = null)
|
||||
{
|
||||
$entries = array();
|
||||
$separator = '-';
|
||||
|
||||
if ($category) {
|
||||
$pattern = sprintf('%s/%s-%s-%s-%s-*.rrd', get_rrd_dir($device['hostname']), 'app', $app_name, $app_id, $category);
|
||||
@@ -1286,10 +1287,13 @@ function get_arrays_with_application($device, $app_id, $app_name, $category = nu
|
||||
$pattern = sprintf('%s/%s-%s-%s-*.rrd', get_rrd_dir($device['hostname']), 'app', $app_name, $app_id);
|
||||
}
|
||||
|
||||
# app_name contains a separator character? consider it
|
||||
$offset = substr_count($app_name, $separator);
|
||||
|
||||
foreach (glob($pattern) as $rrd) {
|
||||
$filename = basename($rrd, '.rrd');
|
||||
|
||||
list(,,, $entry) = explode("-", $filename, 4);
|
||||
$entry = explode($separator, $filename, 4 + $offset)[3 + $offset];
|
||||
|
||||
if ($entry) {
|
||||
array_push($entries, $entry);
|
||||
|
Reference in New Issue
Block a user