Chapter 4. Configuring the remote node on the Nagios Core server
Chapter 4. Configuring the remote node on the Nagios Core server Configure the Nagios Core server to be aware of the remote hosts. Prerequisites Root-level access to the remote node on the Nagios Core server. Internet access. Procedure Install the check_nrpe plug-in: Example Create a configuration for the remote host: Syntax Example Edit the configuration file and update the settings for the remote host: Syntax Example Syntax Replace LOCALHOST with the hostname of the remote host, and 127.0.0.1 with the IP address of the Ceph monitor host. Example Delete or comment out the Host Group definition: Example Change the file ownership to Nagios: Example Add a cfg_file= reference to the host01.cfg file in /usr/local/nagios/etc/nagios.cfg : Example Restart the Nagios server: Example Ensure that the make and install procedures worked and that there is connectivity between the Nagios Core server and the remote host containing NRPE: Syntax Replace HOSTNAME_OF_REMOTE_HOST with the IP address of the Ceph host to monitor. Example Verification The check should echo NRPE v4.0.3 if it is working correctly.
cd ~ wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz tar xvfz nrpe-4.0.3.tar.gz cd nrpe-4.0.3 ./configure make check_nrpe make install-plugin cd /usr/local/nagios/etc/objects cp localhost.cfg HOST_TO_ADD .cfg cd /usr/local/nagios/etc/objects cp localhost.cfg host01.cfg vi HOST_TO_ADD .cfg vi host01.cfg Define a host for the local machine define host { use linux-server ; Name of host template to use ; This host definition will inherit all variables that are defined ; in (or inherited by) the linux-server host template definition. host_name LOCALHOST alias LOCALHOST address 127.0.0.1 } Define a host for the local machine define host { use linux-server ; Name of host template to use ; This host definition will inherit all variables that are defined ; in (or inherited by) the linux-server host template definition. host_name host01 alias host01 address 10.10.128.69 } vi host01.cfg #define hostgroup { # hostgroup_name linux-servers ; The name of the hostgroup alias Linux Servers ; Long name of the group members localhost ; Comma separated list of hosts that belong to this group #} chown nagios:nagios host01.cfg vi /usr/local/nagios/etc/nagios.cfg cfg_file=/usr/local/nagios/etc/objects/host01.cfg systemctl restart nagios /usr/local/nagios/libexec/check_nrpe -H HOSTNAME_OF_REMOTE_HOST /usr/local/nagios/libexec/check_nrpe -H host01