mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
service templates - move to blade -wip
This commit is contained in:
@@ -113,8 +113,8 @@ class ServiceTemplateController extends Controller
|
||||
$query->where('service_template_id', '!=', $serviceTemplate->service_template_id);
|
||||
}),
|
||||
],
|
||||
'service_template_type' => 'required|in:dynamic,static',
|
||||
'device_group_id' => 'integer',
|
||||
'service_template_type' => 'string',
|
||||
'service_template_param' => 'string',
|
||||
'service_template_ip' => 'string',
|
||||
'service_template_desc' => 'string',
|
||||
|
||||
@@ -36,8 +36,7 @@ discover intervals.
|
||||
|
||||
## Service Auto Discovery
|
||||
|
||||
To automatically apply service checks that are discovered to devices
|
||||
and to automatically apply Service Templates.
|
||||
To automatically create services for devices with available checks.
|
||||
|
||||
You need to enable the discover services within config.php with the following:
|
||||
|
||||
@@ -45,6 +44,17 @@ You need to enable the discover services within config.php with the following:
|
||||
$config['discover_services'] = true;
|
||||
```
|
||||
|
||||
## Service Templates Auto Discovery
|
||||
|
||||
To automatically create services for devices with configured
|
||||
Service Templates.
|
||||
|
||||
You need to enable the discover services within config.php with the following:
|
||||
|
||||
```php
|
||||
$config['discover_services_templates'] = true;
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
Service checks is now distributed aware. If you run a distributed
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
use App\Models\ServiceTemplate;
|
||||
|
||||
if (Config::get('discover_services')) {
|
||||
// Autodiscover Service Templates
|
||||
foreach (dbFetchRows('SELECT `service_template_id`, `device_group_id` FROM `services_template`') as $service_template) {
|
||||
discover_service_template($service_template['device_group_id'], $service_template['service_template_id']);
|
||||
if (Config::get('discover_services_templates')) {
|
||||
foreach (DB::table('services_template')->pluck('service_template_id') as $service_template) {
|
||||
discover_service_template($service_template['service_template_id']);
|
||||
}
|
||||
}
|
||||
if (Config::get('discover_services')) {
|
||||
// FIXME: use /etc/services?
|
||||
$known_services = [
|
||||
22 => 'ssh',
|
||||
|
||||
@@ -932,6 +932,10 @@
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"discover_services_templates": {
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"discovery_by_ip": {
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
|
||||
Reference in New Issue
Block a user