陳俊勇:配置nagios郵件報警、
Nagios配置郵件報警
安裝郵件服務
[root@juny-10 ~]# yum install sendmail mailx -y
啟動郵件服務
[root@juny-10 ~]# systemctl start sendmail
設置開機啟動
[root@juny-10 ~]# systemctl enable sendmail
測試服務發送郵件
用下面這條命令發郵件看看能不能成功
[root@juny-10 ~]# echo "Test nagios" | mail -s "Nagios" [email protected]
可以看到郵件發送成功
設置nagios報警發郵件
修改nagios的主配置文件
[root@juny-10 ~]# vim /usr/local/nagios/etc/nagios.cfg
如果是0修改為1如果是1就不用修改了
修改nagios的配置郵箱賬號的配置文件
[root@juny-10 ~]# vim /usr/local/nagios/etc/objects/contacts.cfg
把框出來的地方寫成自己的郵箱
重啟nagios服務
[root@juny-10 ~]# systemctl restart nagios
郵件測試
停掉nsf服務測試、
[root@juny-10 ~]# systemctl stop nfs
在監控端看到NFS已經停止了
測試停止外部服務
停止mysql服務看看
[root@juny-18 ~]# systemctl stop mysqld
查看郵件
郵件配置結束
每天一篇總有你用得到的
下次介紹nagios監控Windows
相關推薦
推薦中...