OK: Drives:0

Tested and works correctly. Thanks!

Just one thing for people testing it, if it appears the following message in your nagios:
OK: Drives:0

Just check two things:
1. In /etc/sudoers you have this line:
nagios ALL=NOPASSWD:/usr/sbin/megacli

2. You are executing this script with the –sudo option.
Your nrpe config file ( /usr/local/nagios/libexec/nrpe.c ) should has something like:
command[check_megaraid_sas]=/usr/local/nagios/libexec/check_megaraid_sas –sudo