i am not good either. anyway, this is my testing.
[root@ve1023:Active] config b monitor ntp_mon list
monitor ntp_mon {
defaults from external
run "ntp_mon.pl"
}
[root@ve1023:Active] config ls -l /config/monitors/
total 19
-rwxr-xr-x 1 root root 3006 Sep 30 00:33 arg_example
lrwxrwxrwx 1 root root 19 Sep 30 01:01 builtins -> /usr/share/monitors
drwxr-xr-x 3 root root 1024 Feb 9 02:43 CPAN
-rwxr-xr-x 1 root root 3145 Feb 9 04:16 ntp_mon.pl
-rwxr-xr-x 1 root root 1454 Sep 30 00:33 sample_monitor
-rwxr-xr-x 1 root root 2252 Nov 14 22:59 testmonitor.sh
in ntp_mon.pl, i added the $node line since it is noted in external monitor wiki.
my $node = $ENV{"NODE_IP"};
$node =~ s/::ffff://;
my $port = $ENV{"NODE_PORT"};
External Monitor wiki
http://devcentral.f5.com/wiki/AdvDesignConfig.ExternalMonitor.ashx
also, i modified condition to mark pool member down if its stratum is 11.
if ($response{'Stratum'} =~ /\d+/) {
if the stratum is a number
if ($response{'Stratum'} == 11) {
return 0;
} else {
and it isn't 11
return 1;
}
} else {
return 0;
}
i set up 3 pool members. ntpd is running on 192.168.11.168 and 200.200.200.101 only. anyway, 200.200.200.101 stratum is 10. so, 200.200.200.101 and 200.200.200.102 will be marked down by the monitor.
[root@ve1023:Active] config b pool ntp_pool list
pool ntp_pool {
monitor all ntp_mon
members {
192.168.11.168:123 {}
200.200.200.101:123 {}
200.200.200.102:123 {}
}
}
[root@ve1023:Active] config b pool ntp_pool|grep -i pool\ member
+-> POOL MEMBER ntp_pool/192.168.11.168:123 active,up
+-> POOL MEMBER ntp_pool/200.200.200.101:123 inactive,down
+-> POOL MEMBER ntp_pool/200.200.200.102:123 inactive,down