- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想设置 nagios 来发送电子邮件通知。
我可以通过单击 nagios Web 界面中的“发送自定义服务通知”手动发送电子邮件通知。正在创建通知,并且正在成功发送和发送电子邮件。
但是 nagios 不会自动发送通知。我已经测试过它关闭了机器上的 PING 服务(echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all)。 Nagios 将 PING 服务设置为 CRITICAL 状态,但不发送通知电子邮件。
这些是我的配置文件:
templates.cfg 的一部分
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
email MY-EMAIL@gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
define host{
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-host-alive
max_check_attempts 10
notification_interval 1
notification_period 24x7
notification_options d,u,r,f,s
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_interval 1 ; Only send notifications on status change by default.
is_volatile 0
check_period 24x7
normal_check_interval 5
retry_check_interval 1
max_check_attempts 4
notification_period 24x7
notification_options w,u,c,r,f,s
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
最佳答案
我有一个类似的问题。结果是两个问题的结合:
1) 我等待警报的时间不够长。将服务的 normal_check_interval 和 retry_check_interval*max_check_attempts 相加,您会发现必须等待 9 分钟才能收到通知。如果您必须更快地了解服务的故障,请减少 normal_check_interval 和 max_check_attempts。请注意,使用默认的 Nagios 配置,它可能需要 15 分钟才能通知您。
2) linux-server 的默认配置是在工作时间通知你,但有问题的服务器是 UTC。确保任何地方的 notification_period 变量都是 24x7。
祝你好运。
关于email - Nagios 不发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18361435/
我有一个 postfix 电子邮件服务器,有一个问题我想调试。 我如何配置它以将每封电子邮件的副本发送到我的电子邮件(除了将电子邮件发送给其预期收件人)。 最佳答案 我最近开始工作了,所以尽管我会分享
我的 Web 应用程序发送电子邮件的频率相当高,它发送 3 种电子邮件:由用户发起、响应系统中的事件以及自动响应应用程序收到的电子邮件。 我想确保第三种类型的电子邮件不会陷入自动回复器相互交谈的无限循
我家里有一台电脑,但我无法在工作中使用它。我希望能够查看我的家用计算机生成的工作结果。我想出的最好的主意是在我的家用计算机上运行一个自动脚本,它在完成后通过电子邮件将结果(来自文本文件或 stderr
我在 Google App Engine 上编写了一个应用程序,可以将电子邮件发送到一个地址。应用程序在测试期间达到了它的“通过电子邮件发送的收件人”配额限制。对于“已发送电子邮件的收件人”配额,是否
我的代码循环发送多封带附件的电子邮件, 问题是最后(之前的所有)电子邮件的附件附加到下一封电子邮件。 例如。假设数据库中有 3 封电子邮件,每封邮件有 1 个附件(a1.pdf、a2.pdf、a3.p
我的应用程序使用电子邮件通知我重要事件。它通过将电子邮件发送到我的电子邮件地址(标记为应用程序的所有者)来这样做(使用 Python 运行时)。 免费层允许每天向收件人发送 100 封电子邮件,但向管
我们在 VPS 上使用 exim。我们在 WP 和 Magento 上托管多个域。 最近,当我在 Received 标题中看到以下内容时,我正在查看一些电子邮件:我的 linux 用户名、服务器名(不
官方格式是什么 name 在电子邮件标题中?我需要先验证用户输入,然后再将其粘贴到标题中。 另外,您是否碰巧知道好的正则表达式来验证名称+电子邮件对的形式? 最佳答案 Enjoy. 在stackov
我在很多地方都看到过这种问题,但还没有找到真正的答案。 有谁知道如何使用 html.jelly 模板使构建日志显示在正文中,而不是全部一起运行并实际用换行符分隔每一行? 我很确定答案在于需要对模板进行
我正在使用 Jenkins 2.2 和 email-ext plugin 2.42(两者都是最新的,我的所有其他插件也是如此)。我将全局配置设置为具有单个显式收件人,并且我的项目使用默认电子邮件通知配
使用 symfony 框架如何从本地主机发送测试电子邮件? 最简单的方法是什么? 谢谢! 最佳答案 我认为最简单的方法(也是我通常做的)是配置 _dev 环境以使用旧版 Gmail(或任何其他提供商)
使用 symfony 框架如何从本地主机发送测试电子邮件? 最简单的方法是什么? 谢谢! 最佳答案 我认为最简单的方法(也是我通常做的)是配置 _dev 环境以使用旧版 Gmail(或任何其他提供商)
我正在使用 sendgrid 发送电子邮件。但是当我尝试按如下方式创建电子邮件对象时 let email = new sendgrid.Email(); email.addTo("rhushikesh
谷歌在这里不是很有帮助。我想用 :set spell 撰写电子邮件上,但对于所有其他文件,:set spell应该关闭。我正在使用 mutt 和 Vim 作为撰写电子邮件的编辑器。 事实上,我很好奇,
我目前在 Windows 7 中使用 Jenkins。 我最近在 jenkins 中运行了一些构建。我能够通过 SVN Post commit 运行构建。 现在我必须通过电子邮件在 Jenkins 中
到目前为止,我已经制作了一个带有登录/注册功能的应用程序,它运行良好。 注册后会发送欢迎电子邮件。 但是我想要做的是在该邮件中发送一个链接,只有在单击它后才能登录。 比如论坛常用的注册邮箱等。 有人可
我工作的公司为医疗保健行业提供测试服务。作为我们服务的一部分,我们需要向客户的员工发送电子邮件。通常,这些人是临时工、兼职人员或契约(Contract)工,因此拥有私有(private)电子邮件地址(
我正在尝试通过 Twitter API 找人。我使用这样的网址:https://api.twitter.com/1/users/search.json?q=some@email.com但是有一个问题。
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我正在使用名为 email-ext 的 Jenkins 插件我想让 Jenkins 发送一封由 html.jelly 生成的电子邮件位于 $JENKINS_HOME/email-templates 中
我是一名优秀的程序员,十分优秀!