Ipmi check is never going into Critical status in Nagios
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hw-health-charm |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The refactor https:/
As a result Nagios is always showing the OK status, even if the content of ipmi_sensors.out is having a Critical one:
$ /usr/local/
IPMI Status: Critical [149 system event log (SEL) entries present] | 'Current Power'=216 'CPU1 Temp'=43.
$ /usr/local/
$ /usr/local/
OK: IPMI Status: Critical [149 system event log (SEL) entries present] | 'Current Power'=253 'CPU1...
for the last output we would expect the following:
CRITICAL: IPMI Status: Critical [149 system event log (SEL) entries present] | 'Current Power'=253 'CPU1...
the root cause of the problem is the following logic in cron_ipmi_
1, output = subprocess.
2, going to exception and writes the fd.write('{}: {}'.format(
3, then the exception block ends (but no sysexit, etc.)
4, writes out the file *again* without the Nagios Error string based on returncode
line 48 in the original code: https:/
I suggest to write the ipmi_sensors.out content without error warning when no error happened.
This is the patch to fix the file write logic: /pastebin. canonical. com/p/5R58vjsNN h/
https:/
I'm going to create a proper merge request.