mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
Add distributed polling config settings (#10711)
Show error on cli when type or validation is not set
This commit is contained in:
parent
b6f26f6e80
commit
f9b704cb29
@ -56,7 +56,10 @@ class SetConfigCommand extends LnmsCommand
|
|||||||
$value = $this->juggleType($value);
|
$value = $this->juggleType($value);
|
||||||
$configItem = $definition->get($setting);
|
$configItem = $definition->get($setting);
|
||||||
if (!$configItem->checkValue($value)) {
|
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;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6486,6 +6486,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
"unix-agent": "Unix-Agent Integration"
|
"unix-agent": "Unix-Agent Integration"
|
||||||
},
|
},
|
||||||
"poller": {
|
"poller": {
|
||||||
|
"distributed": "Distributed Poller",
|
||||||
"ping": "Ping",
|
"ping": "Ping",
|
||||||
"rrdtool": "RRDTool Setup",
|
"rrdtool": "RRDTool Setup",
|
||||||
"snmp": "SNMP"
|
"snmp": "SNMP"
|
||||||
@ -6760,6 +6761,18 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
"description": "Device performance entries older than (days)",
|
"description": "Device performance entries older than (days)",
|
||||||
"help": "Cleanup done by daily.sh"
|
"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": {
|
"email_auto_tls": {
|
||||||
"description": "Enable / disable Auto TLS support",
|
"description": "Enable / disable Auto TLS support",
|
||||||
"options": {
|
"options": {
|
||||||
@ -7557,6 +7570,22 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
"lang": "English"
|
"lang": "English"
|
||||||
},
|
},
|
||||||
"commands": {
|
"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}": {
|
"user{add}": {
|
||||||
"description": "Add a local user, you can only log in with this user if auth is set to mysql",
|
"description": "Add a local user, you can only log in with this user if auth is set to mysql",
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
@ -860,16 +860,31 @@
|
|||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"distributed_poller": {
|
"distributed_poller": {
|
||||||
"default": false
|
"default": false,
|
||||||
|
"group": "poller",
|
||||||
|
"section": "distributed",
|
||||||
|
"order": 0,
|
||||||
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"distributed_poller_group": {
|
"distributed_poller_group": {
|
||||||
"default": 0
|
"default": 0
|
||||||
},
|
},
|
||||||
"distributed_poller_memcached_host": {
|
"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": {
|
"distributed_poller_memcached_port": {
|
||||||
"default": 11211
|
"default": 11211,
|
||||||
|
"group": "poller",
|
||||||
|
"section": "distributed",
|
||||||
|
"order": 2,
|
||||||
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"distributed_poller_name": {
|
"distributed_poller_name": {
|
||||||
},
|
},
|
||||||
|
@ -31,6 +31,7 @@ return [
|
|||||||
'unix-agent' => 'Unix-Agent Integration',
|
'unix-agent' => 'Unix-Agent Integration',
|
||||||
],
|
],
|
||||||
'poller' => [
|
'poller' => [
|
||||||
|
'distributed' => 'Distributed Poller',
|
||||||
'ping' => 'Ping',
|
'ping' => 'Ping',
|
||||||
'rrdtool' => 'RRDTool Setup',
|
'rrdtool' => 'RRDTool Setup',
|
||||||
'snmp' => 'SNMP',
|
'snmp' => 'SNMP',
|
||||||
@ -305,6 +306,18 @@ return [
|
|||||||
'description' => 'Device performance entries older than (days)',
|
'description' => 'Device performance entries older than (days)',
|
||||||
'help' => 'Cleanup done by daily.sh'
|
'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' => [
|
'email_auto_tls' => [
|
||||||
'description' => 'Enable / disable Auto TLS support',
|
'description' => 'Enable / disable Auto TLS support',
|
||||||
'options' => [
|
'options' => [
|
||||||
|
@ -22,6 +22,6 @@
|
|||||||
@routes
|
@routes
|
||||||
<script src="{{ mix('/js/manifest.js') }}?v=10132019"></script>
|
<script src="{{ mix('/js/manifest.js') }}?v=10132019"></script>
|
||||||
<script src="{{ mix('/js/vendor.js') }}?v=10132019"></script>
|
<script src="{{ mix('/js/vendor.js') }}?v=10132019"></script>
|
||||||
<script src="{{ mix('/js/app.js') }}?v=10132019"></script>
|
<script src="{{ mix('/js/app.js') }}?v=10172019"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user