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$
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
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