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

  1. Log in to the Ceph monitor host and create a Ceph key and keyring for Nagios.

    Example

    Copy to Clipboard Toggle word wrap
    [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.keyring

    Each plug-in will require authentication. Repeat this procedure for each host that contains a plug-in.

  2. Add a command for the check_ceph_health plug-in:

    Example

    Copy to Clipboard Toggle word wrap
    [root@host01 ~]# vi /usr/local/nagios/etc/nrpe.cfg

    Copy to Clipboard Toggle word wrap
    command[check_ceph_health]=/usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyring
  3. Enable and restart the nrpe service:

    Example

    Copy to Clipboard Toggle word wrap
    [root@host01 ~]# systemctl enable nrpe
    [root@host01 ~]# systemctl restart nrpe

    Repeat this procedure for each Ceph plug-in applicable to the host.

  4. Return to the Nagios Core server and define a check_nrpe command for the NRPE plug-in:

    Example

    Copy to Clipboard Toggle word wrap
    [root@nagios ~]# cd /usr/local/nagios/etc/objects
    [root@nagios objects]# vi commands.cfg

    Syntax

    Copy to Clipboard Toggle word wrap
    define command{
     command_name check_nrpe
     command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
    }

  5. On the Nagios Core server, edit the configuration file for the node and add a service for the Ceph plug-in.

    Example

    Copy to Clipboard Toggle word wrap
    [root@nagios objects]# vi /usr/local/nagios/etc/objects/host01.cfg

    Syntax

    Copy to Clipboard Toggle word wrap
    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

    Copy to Clipboard Toggle word wrap
    define service {
      use                   generic-service
      host_name             host01
      service_description   Ceph Health Check
      check_command         check_nrpe!check_ceph_health
    }

    Note

    The check_command setting uses check_nrpe! before the Ceph plug-in name. This tells NRPE to execute the check_ceph_health command on the remote node.

  6. Repeat this procedure for each plug-in applicable to the host.
  7. Restart the Nagios Core server:

    Example

    Copy to Clipboard Toggle word wrap
    [root@nagios ~]# systemctl restart nagios

  8. Before proceeding with additional configuration, ensure that the plug-ins are working on the Ceph host:

    Syntax

    Copy to Clipboard Toggle word wrap
    /usr/lib/nagios/plugins/check_ceph_health --id NAGIOS_USER --keyring /etc/ceph/client.nagios.keyring

    Example

    Copy to Clipboard Toggle word wrap
    [root@host01 ~]# /usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyring
    HEALTH OK

    Note

    The check_ceph_health plug-in performs the equivalent of the ceph health command.

Additional Resources

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.