mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix poller wrapper debug option (#16214)
* Fix poller wrapper debug * fix lint failure
This commit is contained in:
@@ -103,7 +103,7 @@ wrappers = {
|
|||||||
},
|
},
|
||||||
"poller": {
|
"poller": {
|
||||||
"executable": "lnms",
|
"executable": "lnms",
|
||||||
"option": "device:poll -q",
|
"option": "device:poll",
|
||||||
"table_name": "devices",
|
"table_name": "devices",
|
||||||
"memc_touch_time": 10,
|
"memc_touch_time": 10,
|
||||||
"stepping": 300,
|
"stepping": 300,
|
||||||
@@ -288,8 +288,13 @@ def poll_worker(
|
|||||||
if modules is not None and len(str(modules).strip()):
|
if modules is not None and len(str(modules).strip()):
|
||||||
module_str = re.sub("\s", "", str(modules).strip())
|
module_str = re.sub("\s", "", str(modules).strip())
|
||||||
command = command + " -m {}".format(module_str)
|
command = command + " -m {}".format(module_str)
|
||||||
if debug:
|
|
||||||
|
# enable debug output otherwise, set -q for lnms commands
|
||||||
|
if wrappers[wrapper_type]["executable"] == "lnms":
|
||||||
|
command = command + (" -vv" if debug else " -q")
|
||||||
|
elif debug:
|
||||||
command = command + " -d"
|
command = command + " -d"
|
||||||
|
|
||||||
exit_code, output = command_runner(
|
exit_code, output = command_runner(
|
||||||
command,
|
command,
|
||||||
shell=True,
|
shell=True,
|
||||||
@@ -456,6 +461,8 @@ def wrapper(
|
|||||||
logger.critical("Bogus wrapper type called")
|
logger.critical("Bogus wrapper type called")
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
|
maxlocks = 0
|
||||||
|
minlocks = 0
|
||||||
sconfig = DBConfig()
|
sconfig = DBConfig()
|
||||||
sconfig.populate(config)
|
sconfig.populate(config)
|
||||||
db_connection = LibreNMS.DB(sconfig)
|
db_connection = LibreNMS.DB(sconfig)
|
||||||
|
Reference in New Issue
Block a user