mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2214 from laf/nagios-plugins
Dynamic use of nagios-service checks
This commit is contained in:
@@ -9,7 +9,7 @@ else {
|
||||
$updated = '1';
|
||||
|
||||
// FIXME should call add_service (needs more parameters)
|
||||
$service_id = dbInsert(array('device_id' => $_POST['device'], 'service_ip' => $_POST['ip'], 'service_type' => $_POST['type'], 'service_desc' => $_POST['descr'], 'service_param' => $_POST['params'], 'service_ignore' => '0'), 'services');
|
||||
$service_id = dbInsert(array('device_id' => $_POST['device'], 'service_ip' => $_POST['ip'], 'service_type' => $_POST['type'], 'service_desc' => $_POST['descr'], 'service_param' => $_POST['params'], 'service_ignore' => '0', 'service_status' => '0', 'service_checked' => '0', 'service_changed' => '0', 'service_message' => 'New check', 'service_disabled' => '0'), 'services');
|
||||
|
||||
if ($service_id) {
|
||||
$message .= $message_break.'Service added ('.$service_id.')!';
|
||||
@@ -18,10 +18,11 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
if ($handle = opendir($config['install_dir'].'/includes/services/')) {
|
||||
if ($handle = opendir($config['nagios_plugins'])) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..' && !strstr($file, '.')) {
|
||||
$servicesform .= "<option value='$file'>$file</option>";
|
||||
if ($file != '.' && $file != '..' && !strstr($file, '.') && strstr($file, 'check_')) {
|
||||
list(,$check_name) = explode('_',$file,2);
|
||||
$servicesform .= "<option value='$check_name'>$check_name</option>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,6 @@ echo "<span style='font-weight: bold;'>Services</span> » ";
|
||||
|
||||
$menu_options = array(
|
||||
'basic' => 'Basic',
|
||||
'details' => 'Details',
|
||||
);
|
||||
|
||||
$sql_param = array();
|
||||
@@ -68,7 +67,6 @@ echo '<div class="table-responsive">
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Service</th>
|
||||
<th>Status</th>
|
||||
<th>Changed</th>
|
||||
<th>Message</th>
|
||||
</tr>';
|
||||
|
Reference in New Issue
Block a user