mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
Move convenience functions into common; d_echo no longer adds "\n" automatically
This commit is contained in:
@@ -805,23 +805,6 @@ function snmp_gen_auth (&$device)
|
||||
return $cmd;
|
||||
}
|
||||
|
||||
/*
|
||||
* Shorten the name to so it works as an RRD data source.
|
||||
* Substitute for $subst if necessary.
|
||||
* @return the shortened name
|
||||
*/
|
||||
function name_shorten($name, $common, $subst = "mibval", $len = 19)
|
||||
{
|
||||
if (strlen($name) > $len && strpos($name, $common) >= 0) {
|
||||
$newname = str_replace($common, '', $name);
|
||||
$name = $newname;
|
||||
}
|
||||
if (strlen($name) > $len) {
|
||||
$name = $subst;
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate the given MIB into a vaguely useful PHP array. Each keyword becomes an array index.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user