mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
much improved things :)
git-svn-id: http://www.observium.org/svn/observer/trunk@424 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -23,6 +23,31 @@ require('collectd/functions.php');
|
||||
require('collectd/definitions.php');
|
||||
|
||||
|
||||
function mac_clean_to_readable($mac){
|
||||
|
||||
$r = substr($mac, 0, 2);
|
||||
$r .= ":".substr($mac, 2, 2);
|
||||
$r .= ":".substr($mac, 4, 2);
|
||||
$r .= ":".substr($mac, 6, 2);
|
||||
$r .= ":".substr($mac, 8, 2);
|
||||
$r .= ":".substr($mac, 10, 2);
|
||||
|
||||
return($r);
|
||||
}
|
||||
|
||||
function zeropad($num)
|
||||
{
|
||||
return (strlen($num) == 1) ? '0'.$num : $num;
|
||||
}
|
||||
|
||||
function zeropad_lineno($num, $length)
|
||||
{
|
||||
while (strlen($num) < $length)
|
||||
$num = '0'.$num;
|
||||
|
||||
return $num;
|
||||
}
|
||||
|
||||
function only_alphanumeric( $string )
|
||||
{
|
||||
return preg_replace('/[^a-zA-Z0-9]/', '', $string);
|
||||
|
||||
Reference in New Issue
Block a user