NTP Health CHECK

Hi ALL,

we have ntp server which map to pool. we have create VS for this pool. All network device pointed to this VS to sync the time. we want to configure Health check for these server

these server are windows server. Please suggest if you understant my problem

Thanks

A.N

have you seen these ones?

NTP Monitor by philh

http://devcentral.f5.com/wiki/AdvDesignConfig.NTP\_Monitor.ashx

About NTP healthcheck

http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/56/aft/1172057/showtab/groupforums/Default.aspx

Hi Nitass,

I checked it. but its kind of puzzle not able to understand.is there any simple way. Actually i am not good in script

Thanks

A.N

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

Hi Nitass

I have confusion with this part

my $node = $ENV{“NODE_IP”};

$node =~ s/::ffff://;

my $port = $ENV{“NODE_PORT”};

I have Three member in pool .My pool member 10.43.44.7 , 10.43.44.8 , 10.43.44.9. I have to define ALL three ip. At the place of NODE_IP.

HOW should i write for THESE IP OR NO NEED TO CHANGE ANY THIS . Will it take Dynamic from pool member

ONE More thing

if Any member down . Does it decrease Stratum VALUE

Thanks

Ankush

I have Three member in pool .My pool member 10.43.44.7 , 10.43.44.8 , 10.43.44.9. I have to define ALL three ip. At the place of NODE_IP. no. actually, i just wanted to show i added the second line ($node =~ …) in the script. the script will take ip and port from pool.

if Any member down . Does it decrease Stratum VALUE sorry i am not sure what you mean. each ntp server has its own stratum. i do not think one affects other when it is down.

One Last question Nitass

Please tell mean of 2 lines

my $node = $ENV --- What is of $ENV

if ($response{‘Stratum’} =~ /\d+/) --- what is mean of ~ /\d+/)

my $node = $ENV --- What is of $ENV it is environment variable.

Example: Using the %ENV Variable

if ($response{‘Stratum’} =~ /\d+/) --- what is mean of ~ /\d+/)it means digit character.

HI Nitass

I using this script

!/usr/bin/perl

my $node = $ENV{“NODE_IP”};

$node =~ s/::ffff://;

my $port = $ENV{“NODE_PORT”};

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;

}

When i use .\ntp_mon.pl to run this script .its give error line 15 " can not run subroutine"

ONE MORE THING.can you look below config

when i create external monitor using GUI. Monitors ---> External Monitor---->

1. name defining

2. External progamme ----> /config/monitors/ntp_mon.pl

Except this DO WE DEFINE ANY OTHER Variable column ???

IN LAST I BIND WITH POOL

Please check if any thing i am misssing

THANKS IN ADVANCE

2. External progamme ----> /config/monitors/ntp_mon.pl i think you do not need to put /config/monitors. only ntp_mon.pl could be fine.

Except this DO WE DEFINE ANY OTHER Variable column ??? only program name could be enough.

Nitass,

Here startum value 11 is ntp server value ? OR something else.

I applied this script with 2 stratum value because ntp serever have value 2. it saying node is Available. its working ?

How can I do more test to check its working

Here startum value 11 is ntp server value ?yes.

I applied this script with 2 stratum value because ntp serever have value 2. it saying node is Available. its working ?is it down if you shut down the ntp daemon?

Hi Nitass,

I can not shudown the NTP deemon. it is production. is there any other way to check

if i were you, i would create a new pool with member which does not have ntp daemon. then assign the monitor and see whether it is marked down or not.

Hi, Has anybody has any luck getting NTP monitoring working on 11.5 or 11.6? I’ve tried to follow this thread but no joy.

Thank you, Andrew