Nagios Services

- Moved check-services.php to a poller module
    - Added performance data collection to the poller
    - Centralised DB functions to includes/services.inc.php
    - Created add/edit/delete functions off the device, services page
    - Removed legacy edit/delete interfaces.
    - Moved and modified check.inc scripts
    - Documentation Updates
    - Modified services table
This commit is contained in:
Aaron Daniels
2016-03-15 22:23:14 +10:00
parent 2d2f56c3dc
commit 0d6cfec589
61 changed files with 1039 additions and 801 deletions
-32
View File
@@ -585,38 +585,6 @@ function is_valid_hostname($hostname) {
return ctype_alnum(str_replace('_','',str_replace('-','',str_replace('.','',$hostname))));
}
function add_service($device, $service, $descr, $service_ip, $service_param = "", $service_ignore = 0) {
if (!is_array($device)) {
$device = device_by_id_cache($device);
}
if (empty($service_ip)) {
$service_ip = $device['hostname'];
}
$insert = array('device_id' => $device['device_id'], 'service_ip' => $service_ip, 'service_type' => $service,
'service_changed' => array('UNIX_TIMESTAMP(NOW())'), 'service_desc' => $descr, 'service_param' => $service_param, 'service_ignore' => $service_ignore);
return dbInsert($insert, 'services');
}
function edit_service($service, $descr, $service_ip, $service_param = "", $service_ignore = 0) {
if (!is_numeric($service)) {
return false;
}
$update = array('service_ip' => $service_ip,
'service_changed' => array('UNIX_TIMESTAMP(NOW())'),
'service_desc' => $descr,
'service_param' => $service_param,
'service_ignore' => $service_ignore);
return dbUpdate($update, 'services', '`service_id`=?', array($service));
}
/*
* convenience function - please use this instead of 'if ($debug) { echo ...; }'
*/