Skip to content

No remote servers RAID status: check_raid UNKNOWN #194

@HHawk

Description

@HHawk

Hi glensc!

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 your script.

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, your 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 your check_raid.cfg example and applied the following (on the Nagios Core server):

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

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

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

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.

Your 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 the method you described in a very old reply here. I used the following:

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?

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

Regards,
HHawk

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions