Chapter 5. Configuring the Nagios Plugins for Ceph
Configure the Nagios plug-ins for Red Hat Ceph Storage cluster.
Prerequisites
- User-level access to the Ceph Monitor node.
- A running Red Hat Ceph Storage cluster.
- Access to the Nagios Core Server.
Procedure
Log in to the monitor server and create a Ceph key and keyring for Nagios.
[user@mon]# ssh mon [user@mon]# cd /etc/ceph [user@mon]# ceph auth get-or-create client.nagios mon 'allow r' > client.nagios.keyringEach plug-in will require authentication. Repeat this procedure for each node that contains a plug-in.
Add a command for the
check_ceph_healthplug-in:[user@mon]# vi /usr/local/nagios/etc/nrpe.cfgExample
command[check_ceph_health]=/usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyringEnable and restart the
nrpeservice:[user@mon]# systemctl enable nrpe [user@mon]# systemctl restart nrpeRepeat this procedure for each Ceph plug-in applicable to the node.
Return to the Nagios Core server and define a
check_nrpecommand for the NRPE plug-in:[user@nagios]# cd /usr/local/nagios/etc/objects [user@nagios]# vi commands.cfgdefine command{ command_name check_nrpe command_line USER1/check_nrpe -H HOSTADDRESS -c ARG1 }On the Nagios Core server, edit the configuration file for the node and add a service for the Ceph plug-in.
Example
[user@nagios]# vi /usr/local/nagios/etc/objects/mon.cfgdefine service { use generic-service host_name mon service_description Ceph Health Check check_command check_nrpe!check_ceph_health }NoteThe
check_commandsetting usescheck_nrpe!before the Ceph plug-in name. This tells NRPE to execute thecheck_ceph_healthcommand on the remote node.- Repeat this procedure for each plug-in applicable to the node.
Restart the Nagios Core server:
[user@nagios]# systemctl restart nagiosBefore proceeding with additional configuration, ensure that the plug-ins are working.
Example
[user@mon]# /usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyringNoteThe
check_ceph_healthplug-in performs the equivalent of theceph healthcommand.
Additional Resources
- See the Ceph Nagios plugins web page for usage.