No RAID status (remote) with check_raid script

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
HHawk
Posts: 3
Joined: Sat Jul 14, 2018 3:23 am

No RAID status (remote) with check_raid script

Post by HHawk »

Hi all,

Sorry if my question is really stupid / silly. I am new to Nagios and I have to set this up again from scratch as our in house technician (and close friend) recently passed away. I managed to get most things working, however I have some issues with the script called check_raid

I had some issues about missing certail Perl modules, but eventually managed to get those installed and working.

If I run the command locally on the monitored server, the script is working perfectly.
For example:

[Remote.Server]# sh /usr/lib64/nagios/plugins/check_raid.sh
OK: megacli:[Volumes(1): DISK0.0:Optimal; Devices(2): 01,02=Online]

However on the Nagios Core (4.4.3) server I don't get any output:
check_raid UNKNOWN - No active plugins (No RAID found)

My guess is that it's looking on the Nagios Core server locally. Which does not have a RAID config, hence the "No RAID found" message obviously.

I have looked at the check_raid.cfg example and applied the following (on the Nagios Core server):

/usr/local/nagios/etc/objects/commands.cfg

Code: Select all

define command {
        command_name    check_raid
        command_line    $USER1$/check_raid $ARG1$
        #command_line   $USER1$/check_raid $ARG1$ $HOSTADDRESS$
        #command_line   $USER1$/check_raid -H $HOSTADDRESS$ $ARG1$
}

/usr/local/nagios/etc/objects/vz_nodes.cfg

Code: Select all

define service{
        use                             generic-service         ; Name of service template to use
        hostgroup_name                  vz_nodes
        service_description             Check RAID
        check_command                   check_raid
        #check_command                  check_nrpe!check_raid -t 60
        #check_command                  check_nrpe!check_raid
        normal_check_interval           120
        retry_check_interval            5
        notification_interval           3600
}

/usr/local/nagios/etc/nrpe.cfg

Code: Select all

command[check_raid]=/usr/local/nagios/libexec/check_raid
#command[check_raid]=/usr/local/nagios/libexec/check_raid $HOSTADDRESS$
As you can see, I did actually try a lot of things, hence the hashtags. But none of it works.

Now I really have no clue what I am doing wrong. Maybe I did (probably) something wrong. But I have no clue where!

As mentioned above, running the command locally on the server which needs to be checked works without issues. But the issue is, is that it's not working correctly from the Nagios Core server.

The plugin is located on the remote server in the folder: /usr/lib64/nagios/plugins/
And on the Nagios Core Server it's located in folder: /usr/local/nagios/libexec/

Sidenote; since I was missing quite a few Perl modules, I used a method I digged up somewhere. I used the following:

Code: Select all

yum install perl-core -y
curl -L https://cpanmin.us | perl - App::cpanminus
/usr/local/bin/cpanm Monitoring/Plugin.pm
/usr/local/bin/cpanm ExtUtils/MakeMaker/CPANfile.pm
/usr/local/bin/cpanm Module::Pluggable
Is this all really needed? Isn't there a better way? Our main servers are all based on CentOS 7.x.
So I have to do the above for every server in advance, right?

Thank you kindly in advance! I hope someone can shed some light on this. Probably it's something dumb/simple. Sorry.

Regards,
HHawk
HHawk
Posts: 3
Joined: Sat Jul 14, 2018 3:23 am

Re: No RAID status (remote) with check_raid script

Post by HHawk »

Wel I am going crazy! Been busy to get this plugin working.

Re-did the setup many times now. Even on a different server.
With all the exact same result:

Code: Select all

[Nagios.Server ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.0.100 -c check_raid
CRITICAL: megacli:[Volumes(0): ; Devices(0): ]

Code: Select all

[Remote.Server ~]# /usr/lib64/nagios/plugins/check_nrpe -H 127.0.0.1 -c check_raid
CRITICAL: megacli:[Volumes(0): ; Devices(0): ]

But if I run the command locally on the remote server:

Code: Select all

[Remote.Server ~]# /usr/lib64/nagios/plugins/check_raid
OK: megacli:[Volumes(1): DISK0.0:Optimal; Devices(5): 04=Hotspare 00,01,02,03=Online]
I tried editing sudoers and what else. All without luck.
So far every other plugin I have installed or tried works (so far). For example the plugin "Check Linux Stats".

I have no clue what I am doing wrong or make this plugin actually work. Maybe it's simply time to give up on this plugin and use something else instead. However I rather not, as this seems the best RAID plugin for multiple RAID controllers...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No RAID status (remote) with check_raid script

Post by scottwilkerson »

My guess would be you need to add sudo to the command in nrpe.cfg on the remote server making it

Code: Select all

command[check_raid]=sudo /usr/lib64/nagios/plugins/check_raid
then restart nrpe
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
HHawk
Posts: 3
Joined: Sat Jul 14, 2018 3:23 am

Re: No RAID status (remote) with check_raid script

Post by HHawk »

I wish it was that easy, but I already tried that and it didn't work.

In the meantime, still trying everything obvious, I downloaded a different RAID script, called: check_megaraid_sas

Installed it and similar result. Sigh.

On the remote server:

Code: Select all

./check_megaraid_sas
OK: 0:0:RAID-1:2 drives:223.062GB:Optimal Drives:2
On the Nagios server:

Code: Select all

sudo /usr/local/nagios/libexec/check_nrpe -H 192.168.0.110 -c check_megaraid_sas
OK: Drives:0
I really have no clue what I am doing wrong here... Both scripts use (on these servers) MegaCli. I don't know if that's important...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No RAID status (remote) with check_raid script

Post by scottwilkerson »

HHawk wrote:I wish it was that easy, but I already tried that and it didn't work.
When you say it didn't work, what output did you get?

What lines do you have in your sudoers file on the REMOTE system for /usr/lib64/nagios/plugins/check_raid ?

Please also attach your nrpe.cfg from the REMOTE system

Also, on the remote system run the following in order and show the output

Code: Select all

su nagios
/usr/lib64/nagios/plugins/check_raid
sudo /usr/lib64/nagios/plugins/check_raid
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked