[Bug 836235] New: nagios-plugins-ipmi-sensor1 not working on Dell
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c0 Summary: nagios-plugins-ipmi-sensor1 not working on Dell Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: x86-64 OS/Version: openSUSE 12.3 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: russellx.j.miller@intel.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3) On a Del PowerEdge R710, /usr/lib/nagios/plugins/check_ipmi_sensor1 fails using -t all. This is because it returns the following: Fatal IO Error | 27h | ns | 34.1 | No Reading The code: errorstring="Error" shopt -s nocasematch if [[ "$ipmioutput" =~ "${errorstring}" ]] then checkhint="check BMC availability/username/password" echo "ipmitool output contains \"$errorstring\" - $checkhint" exit 2 fi shopt -u nocasematch This happens immediately after the check and before the exclusion rule is run, so it's impossible to exclude the offending variable. Suggested fix: Move the "Error" check to after the exclusion, or make the string a little more narrow. Reproducible: Always Steps to Reproduce: 1. run the script on a PowerEdge R710 using -t all. Actual Results: Run the script, says "Error", and fails. Expected Results: Succeeded, there was no error. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c FeiXiang Zhang <fxzhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |schneemann@b1-systems.de |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c Christian Schneemann <schneemann@b1-systems.de> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|schneemann@b1-systems.de |lrupp@suse.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c1 --- Comment #1 from Lars Vogdt <lrupp@suse.com> 2013-08-30 13:36:44 CEST --- Created an attachment (id=555137) --> (http://bugzilla.novell.com/attachment.cgi?id=555137) Patch ignoring "Fatal IO Error" string Proposed fix: ignore the output of the 'sensor name' called "Fatal IO Error" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c2 Lars Vogdt <lrupp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |lrupp@suse.com InfoProvider| |russellx.j.miller@intel.com --- Comment #2 from Lars Vogdt <lrupp@suse.com> 2013-08-30 13:47:54 CEST --- I added the patch mentioned above to the package nagios-plugins-ipmi-sensor1 which is currently building in the server:monitoring repository. Once finished, you should be able to find the package in the path here: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_12.3/n... (Please note: the current package listed there is nagios-plugins-ipmi-sensor1-1.3-11.1.noarch.rpm which does not contain the patch.) The latest RPM changelog entry for the new package is: ------------------------------------------------------------------- Fri Aug 30 11:41:50 UTC 2013 - lars@linux-schulserver.de - added check_ipmi_sensor_v1.3_PowerEdge.patch : Dell PowerEdge servers seem to have a sensor called: "Fatal IO Error" which triggers the script to exit with error message. (see bnc #836235) ------------------------------------------------------------------- Can you please try the new package out on your machine and report if this fixes your problem? I have to admit that I do not have any Dell PowerEdge R710 here for testing, so your answer is very welcome! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c Lars Vogdt <lrupp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c3 --- Comment #3 from Lars Vogdt <lrupp@suse.com> 2013-09-10 18:52:15 CEST --- Hi Russell! Did you find the time to test the http://download.opensuse.org/repositories/server:/monitoring/openSUSE_12.3/n... package containing the mentioned fix above ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c4 --- Comment #4 from Russell Miller <russellx.j.miller@intel.com> 2013-09-11 00:02:27 UTC --- I'll take a look as soon as I get a chance. My apologizes, my hair (what's left of it) has been on fire the past week or two. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c5 Lars Vogdt <lrupp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Normal |Minor --- Comment #5 from Lars Vogdt <lrupp@suse.com> 2013-09-17 18:06:29 CEST --- (In reply to comment #4)
I'll take a look as soon as I get a chance. My apologizes, my hair (what's left of it) has been on fire the past week or two.
Sad to hear. Get well soon! No need to hurry - I hope the patch already fixes your problem, but I will leave the bug open until you had the time to cross check. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c6 --- Comment #6 from Russell Miller <russellx.j.miller@intel.com> 2013-10-11 23:04:20 UTC --- I can verify it's working. But taking a look at the patch, I don't understand how it works, can you help me out here? errorstring="Error" shopt -s nocasematch if [[ "$ipmioutput" =~ "${errorstring}" ]] then if [[ "${errorstring}" =~ ^"Fatal IO Error" ]] then checkhint="check BMC availability/username/password" echo "ipmitool output contains \"$errorstring\" - $checkhint" exit 2 fi fi shopt -u nocasematch Unless I don't understand how =~ works in shell (I know how it works in perl), the "check BMC availability" clause will never actually get hit. Error string is set to "Error", and them immediately afterwards, it's checked to see if it's "Fatal IO Error"? Should that be if [[ "${ipmioutput}" =~ ^"Fatal IO Error" ]] ? Even then, that would just have the effect of ignoring any legitimate errors if the string "Fatal IO Error" actually exists. Am I completely off here? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c7 Russell Miller <russellx.j.miller@intel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|russellx.j.miller@intel.com | --- Comment #7 from Russell Miller <russellx.j.miller@intel.com> 2013-10-17 22:46:24 UTC --- Setting back from needinfo, as I provided necessary info and had some questions myself. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c8 --- Comment #8 from Russell Miller <russellx.j.miller@intel.com> 2013-11-20 01:08:30 UTC --- Here's a much simpler patch that works better, if you're interested. c10:~ # diff check_ipmi_sensor1 check_ipmi_sensor1.new 283a284
ipmioutput=${ipmioutput/Fatal IO Error/Fatal IO}
This just gets rid of the "Fatal IO Error" string so that it doesn't get in the way. Kind of hacky but at least it's mostly guaranteed to do the right thing. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c9 --- Comment #9 from Russell Miller <russellx.j.miller@intel.com> 2013-11-20 01:13:10 UTC --- c10:~ # diff check_ipmi_sensor1 check_ipmi_sensor1.new 283a284
ipmioutput=${ipmioutput/Fatal IO Error/Fatal IO Err}
This one might even be better - because it seems like Dell and ipmitool say "Err" everywhere else in the description, but in this particular situation they say "Error". Or there are probably a hundred different ways to do it, but the long and short is, it seems to be much simpler to get rid of the offending string than try to work around it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c10 Lars Vogdt <lrupp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution| |FIXED --- Comment #10 from Lars Vogdt <lrupp@suse.com> 2013-12-04 16:04:12 CET --- Rewriting the plugin to Perl might indeed be an option that would avoid some problems (but currently I've not the time to do so, sorry). The latest patch (which is now included in the package): --- check_ipmi_sensor_v1.3.orig/check_ipmi_sensor +++ check_ipmi_sensor_v1.3/check_ipmi_sensor @@ -283,9 +283,12 @@ errorstring="Error" shopt -s nocasematch if [[ "$ipmioutput" =~ "${errorstring}" ]] then + if [[ "${errorstring}" =~ ^"Fatal IO Err" ]] + then checkhint="check BMC availability/username/password" echo "ipmitool output contains \"$errorstring\" - $checkhint" exit 2 + fi fi shopt -u nocasematch --- Reason: I'm unsure if your latest patch just checks for the string at the beginning of the line (which is, what the ^ permits in bash). I guess with this we should be save enough to close it as fixed now. Thanks for all your help here! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c11 --- Comment #11 from Russell Miller <russellx.j.miller@intel.com> 2013-12-04 17:34:42 UTC --- I am unsure if this patch will work, but I will test it. The reason I'm unsure is that the $errorstring was set to "Error" just before this conditional. $errorstring will NEVER eq ^"Fatal IO Err". Unless I am completely missing something. The =~ checks the argument on the right as a regular expression against the variable on the left. So in this case, ${errorstring} =~ ^"Fatal IO Err" is kind of a nonsequitur, considering it's already been set to "Error" just a couple of lines up. I don't understand why my patch is inadequate. I tested it, it works, and it does exactly what's needed and no more. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c12 Russell Miller <russellx.j.miller@intel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|FIXED | --- Comment #12 from Russell Miller <russellx.j.miller@intel.com> 2013-12-04 18:05:03 UTC --- I'm reopening this bug until someone can explain to me exactly how this works. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=836235 https://bugzilla.novell.com/show_bug.cgi?id=836235#c13 Russell Miller <russellx.j.miller@intel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |russellx.j.miller@intel.com --- Comment #13 from Russell Miller <russellx.j.miller@intel.com> 2013-12-04 18:24:18 UTC --- ok, reading back on your reason, I think I might understand your confusion. Let me explain what I was trying to do? The issue is that $ipmioutput contains a string called "Fatal IO Error". This creates a situation where $ipmioutput contains a string "Error", which is the exact string that you are checking for to see if there is an error ($errorstring). This is probably not the ideal way of doing this for exactly the reason that we're encountering, but I understand that you may not have time to completely rework that. You seem to be treating $errorstring as the actual error output from ipmitool, but it isn't. $ipmioutput is that output. $errorstring is just the string you are checking for in the $ipmioutput string. So I believe that your patch operates on the wrong variable. What my patch does is substitutes out the "Error" string in $ipmioutput so it doesn't trip the detection algorithm. Can you please do me a favor and explain to me how your patch will solve the problem, in light of my above explanation? I understand that I'm a new contributor, but I really would not like to have to go through this process again on next release. :) Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com