mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
nfsen suffix support by falz, + fix poll-reachability, reported by JumpingM
git-svn-id: http://www.observium.org/svn/observer/trunk@2058 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -9,10 +9,14 @@ foreach ( $config['nfsen_rrds'] as $nfsenrrds )
|
||||
if ($configs[strlen($nfsenrrds)-1] != '/') { $nfsenrrds .= '/'; }
|
||||
|
||||
# convert dots in filename to underscores
|
||||
$nfsensuffix = "";
|
||||
if ($config['nfsen_suffix']) { $nfsensuffix = $config['nfsen_suffix']; }
|
||||
$basefilename_underscored = preg_replace('/\./', $config['nfsen_split_char'], $device['hostname']);
|
||||
if (is_file($nfsenrrds . $basefilename_underscored . ".rrd"))
|
||||
$nfsen_filename = (strstr($basefilename_underscored, $nfsensuffix, true));
|
||||
|
||||
if (is_file($nfsenrrds . $nfsen_filename . ".rrd"))
|
||||
{
|
||||
$rrd_filename = $nfsenrrds . $basefilename_underscored . ".rrd";
|
||||
$rrd_filename = $nfsenrrds . $nfsen_filename . ".rrd";
|
||||
|
||||
$flowtypes = array('tcp', 'udp', 'icmp', 'other');
|
||||
|
||||
|
@@ -218,8 +218,11 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id'])
|
||||
foreach ($config['nfsen_rrds'] as $nfsenrrds)
|
||||
{
|
||||
if ($configs[strlen($nfsenrrds)-1] != '/') { $nfsenrrds .= '/'; }
|
||||
$nfsensuffix = "";
|
||||
if ($config['nfsen_suffix']) { $nfsensuffix = $config['nfsen_suffix']; }
|
||||
$basefilename_underscored = preg_replace('/\./', $config['nfsen_split_char'], $device['hostname']);
|
||||
if (is_file($nfsenrrds . $basefilename_underscored . ".rrd")) { $nfsen_rrd_file = $nfsenrrds . $basefilename_underscored . ".rrd"; }
|
||||
$nfsen_filename = (strstr($basefilename_underscored, $nfsensuffix, true));
|
||||
if (is_file($nfsenrrds . $nfsen_filename . ".rrd")) { $nfsen_rrd_file = $nfsenrrds . $basefilename_underscored . ".rrd"; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -157,6 +157,7 @@ $config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
|
||||
$config['nfsen_enable'] = 0;
|
||||
#$config['nfsen_split_char'] = "_";
|
||||
#$config['nfsen_rrds'] = "/var/nfsen/profiles-stat/live/";
|
||||
#$config['nfsen_suffix'] = "_yourdomain_com";
|
||||
|
||||
### Ignores & Allows
|
||||
|
||||
|
@@ -55,7 +55,7 @@ while ($device = mysql_fetch_assoc($device_query))
|
||||
}
|
||||
}
|
||||
|
||||
log_event("Device status changed to $stat", $device, strtolower($stat)));
|
||||
log_event("Device status changed to $stat", $device, strtolower($stat));
|
||||
echo("Status Changed!\n");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user