Chapter 5. Configuring the Nagios Plugins for Ceph
Configure the Nagios plug-ins for Red Hat Ceph Storage cluster.
Prerequisites
- Root-level access to the Ceph Monitor host and Nagios Core Server.
- A running Red Hat Ceph Storage cluster.
Procedure
Log in to the Ceph monitor host and create a Ceph key and keyring for Nagios.
Example
[root@nagios ~]# ssh user@host01 [user@host01 ~]$ sudo su - [root@host01 ~]# cd /etc/ceph [root@host01 ceph]# ceph auth get-or-create client.nagios mon 'allow r' > client.nagios.keyringEach plug-in will require authentication. Repeat this procedure for each host that contains a plug-in.
Add a command for the
check_ceph_healthplug-in:Example
[root@host01 ~]# vi /usr/local/nagios/etc/nrpe.cfgcommand[check_ceph_health]=/usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyringEnable and restart the
nrpeservice:Example
[root@host01 ~]# systemctl enable nrpe [root@host01 ~]# systemctl restart nrpeRepeat this procedure for each Ceph plug-in applicable to the host.
Return to the Nagios Core server and define a
check_nrpecommand for the NRPE plug-in:Example
[root@nagios ~]# cd /usr/local/nagios/etc/objects [root@nagios objects]# vi commands.cfgSyntax
define 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
[root@nagios objects]# vi /usr/local/nagios/etc/objects/host01.cfgSyntax
define service { use generic-service host_name HOSTNAME service_description Ceph Health Check check_command check_nrpe!check_ceph_health }Replace HOSTNAME with the hostname of the Ceph host you want to monitor.
Example
define service { use generic-service host_name host01 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 host.
Restart the Nagios Core server:
Example
[root@nagios ~]# systemctl restart nagiosBefore proceeding with additional configuration, ensure that the plug-ins are working on the Ceph host:
Syntax
/usr/lib/nagios/plugins/check_ceph_health --id NAGIOS_USER --keyring /etc/ceph/client.nagios.keyringExample
[root@host01 ~]# /usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyring HEALTH OKNoteThe
check_ceph_healthplug-in performs the equivalent of theceph healthcommand.
Additional Resources
- See Nagios plugins for Ceph for more information about Ceph Nagios plug-ins usage.