Jump to content
Welcome to our new Citrix community!

How can I monitor for NTP drift?

Recommended Posts

Hi everyone

Can someone please help me to configure monitoring for NTP drift?

We use SolarWinds for monitoring and it has a monitor for Unix via Perl script. It does not work for Netscaler though...

I saved the file as ntpdrift.pl file on Netscaler and it works if I run the following command:


>shell /tmp/ntpdrift.pl ntpdate

Message: NTP server, time offset 0.024 sec.
Statistic: 0.024


Cannot get the command policy right for the user to allow shell /tmp/ntpdrift.pl ntpdate

Keep getting "ERROR: Not authorized to execute this command [shell perl /tmp/ntpdrift.pl ntpdate]"

This is what I have in the command policy: (^shell perl /tmp/ntpdrift.pl ntpdate$



if ($ntpdate_cmd eq '') {
 print "Message: Can't find \"ntpdate_cmd\" argument.\n";
 exit 1;
if ($ntp_server eq '') {
 print "Message: Can't find \"ntp_server\" argument.\n";
 exit 1;
if (! -e $ntpdate_cmd) {
 print "Message: Can't find ntpdate command. Check if ntp package is installed or path to that ntpdate command.\n";
 exit 1;
$cmd=$ntpdate_cmd." -q ".$ntp_server;
$exit=`echo $?`;
if ($exit != 0) {
  print "Message: Error occured. Possibly wrong server argument. Try to run command locally: ntpdate -q your_server\n";
  exit 1;
if ($out[0] =~ ", offset ") {
  @str=split(" ",$out[0]);
  printf ("Message: NTP server %s time offset %.3f sec.\n",$serv,$off);
  printf ("Statistic: %.3f\n",$off);
  exit 0;




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...