mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
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:
@@ -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 ...; }'
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user