我要评分
获取效率
正确性
完整性
易理解

Installing Nagios and NRPE

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following commands to download the dependencies from the external network:

    wget http://www.rpmfind.net/linux/fedora/linux/releases/32/Everything/aarch64/os/Packages/q/qstat-2.15-11.20200131gitd1469ab.fc32.aarch64.rpm

    wget http://www.rpmfind.net/linux/epel/7/aarch64/Packages/f/fping-3.10-4.el7.aarch64.rpm

    wget http://www.rpmfind.net/linux/epel/7/ppc64/Packages/p/python2-mock-1.0.1-10.el7.noarch.rpm

  3. Install the dependencies.

    yum install qstat-2.15-7.20150619gita60436.fc29.aarch64.rpm fping-3.10-4.el7.aarch64.rpm python2-mock-1.0.1-10.el7.noarch.rp

  4. Install Nagios on the management node.

    yum install ohpc-nagios -y

  5. Install NRPE on the compute node.

    yum install nagios-plugins-all-ohpc nrpe-ohpc -y

  6. Enable and configure NRPE on the compute node.

    systemctl enable nrpe

    perl -pi -e "s/^allowed_hosts=/# allowed_hosts=/" /etc/nagios/nrpe.cfg

    echo "nrpe 5666/tcp # NRPE" >> /etc/services

    echo "nrpe : 192.168.47.111 : ALLOW" >> /etc/hosts.allow

    echo "nrpe : ALL : DENY" >> /etc/hosts.allow

    /usr/sbin/useradd -c "NRPE user for the NRPE service" -d /var/run/nrpe -r -g nrpe -s /sbin/nologin nrpe

    /usr/sbin/groupadd -r nrpe

    In the command, 192.168.47.111 is the IP address of the Nagios server.

  7. Configure remote services on the compute node.

    mv /etc/nagios/conf.d/services.cfg.example /etc/nagios/conf.d/services.cfg

  8. Configure the compute node on the server.

    mv /etc/nagios/conf.d/hosts.cfg.example /etc/nagios/conf.d/hosts.cfg

  9. Update the alarm email notification information on the server.

    perl -pi -e "s/ \/bin\/mail/ \/usr\/bin\/mailx/g" /etc/nagios/objects/commands.cfg

    perl -pi -e "s/nagios\@localhost/root\@${sms_name}/" /etc/nagios/objects/contacts.cfg

  10. Set the password of the web service user on the server.

    htpasswd -bc /etc/nagios/passwd nagiosadmin huawei

  11. Start the processes on the server.

    systemctl enable nagios.service

    systemctl start nagios.service

    chmod u+s `which ping`

    systemctl start httpd

    systemctl enable httpd