mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Sort services list
This commit is contained in:
@ -11,17 +11,20 @@
|
|||||||
* the source code distribution for details.
|
* the source code distribution for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(is_admin() !== false) {
|
if (is_admin() !== false) {
|
||||||
|
|
||||||
// Build the types list.
|
// Build the types list.
|
||||||
if ($handle = opendir($config['nagios_plugins'])) {
|
$dir = $config['nagios_plugins'];
|
||||||
while (false !== ($file = readdir($handle))) {
|
if (file_exists($dir) && is_dir($dir)) {
|
||||||
if ($file != '.' && $file != '..' && !strstr($file, '.') && strstr($file, 'check_')) {
|
$files = scandir($dir);
|
||||||
list(,$check_name) = explode('_',$file,2);
|
$dir .= DIRECTORY_SEPARATOR;
|
||||||
|
d_print_r($files);
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (is_executable($dir.$file) && is_file($dir.$file) && strstr($file, 'check_')) {
|
||||||
|
list(,$check_name) = explode('_', $file, 2);
|
||||||
$stype .= "<option value='$check_name'>$check_name</option>";
|
$stype .= "<option value='$check_name'>$check_name</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -142,4 +145,4 @@ $('#service-submit').click('', function(e) {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user