Allow non-snmp modules to run when snmp disabled (#13321)

* Use the normal config to add availability module to the poller list
This also allows it to be disabled.

* Use the normal config to add availability module to the poller list
This also allows it to be disabled.
This commit is contained in:
Tony Murray
2021-10-04 06:33:40 -05:00
committed by GitHub
parent fa658bba35
commit 9d92cf19f5
2 changed files with 14 additions and 2 deletions

View File

@@ -295,10 +295,15 @@ function poll_device($device, $force_module = false)
if ($helper->isUp()) {
if ($device['snmp_disable']) {
Config::set('poller_modules', ['availability' => true]);
// only non-snmp modules
Config::set('poller_modules', array_intersect_key(Config::get('poller_modules'), [
'availability' => true,
'ipmi' => true,
'unix-agent' => true,
]));
} else {
// we always want the core module to be included, prepend it
Config::set('poller_modules', ['core' => true, 'availability' => true] + Config::get('poller_modules'));
Config::set('poller_modules', ['core' => true] + Config::get('poller_modules'));
}
// update $device array status

View File

@@ -4361,6 +4361,13 @@
"default": true,
"type": "boolean"
},
"poller_modules.availability": {
"order": 25,
"group": "poller",
"section": "poller_modules",
"default": true,
"type": "boolean"
},
"poller_modules.ipmi": {
"order": 210,
"group": "poller",