首页 文章

Nagios主机通知不通过电子邮件或日志记录发送

提问于
浏览
0

我正在用木偶重新做我们的nagios基础设施,但我目前停在一个看似简单的问题(很可能是配置问题) .

使用puppet,我在磁盘上吐出一些基本的nagios配置文件 . Nagios重新加载很好,一切看起来都不错,但是,当我标记主机时,它不会发送通知 .

nagios.log显示:

[1470699491] EXTERNAL COMMAND:PROCESS_HOST_CHECK_RESULT; divcont01; 1;测试通知[1470699491] PASSIVE HOST CHECK:divcont01; 1;测试通知[1470699491]主机警告:divcont01; DOWN; HARD; 1;测试通知

在 生产环境 中(我没有改变任何东西),我在nagios.log中看到(在用ui标记主机之后):

[1470678186]外部命令:PROCESS_HOST_CHECK_RESULT; PALTL12; 1;测试ey [1470678187]被动主机检查:PALTL12; 1;测试ey [1470678187]主机警告:PALTL12;向下;硬; 1;测试ey [1470678187]主机通知: pal_infra; PALTL12; DOWN; host-notify-by-pom; test ey [1470678187] HOST NOTIFICATION:pal_infra; PALTL12; DOWN; host-notify-by-email; test ey [1470678192] HOST ALERT:PALTL12; UP; HARD; 1; PING OK - 数据包丢失= 0%,RTA = 0.81 ms [1470678192]主机通知:pal_infra; PALTL12; UP;主机通知-POM; PING OK - 数据包丢失= 0%,RTA = 0.81 ms [1470678192主机通知:pal_infra; PALTL12; UP;主机通过电子邮件通知; PING OK - 数据包丢失= 0%,RTA = 0.81 ms

如日志中所示,在主机中的主机警报之后,会记录并直接发送主机通知 . 我已经详尽地比较了今天的配置文件,我找不到新配置停止通知的原因 .

我已经确认在顶级启用了通知 . 我已经验证可以从此框发送电子邮件(但是,我使用日志来验证功能,而不是电子邮件) . 我还尝试了其他多个谷歌建议(并将继续我的搜索) .

相关配置详情如下 . 请原谅我的配置的冗长和乏味的堆栈溢出格式 . 先感谢您 .

主机/ divcont01.cfg:

define host {address snip
host_name divcont01
使用generic-host-puppetized
}

主机模板/通用宿主puppetized.cfg:

define host {check_command check-host-alive
check_interval 1
contact_groups generic-contactgroup
checks_enabled 1
event_handler_enabled 0
flap_detection_enabled 0
name generic-host-puppetized
hostgroups generic-host-puppetized
max_check_attempts 4
notification_interval 4
notification_options d,u,r
notification_period 24x7
notifications_enabled 1
process_perf_data 0
注册0
retain_nonstatus_information 1
retain_status_information 1
}

hostgroups /通用宿主puppetized.cfg:

define hostgroup

contactgroups /仿制contactgroup.cfg

define contactgroup {contactgroup_name generic-contactgroup
成员泛化傀儡联系
}

联系人/仿制puppetized-contact.cfg

定义联系人{使用通用联系人
contact_name generic-puppetized-contact
电邮<我的电子邮件>
}

objects / templates.cfg(仅限generic-contact config)

定义联系人{使用我的电子邮件
name generic-contact;此联系人模板的名称
service_notification_period 24x7;服务通知可以随时发送
host_notification_period 24x7;主机通知可以随时发送
host_notification_commands generic-puppetized-contact-host-notify-by-email-low
service_notification_commands通过电子邮件通知,service-notify-by-pom
service_notification_options u,c,r,f;发送所有服务状态,扑动事件和计划停机事件的通知
host_notification_options d,r,f;发送所有主机状态,抖动事件和计划停机事件的通知

寄存器0;不要注册这个定义 - 它不是真正的联系,只是一个模板!
}

命令/仿制puppetized接触宿主通知 - 通过电子邮件,low.cfg:

define command {command_line /etc/nagios/global/scripts/nagios-mailx.sh -t my email -s“** notification Host Alert:hostname is hoststate ”-m“*** Nagios ***** Notification Type :通知类型主机:主机状态:hoststate地址:地址信息:输出日期/时间:日期“
command_name generic-puppetized-contact-host-notify-by-email-low
}

1 回答

  • 0

    想出来......我正在另一个预先存在的系统中构建我的系统(危险,我知道),我的联系人实际上指向一个禁用通知的通用联系人 .

    哎呀:)

相关问题