After our upgrade a script that we had to monitor NTP stratum no longer works. Here is the error code:
Testing on node Test-Linux: failed with 'Undefined' status
| Invalid script return code: 127 |
Here is a copy of the script that we execute:
#!/usr/bin/perl
$grepstratum = `/usr/sbin/ntpq -c rv | grep -i stratum`;
chomp($current_time = `date`);
if ($grepstratum =~ m/stratum=(\d+)/) {
if ((0 < $1) && ($1 <= 9)) {
open (STDOUT);
print "0\n";
print "Statistic: $1\n";
print "Message: $current_time Stratum is $1\n";
close (STDOUT);
exit(0);
} else {
open (STDOUT);
print "1\n";
print "Statistic: $1\n";
print "Message: $current_time Stratum is $1\n";
close (STDOUT);
exit (1);
}
};
Nothing has changed except for the upgrade. Appreciate any responses. Thanks