mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove nfs requirement for distributed poller (with rrdtool 1.5+)
Use data_update instead of rrd_update/rrd_create and influx_update Centralize rrd file check so we can check against a remote rrdcached server too Use rrd_name() to generate rrd file names
This commit is contained in:
@@ -25,23 +25,21 @@ if ($device['os_group'] == "cisco") {
|
||||
$active += $value[''];
|
||||
}
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-iosdsp.rrd");
|
||||
if (!file_exists ($rrd_filename)) {
|
||||
rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']);
|
||||
}
|
||||
$rrd_def = array(
|
||||
'DS:total:GAUGE:600:0:U',
|
||||
'DS:active:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'total' => $total,
|
||||
'active' => $active,
|
||||
);
|
||||
|
||||
rrdtool_update ($rrd_filename, $fields);
|
||||
|
||||
$tags = array();
|
||||
influx_update($device,'cisco-iosdsp',$tags,$fields);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cisco-iosdsp', $tags, $fields);
|
||||
|
||||
$graphs['cisco-iosdsp'] = TRUE;
|
||||
echo (" Cisco IOS DSP ");
|
||||
}
|
||||
unset($rrd_filename, $total, $active);
|
||||
unset($rrd_def, $total, $active, $tags, $fields);
|
||||
}
|
||||
|
@@ -24,23 +24,21 @@ if ($device['os_group'] == "cisco") {
|
||||
// Active
|
||||
$active = $total - $available;
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-iosmtp.rrd");
|
||||
if (!file_exists ($rrd_filename)) {
|
||||
rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']);
|
||||
}
|
||||
$rrd_def = array(
|
||||
'DS:total:GAUGE:600:0:U',
|
||||
'DS:active:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'total' => $total,
|
||||
'active' => $active,
|
||||
);
|
||||
|
||||
rrdtool_update ($rrd_filename, $fields);
|
||||
|
||||
$tags = array();
|
||||
influx_update($device,'cisco-iosmtp',$tags,$fields);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cisco-iosmtp', $tags, $fields);
|
||||
|
||||
$graphs['cisco-iosmtp'] = TRUE;
|
||||
echo (" Cisco IOS MTP ");
|
||||
}
|
||||
unset($rrd_filename, $total, $active, $available);
|
||||
unset($rrd_def, $total, $active, $available, $fields, $tags);
|
||||
}
|
||||
|
@@ -28,24 +28,21 @@ if ($device['os_group'] == "cisco") {
|
||||
$active = $active['1.3.6.1.4.1.9.10.19.1.1.4.0'][''];
|
||||
|
||||
if (isset($active) && ($active != "") && ($total != 0)) {
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-iospri.rrd");
|
||||
|
||||
if (!file_exists ($rrd_filename)) {
|
||||
rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']);
|
||||
}
|
||||
$rrd_def = array(
|
||||
'DS:total:GAUGE:600:0:U',
|
||||
'DS:active:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'total' => $total,
|
||||
'active' => $active,
|
||||
);
|
||||
|
||||
rrdtool_update ($rrd_filename, $fields);
|
||||
|
||||
$tags = array();
|
||||
influx_update($device,'cisco-iospri',$tags,$fields);
|
||||
$tags = copmact('rrd_def');
|
||||
data_update($device, 'cisco-iospri', $tags, $fields);
|
||||
|
||||
$graphs['cisco-iospri'] = TRUE;
|
||||
echo (" Cisco IOS PRI ");
|
||||
}
|
||||
unset($rrd_filename, $total, $active);
|
||||
unset($rrd_def, $total, $active, $fields, $tags);
|
||||
}
|
||||
|
@@ -24,23 +24,21 @@ if ($device['os_group'] == "cisco") {
|
||||
// Active
|
||||
$active = $total - $available;
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename ("cisco-iosxcode.rrd");
|
||||
if (!file_exists ($rrd_filename)) {
|
||||
rrdtool_create ($rrd_filename, " DS:total:GAUGE:600:0:U DS:active:GAUGE:600:0:U" . $config['rrd_rra']);
|
||||
}
|
||||
$rrd_def = array(
|
||||
'DS:total:GAUGE:600:0:U',
|
||||
'DS:active:GAUGE:600:0:U'
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'total' => $total,
|
||||
'active' => $active,
|
||||
);
|
||||
|
||||
rrdtool_update ($rrd_filename, $fields);
|
||||
|
||||
$tags = array();
|
||||
influx_update($device,'cisco-iosxcode',$tags,$fields);
|
||||
$tags = compact('rrd_def');
|
||||
dat_update($device, 'cisco-iosxcode', $tags, $fields);
|
||||
|
||||
$graphs['cisco-iosxcode'] = TRUE;
|
||||
echo (" Cisco IOS Transcoder ");
|
||||
}
|
||||
unset($rrd_filename, $total, $active, $available);
|
||||
unset($rrd_def, $total, $active, $available, $fields, $tags);
|
||||
}
|
||||
|
Reference in New Issue
Block a user