Move to fixed DS names in MIB-based polling; add script to convert RRDs

This commit is contained in:
Paul Gear
2015-06-24 19:41:53 +10:00
parent f1ab68deed
commit 7752bc0494
4 changed files with 22 additions and 27 deletions

View File

@ -16,14 +16,12 @@ $rrd_list = array();
$prefix = rrd_name($device['hostname'], array($subtype, ''), '');
foreach (glob($prefix.'*.rrd') as $filename) {
// find out what * expanded to
$globpart = str_replace($prefix, '', $filename);
// take off the prefix
$instance = substr($globpart, 0, -4);
// take off ".rrd"
$globpart = str_replace($prefix, '', $filename); // take off the prefix
$instance = substr($globpart, 0, -4); // take off ".rrd"
$ds = array();
$mibparts = explode('-', $subtype);
$mibvar = end($mibparts);
$ds['ds'] = name_shorten($mibvar);
$ds['ds'] = 'mibval';
$ds['descr'] = "$mibvar-$instance";
$ds['filename'] = $filename;
$rrd_list[] = $ds;