Skip to content

Fixing hpacucli to respect the cache_fail and bbulearn command options #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2019
Merged

Fixing hpacucli to respect the cache_fail and bbulearn command options #193

merged 1 commit into from
May 16, 2019

Conversation

phsm
Copy link
Contributor

@phsm phsm commented May 13, 2019

Hello,
A small fix to make the program respect the --cache-fail and --bbulearn settings.

Debug output:

# ./check_raid '-p' 'mdstat,megacli,mpt,megaraid,tw_cli,cciss,sas2ircu,smartctl,hpssacli' '--cache-fail' 'OK' --bbulearn OK -d
check_raid 4.0.9
Visit <https://github.com/glensc/nagios-plugin-check_raid#reporting-bugs> how to report bugs
Please include output of **ALL** commands in bugreport
                             
DEBUG EXEC: /proc/mdstat at ./check_raid line 503.
DEBUG EXEC: /usr/sbin/hpssacli controller all show status at ./check_raid line 503.
DEBUG EXEC: /usr/sbin/hpssacli controller slot=0 logicaldrive all show at ./check_raid line 503.
OK: hpssacli:[Smart Array P420i[OK, Cache: Temporarily Disabled, Battery: Recharging]: Array A(OK)[LUN1:OK]]
# cat /proc/mdstat
Personalities : 
unused devices: <none>
# /usr/sbin/hpssacli controller all show status

Smart Array P420i in Slot 0 (Embedded)
   Controller Status: OK
   Cache Status: Temporarily Disabled
   Battery/Capacitor Status: Recharging



# /usr/sbin/hpssacli controller slot=0 logicaldrive all show

Smart Array P420i in Slot 0 (Embedded)

   array A

      logicaldrive 1 (279.4 GB, RAID 1, OK)


@glensc
Copy link
Owner

glensc commented May 13, 2019

can you add new testcase based on your setup?

@phsm
Copy link
Contributor Author

phsm commented May 14, 2019

Hello,
added a test case prototype, but it fails due to status code. Seems that the options aren't passed to the test.
Can you help me with figuring out how to properly pass them? (sorry, I've never made tests in Perl)

@phsm
Copy link
Contributor Author

phsm commented May 14, 2019

I do not understand. On my machine tests are passing:

~/git/nagios-plugin-check_raid $ make test
perl -MTest::Harness -e 'runtests @ARGV' t/*.t
t/check_aaccli.t .... ok   
t/check_afacli.t .... ok   
t/check_arcconf.t ... ok       
t/check_areca.t ..... ok     
t/check_cciss.t ..... ok     
t/check_cmdtool2.t .. ok   
t/check_dmraid.t .... ok     
t/check_dm.t ........ ok     
t/check_dpt_i2o.t ... ok   
t/check_gdth.t ...... ok     
t/check_hpacucli.t .. ok     
t/check_hp_msa.t .... ok   
t/check_ips.t ....... ok   
t/check_lsraid.t .... ok   
t/check_lsscsi.t .... ok   
t/check_lsvg.t ...... ok   
t/check_mdstat.t .... ok       
t/check_megacli.t ... ok       
t/check_megarc.t .... ok   
t/check_metastat.t .. ok     
t/check_mpt.t ....... ok     
t/check_mvcli.t ..... ok     
t/check_sas2ircu.t .. ok     
t/check_smartctl.t .. ok   
t/check_tw_cli.t .... ok     
t/enabled.t ......... ok     
t/status.t .......... ok     
t/sudo.t ............ ok     
All tests successful.
Files=28, Tests=999,  2 wallclock secs ( 0.12 usr  0.03 sys +  2.08 cusr  0.26 csys =  2.49 CPU)
Result: PASS

But travis says they aren't

@phsm
Copy link
Contributor Author

phsm commented May 15, 2019

Fixed tests (didn't know that the dump should be also committed), now the build passes

@glensc
Copy link
Owner

glensc commented May 16, 2019

good work. thanks!

@glensc glensc merged commit af79652 into glensc:master May 16, 2019
@phsm phsm deleted the fixing-hpacucli-cachefail-bbulearn branch May 17, 2019 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants