diff --git a/app/Console/Commands/SetConfigCommand.php b/app/Console/Commands/SetConfigCommand.php index b4a46a1dd3..cb590d45e8 100644 --- a/app/Console/Commands/SetConfigCommand.php +++ b/app/Console/Commands/SetConfigCommand.php @@ -56,7 +56,10 @@ class SetConfigCommand extends LnmsCommand $value = $this->juggleType($value); $configItem = $definition->get($setting); if (!$configItem->checkValue($value)) { - $this->error($configItem->getValidationMessage($value)); + $message = ($configItem->type || $configItem->validate) + ? $configItem->getValidationMessage($value) + : __('Cannot set :setting, it is missing validation definition.', ['setting' => $setting]); + $this->error($message); return 2; } diff --git a/html/js/app.js b/html/js/app.js index 33a8ad66f5..c10e98ddbd 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -6486,6 +6486,7 @@ __webpack_require__.r(__webpack_exports__); "unix-agent": "Unix-Agent Integration" }, "poller": { + "distributed": "Distributed Poller", "ping": "Ping", "rrdtool": "RRDTool Setup", "snmp": "SNMP" @@ -6760,6 +6761,18 @@ __webpack_require__.r(__webpack_exports__); "description": "Device performance entries older than (days)", "help": "Cleanup done by daily.sh" }, + "distributed_poller": { + "description": "Enable Distributed Polling (requires additional setup)", + "help": "Enable distributed polling system wide. This is intended for load sharing, not remote polling. You must read the documentation for steps to enable: https://docs.librenms.org/Extensions/Distributed-Poller/" + }, + "distributed_poller_memcached_host": { + "description": "Memcached host", + "help": "The hostname or ip for the memcached server. This is required for poller_wrapper.py and daily.sh locking." + }, + "distributed_poller_memcached_port": { + "description": "Memcached port", + "help": "The port for the memcached server. Default is 11211" + }, "email_auto_tls": { "description": "Enable / disable Auto TLS support", "options": { @@ -7557,6 +7570,22 @@ __webpack_require__.r(__webpack_exports__); "lang": "English" }, "commands": { + "config{get}": { + "description": "Get configuration value", + "arguments": { + "setting": "setting to get value of in dot notation (example: snmp.community.0)" + }, + "options": { + "json": "Output setting or entire config as json" + } + }, + "config{set}": { + "description": "Set configuration value (or unset)", + "arguments": { + "setting": "setting to set in dot notation (example: snmp.community.0)", + "value": "value to set, unset setting if this is omitted" + } + }, "user{add}": { "description": "Add a local user, you can only log in with this user if auth is set to mysql", "arguments": { diff --git a/misc/config_definitions.json b/misc/config_definitions.json index 2f00571874..ff1f28d73a 100644 --- a/misc/config_definitions.json +++ b/misc/config_definitions.json @@ -860,16 +860,31 @@ "default": true }, "distributed_poller": { - "default": false + "default": false, + "group": "poller", + "section": "distributed", + "order": 0, + "type": "boolean" }, "distributed_poller_group": { "default": 0 }, "distributed_poller_memcached_host": { - "default": "example.net" + "default": "example.net", + "group": "poller", + "section": "distributed", + "order": 1, + "type": "text", + "validate": { + "value": "ip_or_hostname" + } }, "distributed_poller_memcached_port": { - "default": 11211 + "default": 11211, + "group": "poller", + "section": "distributed", + "order": 2, + "type": "integer" }, "distributed_poller_name": { }, diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index 987b6c997e..778ec66419 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -31,6 +31,7 @@ return [ 'unix-agent' => 'Unix-Agent Integration', ], 'poller' => [ + 'distributed' => 'Distributed Poller', 'ping' => 'Ping', 'rrdtool' => 'RRDTool Setup', 'snmp' => 'SNMP', @@ -305,6 +306,18 @@ return [ 'description' => 'Device performance entries older than (days)', 'help' => 'Cleanup done by daily.sh' ], + 'distributed_poller' => [ + 'description' => 'Enable Distributed Polling (requires additional setup)', + 'help' => 'Enable distributed polling system wide. This is intended for load sharing, not remote polling. You must read the documentation for steps to enable: https://docs.librenms.org/Extensions/Distributed-Poller/' + ], + 'distributed_poller_memcached_host' => [ + 'description' => 'Memcached host', + 'help' => 'The hostname or ip for the memcached server. This is required for poller_wrapper.py and daily.sh locking.' + ], + 'distributed_poller_memcached_port' => [ + 'description' => 'Memcached port', + 'help' => 'The port for the memcached server. Default is 11211' + ], 'email_auto_tls' => [ 'description' => 'Enable / disable Auto TLS support', 'options' => [ diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index aa8d43eb4f..a166c1e47b 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -22,6 +22,6 @@ @routes - + @endpush