我在设置nagios依赖项时遇到了困难,所以我只在主机启动时才会收到通知(可having )。
我的主机cfg文件如下:
# Configuration file /etc/nagios/adagios/hosts/dp-front.cfg
# Edited by PyNag on Wed Nov 11 16:38:15 2015
define host {
alias Ditmas Park Front Desk
use windows-server
host_name dp-front
address 192.168.200.47
max_check_attempts 2
check_command check-host-alive
check_period workhours
notification_period workhours
}
define service{
use generic-service
host_name dp-front
service_description Medical Records
check_command check_nt!PROCSTATE!-d SHOWALL -l Robocopy.exe
notification_interval 0
max_check_attempts 1
}
define servicedependency{
host_name localhost
service_description PING
dependent_host_name localhost
dependent_service_description PING
execution_failure_criteria c
notification_failure_criteria w,u,c
}
Nagios正在正确地监控服务,当服务关闭时,我会一直收到通知。我只是不确定如何设置它的“服务依赖”部分。
我将一如既往地感谢你的帮助。
发布于 2015-12-20 17:04:45
您可能需要在主机配置文件中设置参数以下
notification_options d u r
发布于 2016-01-20 15:28:25
Add to your host template 'windows-server'
a notification_option
选项
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectdefinitions.html
notification_options:此指令用于确定何时应发送主机的通知。有效选项是以下一项或多项的组合:d=在关闭状态下发送通知,u=在无法到达状态下发送通知,r=在恢复时发送通知(OK状态),f=在主机启动和停止摆动时发送通知,以及s=在计划的停机时间开始和结束时发送通知。如果您指定n(无)作为选项,则不会发送任何主机通知。如果您不指定任何通知选项,Nagios将假定您希望为所有可能的状态发送通知。示例:如果在此字段中指定d,r,则仅当主机关闭和从关闭状态恢复时才会发送通知。
https://stackoverflow.com/questions/34165104
复制相似问题