mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
automatically load all temperature include files, moved almost all of them over to internal snmp functions, PLEASE TEST
git-svn-id: http://www.observium.org/svn/observer/trunk@1325 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -678,4 +678,23 @@ function isHexString($str)
|
||||
return preg_match("/^[a-f0-9][a-f0-9]( [a-f0-9][a-f0-9])*$/is",trim($str));
|
||||
}
|
||||
|
||||
# Include all .inc.php files in $dir
|
||||
function include_dir($dir)
|
||||
{
|
||||
global $device, $config;
|
||||
|
||||
if ($handle = opendir($dir))
|
||||
{
|
||||
while (false !== ($file = readdir($handle)))
|
||||
{
|
||||
if (filetype($dir . '/' . $file) == 'file' && substr($file,strlen($file)-8) == '.inc.php')
|
||||
{
|
||||
include($dir . '/' . $file);
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user