From 437f6d101b85c4425bb1c25d4be5259797972cff Mon Sep 17 00:00:00 2001 From: Simon Guilbault Date: Thu, 26 Mar 2020 10:34:15 -0400 Subject: [PATCH] Ignoring another PSU status flag --- check_jbod-el7.spec | 6 ++++-- check_jbod.py | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/check_jbod-el7.spec b/check_jbod-el7.spec index 231be12..6fd06cf 100644 --- a/check_jbod-el7.spec +++ b/check_jbod-el7.spec @@ -1,6 +1,6 @@ Name: check_jbod -Version: 0.0.5 -%global gittag 0.0.5 +Version: 0.0.6 +%global gittag 0.0.6 Release: 1%{?dist} Summary: Nagios script to check the status and fault in Xyratex JBOD. @@ -42,6 +42,8 @@ rm -rf $RPM_BUILD_ROOT /usr/lib64/nagios/plugins/%{name} %changelog +* Thu Mar 26 2020 Simon Guilbault 0.0.6-1 +- Ignoring another PSU status flag * Wed Mar 25 2020 Simon Guilbault 0.0.5-1 - Increasing fan maximum speed threshold * Thu Mar 19 2020 Simon Guilbault 0.0.4-1 diff --git a/check_jbod.py b/check_jbod.py index a589702..8538e8b 100755 --- a/check_jbod.py +++ b/check_jbod.py @@ -274,15 +274,19 @@ def get_sg_jbods(): number=psu_number, status=psu[1], )) - if psu[3] != 'Hot swap=1, Fail=0, Requested on=0, Off=0, Overtmp fail=0' and psu[3] != 'Hot swap=1, Fail=0, Requested on=1, Off=0, Overtmp fail=0': # noqa: E501 + if psu[3] not in [ + 'Hot swap=1, Fail=0, Requested on=0, Off=0, Overtmp fail=0', + 'Hot swap=1, Fail=0, Requested on=1, Off=0, Overtmp fail=0', + 'Hot swap=0, Fail=0, Requested on=0, Off=0, Overtmp fail=0' + ]: criticals.append('PSU{number} {status}'.format( number=psu_number, - status=psu[1], + status=psu[3], )) if psu[4] != 'Temperature warn=0, AC fail=0, DC fail=0': criticals.append('PSU{number} {status}'.format( number=psu_number, - status=psu[1], + status=psu[4], )) if args.volt: