Module: check_mk
Branch: master
Commit: b723b7bcdd36e30962ece5fe8f99bf3d9e380ea9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b723b7bcdd36e3…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Sep 11 09:39:41 2018 +0200
agent_ipmi_sensors: Fixed using wrong params
Change-Id: Idda481cb871abdbc8d9e5011d195f300a0173de3
---
agents/special/agent_ipmi_sensors | 5 +++--
checks/agent_ipmi_sensors | 17 +++++++++--------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/agents/special/agent_ipmi_sensors b/agents/special/agent_ipmi_sensors
index 4746e9b..12218e2 100755
--- a/agents/special/agent_ipmi_sensors
+++ b/agents/special/agent_ipmi_sensors
@@ -83,7 +83,8 @@ def parse_data(data, excludes):
def agent_ipmi_sensors_main(cmdline_args):
short_options = 'u:p:l:D:k:'
- long_options = [ 'help', 'debug'
+ long_options = [ 'help', 'debug',
+ 'ipmi-command=',
'quiet-cache', 'sdr-cache-recreate',
'interpret-oem-data',
'output-sensor-state',
'ignore-not-available-sensors',
'driver-type=', 'output-sensor-thresholds' ]
@@ -175,7 +176,7 @@ def agent_ipmi_sensors_main(cmdline_args):
sys.stderr.write("Executing: '%s'\n" % ipmi_cmd_str)
errors = []
- for section, (types, excludes) in queries:
+ for section, (types, excludes) in queries.iteritems():
sys.stdout.write( "<<<ipmi%s:sep(124)>>>\n" % section
)
try:
try:
diff --git a/checks/agent_ipmi_sensors b/checks/agent_ipmi_sensors
index c74dc66..7914634 100644
--- a/checks/agent_ipmi_sensors
+++ b/checks/agent_ipmi_sensors
@@ -31,9 +31,9 @@ def agent_ipmi_sensors_arguments(params, hostname, ipaddress):
ipmi_command, options = params
args = [
- "-u", quote_shell_string(params["username"]),
- "-p", quote_shell_string(params["password"]),
- "-l", quote_shell_string(params["privilege_lvl"]),
+ "-u", quote_shell_string(options["username"]),
+ "-p", quote_shell_string(options["password"]),
+ "-l", quote_shell_string(options["privilege_lvl"]),
"--ipmi-command", ipmi_command,
]
@@ -47,11 +47,12 @@ def agent_ipmi_sensors_arguments(params, hostname, ipaddress):
('--output-sensor-state', "output_sensor_state"),
('--ignore-not-available-sensors',
"output_sensor_thresholds"),
('--output-sensor-thresholds',
"ignore_not_available_sensors"), ]:
- this_param = params.get(what)
- if this_param:
- args.append( opt )
- if not isinstance(this_param, bool):
- args.append( quote_shell_string(this_param) )
+ this_opt = options.get(what)
+ if this_opt is None:
+ continue
+ args.append(opt)
+ if not isinstance(this_opt, bool):
+ args.append(quote_shell_string(this_opt))
args.append( quote_shell_string(ipaddress) )
return " ".join( args )