I took a look at the web site you downloaded the plugin from and it says that is may require to be setup in the /etc/sudoers file so it can run as root.
In the plugin is in the /usr/local/nagios/libexec folder, you would have to add the following line to the /etc/sudoers file on the remote server.
Code: Select all
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_raid.pl
The the command definition in the nrpe.cfg file would have to be edited like the example below and then the NRPE agent would have to be restarted for the changes to take affect.
Code: Select all
command[check_raid.pl]=sudo /usr/local/nagios/libexec/check_raid.pl -p megacli
Try that out and see if that works for you.
If not, login to the remote server as root, change to the folder where the plugin is installed and run the following commands. Post the output.
Code: Select all
su nagios
./check_raid.pl -p megacli
That should tell you is the nagios used can run the plugin as that is the user account the NRPE Agent runs the commands as.
If it fails, post your /etc/sudoers file and the nrpe.cfg file from the remote server.