MON监控软件求救
我启动LVS后。一切正常。我再启动MON监控软件。用虚拟IP不能正常访问lvs.alert文件的配置如下:
use Getopt::Std;
getopts ("s:g:h:t:l:V:R:W:F:u"
$ipvsadm = "/sbin/ipvsadm";
$protocol = $opt_P;
$virtual_service = $opt_V;
$remote = $opt_R;
if ($opt_u) {
$weight = $opt_W;
if ($opt_F eq "nat" {
$forwarding = "-m";
} elsif ($opt_F eq "tun" {
$forwarding = "-i";
} else {
$forwarding = "-g";
}
if ($protocol eq "tcp" {
system("$ipvsadm -a -t $virtual_service -r $remote -w $weight $forwarding"
} else {
system("$ipvsadm -a -u $virtual_service -r $remote -w $weight $forwarding"
}
} else {
if ($protocol eq "tcp" {
system("$ipvsadm -d -t $virtual_service -r $remote"
} else {
system("$ipvsadm -d -u $virtual_service -r $remote"
}
};
mon.cf配置文件如下:
cfbasedir = /etc/mon
alertdir = /usr/lib/mon/alert.d
mondir = /usr/lib/mon/mon.d
maxprocs = 20
histlength = 100
randstart = 30s
#
# group definitions (hostnames or IP addresses)
#
hostgroup web 192.168.0.221
hostgroup web1 192.168.0.224
#
# Web server 1
#
watch web
service http
interval 10s
monitor http.monitor
period wd {Sun-Sat}
alert mail.alert wensong
upalert mail.alert wensong
alert lvs.alert -P tcp -V 192.168.0.100:80 -R 192.168.0.221 -W 5 -F dr
upalert lvs.alert -P tcp -V 192.168.0.100:80 -R 192.168.0.221 -W 5 -F dr
#
# Web server 2
#
watch web1
service http
interval 10s
monitor http.monitor
period wd {Sun-Sat}
alert mail.alert wensong
upalert mail.alert wensong
alert lvs.alert -P tcp -V 192.168.0.100:80 -R 192.168.0.224 -W 5 -F dr
upalert lvs.alert -P tcp -V 192.168.0.100:80 -R 192.168.0.224 -W 5 -F dr
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最近也在学习这些,楼主能不能先分享一下安装过程啊