summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c6bec5)
raw | patch | inline | side by side (parent: 3c6bec5)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Tue, 4 Feb 2003 05:54:39 +0000 (05:54 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Tue, 4 Feb 2003 05:54:39 +0000 (05:54 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@286 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_ntp.pl | patch | blob | history |
index 5a3c44d2b10c0716f5ffb313ece7705c3dada907..2215fbd3df2e3f20038f83a21ddd4b7ac3581528 100755 (executable)
#
# Added ntpdate check for stratum 16 desynch peer (James Fidell) Feb 03, 2003
#
-
+# ntpdate - offset is in seconds
+# changed ntpdc to ntpq - jitter/dispersion is in milliseconds
+#
require 5.004;
use POSIX;
$ENV{'BASH_ENV'}='';
$ENV{'ENV'}='';
-# defaults in millisec
-my $DEFAULT_OFFSET_WARN = 60000;
-my $DEFAULT_OFFSET_CRIT = 120000;
-my $DEFAULT_JITTER_WARN = 5000;
-my $DEFAULT_JITTER_CRIT = 10000;
+# defaults in sec
+my $DEFAULT_OFFSET_WARN = 60; # 1 minute
+my $DEFAULT_OFFSET_CRIT = 120; # 2 minutes
+# default in millisec
+my $DEFAULT_JITTER_WARN = 5000; # 5 sec
+my $DEFAULT_JITTER_CRIT = 10000; # 10 sec
Getopt::Long::Configure('bundling');
GetOptions
$answer = "Jitter $jitter too high\n";
if (defined($offset) && abs($offset) > $ocrit) {
$state = $ERRORS{'CRITICAL'};
- $answer = "Jitter error and offset $offset msec > +/- $ocrit msec\n";
+ $answer = "Jitter error and offset $offset sec > +/- $ocrit sec\n";
} elsif (defined($offset) && abs($offset) > $owarn) {
- $answer = "Jitter error and offset $offset msec > +/- $owarn msec\n";
+ $answer = "Jitter error and offset $offset sec > +/- $owarn sec\n";
} elsif (defined($jitter) && abs($jitter) > $jcrit) {
$answer = "Jitter error and jitter $jitter msec > +/- $jcrit msec\n";
} elsif (defined($jitter) && abs($jitter) > $jwarn) {
} else { # no errors from ntpdate or ntpq
if (abs($offset) > $ocrit) {
$state = $ERRORS{'CRITICAL'};
- $answer = "Offset $offset msec > +/- $ocrit msec, jitter $jitter msec\n";
+ $answer = "Offset $offset msec > +/- $ocrit sec, jitter $jitter msec\n";
} elsif (abs($jitter) > $jcrit ) {
$state = $ERRORS{'CRITICAL'};
- $answer = "Jitter $jitter msec> +/- $jcrit msec, offset $offset msec \n";
+ $answer = "Jitter $jitter msec> +/- $jcrit msec, offset $offset sec \n";
} elsif (abs($offset) > $owarn) {
$state = $ERRORS{'WARNING'};
- $answer = "Offset $offset msec > +/- $owarn msec, jitter $jitter msec\n";
+ $answer = "Offset $offset msec > +/- $owarn sec, jitter $jitter msec\n";
} elsif (abs($jitter) > $jwarn ) {
$state = $ERRORS{'WARNING'};
- $answer = "Jitter $jitter msec> +/- $jwarn msec, offset $offset msec \n";
+ $answer = "Jitter $jitter msec> +/- $jwarn msec, offset $offset sec \n";
} else {
$state = $ERRORS{'OK'};
- $answer = "Offset $offset msecs, jitter $jitter msec\n";
+ $answer = "Offset $offset secs, jitter $jitter msec\n";
}
# else { # no offset defined
Checks the local timestamp offset versus <host> with ntpdate
Checks the jitter/dispersion of clock signal between <host> and its sys.peer with ntpq\n
-w ( --warning)
- Clock offset in milliseconds at which a warning message will be generated.\n Defaults to $DEFAULT_OFFSET_WARN.
+ Clock offset in seconds at which a warning message will be generated.\n Defaults to $DEFAULT_OFFSET_WARN.
-c (--critical)
- Clock offset in milliseconds at which a critical message will be generated.\n Defaults to $DEFAULT_OFFSET_CRIT.
+ Clock offset in seconds at which a critical message will be generated.\n Defaults to $DEFAULT_OFFSET_CRIT.
-j (--jwarn)
Clock jitter in milliseconds at which a warning message will be generated.\n Defaults to $DEFAULT_JITTER_WARN.
-k (--jcrit)