nagios系统中sendmail的配置方法
思韵闪耀
2013-03-18
0
以下为自己安装测试过的,如果有问题,大家一起讨论

 系统环境:centos6.2 64位 最小化安装

一 安装nagios
见附件:nagios官方文档(nagios_nrpe20120929_web.pdf)

二 安装配置sendmail
我用hotmail邮箱接收nagios报警邮件
yum install sendmail m4 mailx
vim /etc/mail/access
添加
Connect:http://www.hotmail.com          RELAY
Connect:192.168                         RELAY(不知道什么用处)
Connect:1.1.1                           RELAY(不知道什么用处)
Connect:nagios@localhost.localdomain    RELAY
保存后运行
makemap -v hash /etc/mail/access.db < /etc/mail/access
service sendmail restart
测试sendmail
echo 123 | mail -s test1 ***@hotmail.com(我的邮箱)
echo 456 | sendmail -v ***@hotmail.com(我的邮箱)
两封邮件都收到了

三 整合nagios和sendmail
修改/usr/local/nagios/etc/objects/contacts.cfg
define contact{
        contact_name                    nagiosadmin
        use           generic-contact
        alias         Nagios Admin
        email         ***@hotmail.com(我的邮箱) 
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r,f,s
        host_notification_options       d,u,r,f,s
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        host_notifications_enabled      1
        service_notifications_enabled   1
        }
define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 nagiosadmin
        }

重启nagios
service nagios restart

至此配置结束

我这样配置后,可以收到nagios发来的报警邮件。这只是个粗略配置,具体细节还在学习中。


【版权声明】
本站部分内容来源于互联网,本站不拥有所有权,不承担相关法律责任。如果发现本站有侵权的内容,欢迎发送邮件至masing@13sy.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

相关内容

centos stream...
1、更新系统软件包确保系统已经更新到最新版本,打开终端,执行以下命...
2024-03-30
linux(centos7...
linux(centos7)firewalld-cmd查看防火墙状...
2024-03-15
centos7 firew...
1. firewalld1.1 firewalld守护进程fire...
2024-03-15
Centos系统firew...
端口放行限制1)放开UDP 161/162端口firewall-c...
2024-03-02
centos7 firew...
名词解释 在具体介绍zone之前学生先给大家介绍几个相关的名词,因...
2023-12-22
CentOS Stream...
操作系统:CentOS Stream 9 无界面最小化安装SSH工...
2023-12-22

热门资讯

Discus X论坛配置sen... Discuz x2.5 后台邮件设置方法其实和X2/x1.5基本一样,但很多同学都不注意一些细节,比...
redhat Linux系统配... 1 .检查Send Mail 的安装包 [root@sql root]# rpm -qa | gre...
使用Sendmail的反垃圾邮... 在最近几年,无处不在的垃圾邮件已使得所有邮件箱不堪重负,不断地需要工具以抗击这一无穷尽的垃圾邮件流。...