Nagios报错notify-by-email解决

运维 系统运维
Nagios报错notify-by-email解决:Nagios是一个监视系统。Nagios能监视所指定的本地、远程主机服务,而且具备异常通知的功能。但是报错notify-by-email该如何解决呢?

  nagios报错notify-by-email解决

  报错:

  1.   Error: Service notification command ‘notify-by-email’ specified for contact ‘zhuzhu’ is not defined anywhere!  
  2.  
  3.   Error: Host notification command ‘host-notify-by-email’ specified for contact ‘zhuzhu’ is not defined anywhere!  
  4.  

  这两条报错证明在commands.cfg里没有定义这两条

  在commands.cfg里添加以下内容:

  1.   # ‘notify-host-by-email’ command definition  
  2.  
  3.   define command{  
  4.  
  5.   command_name host-notify-by-email  
  6.  
  7.   command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:  
  8.  
  9.   $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host A  
  10.  
  11.   lert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$  
  12.  
  13.   }  
  14.  
  15.   # ’service_notification_commands’ command definition  
  16.  
  17.   define command{  
  18.  
  19.   command_name notify-by-email  
  20.  
  21.   command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\  
  22.  
  23.   nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT  
  24.  
  25.   $” | /bin/mail -s “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$  
  26.  
  27.   }  
  28.  

  Nagios报错notify-by-email就解决了,不会报错啦!

【编辑推荐】

Nagios飞信linux短信报警脚本配置

Nagios安装记录

如何用Nagios监控远程系统

责任编辑:zhaolei 来源: nagiostutorial
相关推荐

2011-08-22 12:24:56

nagios

2011-03-31 16:45:39

Redhat配置nagios

2011-03-23 12:55:55

Nagios邮件

2011-03-22 16:31:27

Nagios

2010-05-31 12:38:48

Nagios中文

2011-08-24 17:06:42

NOTIFY中文man

2011-03-29 11:13:15

Zabbix配置Email

2011-10-10 09:21:28

Email

2013-04-11 13:32:06

CentOS 6.3Nagios

2011-03-21 15:35:01

Nagiosnagios-plug安装

2011-08-22 12:25:02

nagios

2011-03-31 16:05:18

Redhat配置nagios

2011-01-21 16:40:58

NagiosSendmail

2010-05-31 12:53:56

Nagios apac

2011-03-28 15:37:53

nagios作用

2011-03-23 13:44:23

配置Nagios系统

2011-03-21 11:14:22

LinuxNagios

2011-03-23 14:43:10

Nagiosnagios.cfg

2011-03-23 13:32:14

配置Nagios系统

2011-03-31 16:05:18

Redhat配置nagios
点赞
收藏

51CTO技术栈公众号