Nagios和NRPE监测软件的安装
操作步骤
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令在外网下载安装依赖包。
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
- 执行以下命令安装以上安装包。
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
- 执行以下命令在管理节点上安装Nagios。
yum install ohpc-nagios -y
- 执行以下命令在计算节点上安装NRPE。
yum install nagios-plugins-all-ohpc nrpe-ohpc -y
- 执行以下命令在计算节点上使能和配置NRPE。
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
192.168.47.111是Nagios服务端的IP地址。
- 执行以下命令在计算节点上配置Remote Services。
mv /etc/nagios/conf.d/services.cfg.example /etc/nagios/conf.d/services.cfg
- 执行以下命令在服务端上配置计算节点的内容。
mv /etc/nagios/conf.d/hosts.cfg.example /etc/nagios/conf.d/hosts.cfg
- 执行以下命令在服务端上更新告警的邮件通知信息。
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
- 执行以下命令在服务端上设置webservice用户的密码。
htpasswd -bc /etc/nagios/passwd nagiosadmin huawei
- 执行以下命令在服务端上启动相关进程。
systemctl enable nagios.service systemctl start nagios.service chmod u+s `which ping` systemctl start httpd systemctl enable httpd
父主题: 资源监测软件安装