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

This commit is contained in:
Paul Gear
2016-01-02 07:10:40 +10:00
parent f1ab68deed
commit 7752bc0494
4 changed files with 22 additions and 27 deletions
-19
View File
@@ -611,25 +611,6 @@ function d_print_r($var, $no_debug_text = null) {
}
}
/*
* Shorten the name so it works as an RRD data source name (limited to 19 chars by default).
* Substitute for $subst if necessary.
* @return the shortened name
*/
function name_shorten($name, $common = null, $subst = "mibval", $len = 19) {
if ($common !== null) {
// remove common from the beginning of the string, if present
if (strlen($name) > $len && strpos($name, $common) >= 0) {
$newname = str_replace($common, '', $name);
$name = $newname;
}
}
if (strlen($name) > $len) {
$name = $subst;
}
return $name;
}
/*
* @return the name of the rrd file for $host's $extra component
* @param host Host name