service templates - move to blade -wip

This commit is contained in:
Anthony F McInerney
2020-10-14 13:36:11 +01:00
parent 44ac62a069
commit 5da4aff32a
4 changed files with 22 additions and 8 deletions
@@ -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',
+12 -2
View File
@@ -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
+5 -5
View File
@@ -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',
+4
View File
@@ -932,6 +932,10 @@
"default": false,
"type": "boolean"
},
"discover_services_templates": {
"default": false,
"type": "boolean"
},
"discovery_by_ip": {
"default": false,
"type": "boolean"