mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
unify sensor rrd filenaming, move to fuction.
git-svn-id: http://www.observium.org/svn/observer/trunk@2168 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,6 +2,21 @@
|
||||
|
||||
## Common Functions
|
||||
|
||||
function get_sensor_rrd($device, $sensor)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if($config['os'][$device['os']]['sensor_descr'] || $sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_descr'] . ".rrd");
|
||||
} else {
|
||||
$rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_index'] . ".rrd");
|
||||
}
|
||||
|
||||
return($rrd_file);
|
||||
|
||||
}
|
||||
|
||||
function get_port_by_id($port_id)
|
||||
{
|
||||
if (is_numeric($port_id))
|
||||
|
||||
Reference in New Issue
Block a user