监测 Nagios 通过短信警报 Clickatell
我正在尝试配置
http://en.wikipedia.org/wiki/Nagios
3 通过监视服务器 HTTP 通过搜索特定字符串
命令如下。
查看 HTTP 对于特定的字符串,在检查它后它可以正常工作。 我试图配置电子邮件通知 SMS 通过
http://www.clickatell.com/
SMTP API. 如何使它工作?
我找到了一个例子
http://www.techadre.com/conten ... aging
, 虽然我似乎错过了什么。
编辑:
我认为我的解释曾经是模糊的。 我正在尝试以这样的方式控制Web服务器,以便通过以下方式搜索页面上的特定字符串 HTTP. 该团队定义为 command.cfg 通过以下方式
现在,如果 Nagios 在主页上找不到“某些文本”
, Nagios 必须通知联系 SMS 穿过 HTTP API Clickatell, 我有一个我测试的脚本,发现它正常工作正常。
每次我更改命令的定义以搜索一个字符串,它不是页面上的字符串,并重新启动 Nagios, 我在找不到字符串的Web界面中看到。 我不明白为什么不发送通知,虽然我定义了
掌握
,
一群寄宿人
,
接触
,
联络小组
,
服务
等等。 我想念的是我的定义,
host.cfg
hostgroups_nagios2.cfg
contacts_nagios2.cfg
services_nagios2.cfg
我希望这次我清楚地解释了我的问题 :-)
http://en.wikipedia.org/wiki/Nagios
3 通过监视服务器 HTTP 通过搜索特定字符串
check_http
命令如下。
define command {
command_name check_http-mysite
command_line /usr/lib/nagios/plugins/check_http -H mysite.example.com -s "Some text" }
查看 HTTP 对于特定的字符串,在检查它后它可以正常工作。 我试图配置电子邮件通知 SMS 通过
http://www.clickatell.com/
SMTP API. 如何使它工作?
我找到了一个例子
http://www.techadre.com/conten ... aging
, 虽然我似乎错过了什么。
编辑:
我认为我的解释曾经是模糊的。 我正在尝试以这样的方式控制Web服务器,以便通过以下方式搜索页面上的特定字符串 HTTP. 该团队定义为 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
, Nagios 必须通知联系 SMS 穿过 HTTP API Clickatell, 我有一个我测试的脚本,发现它正常工作正常。
每次我更改命令的定义以搜索一个字符串,它不是页面上的字符串,并重新启动 Nagios, 我在找不到字符串的Web界面中看到。 我不明白为什么不发送通知,虽然我定义了
掌握
,
一群寄宿人
,
接触
,
联络小组
,
服务
等等。 我想念的是我的定义,
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 myaccount@mysite.com
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 个回复
涵秋
赞同来自:
从命令行确保 Clickatell 在职的。
看着
或者
看看你有什么
每当你有的时候
"找不到字符串"
在Web界面中。