Nagios通过Clickatell通过短信提醒进行监控

我试图configurationNagios 3通过使用check_http命令search某个string通过HTTP监视服务器,如下所示。

 define command { command_name check_http-mysite command_line /usr/lib/nagios/plugins/check_http -H mysite.example.com -s "Some text" } 

我testing一个特定string的HTTP检查工作正常。 我一直试图通过使用Clickatell SMTP API来configuration电子邮件到SMS的通知失败。 我怎样才能使它工作?

我已经遇到了一个调整 – Nagios短信的例子,虽然我似乎错过了一些东西。

编辑:
我想我以前的解释是非常模糊的。 我试图监视一个Web服务器的方式,我想通过HTTP在页面上search特定的string。 该命令在command.cfg中定义如下

  # 'check_http-mysite command definition' define command { command_name check_http-mysite command_line /usr/lib/nagios/plugins/check_http -H mysite.example.com -s "Some text" } # 'notify-host-by-sms' command definition define command { command_name notify-host-by-sms command_line /usr/bin/send_sms $CONTACTPAGER$ "Nagios - $NOTIFICATIONTYPE$ :Host$HOSTALIAS$ is $HOSTSTATE$ ($OUTPUT$)" } # 'notify-service-by-sms' command definition define command { command_name notify-service-by-sms command_line /usr/bin/send_sms $CONTACTPAGER$ "Nagios - $NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)" } 

现在,如果Nagios在主页mysite.example.com上找不到“Some text”,那么Nagios应该通过mysite.example.com HTTP API通过SMS通知一个联系人,我有一个testing过的脚本,发现它工作正常。

每当我改变命令定义来search一个不在页面上的string,并重新启动Nagios时,我可以看到Web界面上没有findstring。 我不明白的是为什么不是通知发送,虽然我已经定义了主机主机组联系人联系人组服务等等。 我错过了,这是我的定义,

host.cfg

 define host { use generic-host host_name HAL alias IBM-1 address xxx.xxx.xxx.xxx check_command check_http-mysite } 

hostgroups_nagios2.cfg

 # my website define hostgroup{ hostgroup_name my-servers alias All My Servers members HAL } 

contacts_nagios2.cfg

 define contact { contact_name colin alias Colin Y 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,notify-service-by-sms host_notification_commands notify-host-by-email,notify-host-by-sms email [email protected] pager +254xxxxxxxxx } define contactgroup { contactgroup_name site_admin alias Site Administrator members colin } 

services_nagios2.cfg

 # Check for particular string in page via HTTP. define service { hostgroup_name my-servers service_description STRING CHECK check_command check_http-mysite use generic-service notification_interval 0 ; Set > 0 if you want to be renotified. contacts colin contact_groups site_admin } 

我希望这个时候我已经解释了我的问题:-)

  1. 从命令行运行/usr/bin/send_sms以确保Clickatell正常工作。
  2. 看看nagios.log或者/var/log/messages ,看看你有没有在Web UI上find“string”的时候发现 nagios: SERVICE NOTIFICATION