mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Move to fixed DS names in MIB-based polling; add script to convert RRDs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user