[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_ntp.pl,1.11,1.12

Subhendu Ghosh sghosh at users.sourceforge.net
Mon Feb 3 21:55:05 CET 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv13767

Modified Files:
	check_ntp.pl 
Log Message:
corrected ntpdate offset to seconds

Index: check_ntp.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ntp.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** check_ntp.pl	3 Feb 2003 20:29:55 -0000	1.11
--- check_ntp.pl	4 Feb 2003 05:54:39 -0000	1.12
***************
*** 53,57 ****
  # Added ntpdate check for stratum 16 desynch peer (James Fidell) Feb 03, 2003
  #
! 
  
  require 5.004;
--- 53,59 ----
  # 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;
***************
*** 72,80 ****
  $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; 
  
  Getopt::Long::Configure('bundling');
--- 74,83 ----
  $ENV{'ENV'}='';
  
! # 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');
***************
*** 292,298 ****
  	if (defined($offset) && abs($offset) > $ocrit) {
  		$state = $ERRORS{'CRITICAL'};
! 		$answer = "Jitter error and offset $offset msec > +/- $ocrit msec\n";
  	} elsif (defined($offset) && abs($offset) > $owarn) {
! 		$answer = "Jitter error and offset $offset msec > +/- $owarn msec\n";
  	} elsif (defined($jitter) && abs($jitter) > $jcrit) {
  		$answer = "Jitter error and jitter $jitter msec > +/- $jcrit msec\n";
--- 295,301 ----
  	if (defined($offset) && abs($offset) > $ocrit) {
  		$state = $ERRORS{'CRITICAL'};
! 		$answer = "Jitter error and offset $offset sec > +/- $ocrit sec\n";
  	} elsif (defined($offset) && abs($offset) > $owarn) {
! 		$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";
***************
*** 304,321 ****
  	if (abs($offset) > $ocrit) {
  		$state = $ERRORS{'CRITICAL'};
! 		$answer = "Offset $offset msec > +/- $ocrit msec, jitter $jitter msec\n";
  	} elsif (abs($jitter) > $jcrit ) {
  		$state = $ERRORS{'CRITICAL'};
! 		$answer = "Jitter $jitter msec> +/- $jcrit msec, offset $offset msec \n";
  	} elsif (abs($offset) > $owarn) {
  		$state = $ERRORS{'WARNING'};
! 		$answer = "Offset $offset msec > +/- $owarn msec, jitter $jitter msec\n";
  	} elsif (abs($jitter) > $jwarn ) {
  		$state = $ERRORS{'WARNING'};
! 		$answer = "Jitter $jitter msec> +/- $jwarn msec, offset $offset msec \n";
  
  	} else {
  		$state = $ERRORS{'OK'};
! 		$answer = "Offset $offset msecs, jitter $jitter msec\n";
  	}
  	
--- 307,324 ----
  	if (abs($offset) > $ocrit) {
  		$state = $ERRORS{'CRITICAL'};
! 		$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 sec \n";
  	} elsif (abs($offset) > $owarn) {
  		$state = $ERRORS{'WARNING'};
! 		$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 sec \n";
  
  	} else {
  		$state = $ERRORS{'OK'};
! 		$answer = "Offset $offset secs, jitter $jitter msec\n";
  	}
  	
***************
*** 352,358 ****
  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.
  -c (--critical) 
!      Clock offset in milliseconds 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.
--- 355,361 ----
  Checks the jitter/dispersion of clock signal between <host> and its sys.peer with ntpq\n
  -w ( --warning)
!      Clock offset in seconds at which a warning message will be generated.\n	Defaults to $DEFAULT_OFFSET_WARN.
  -c (--critical) 
!      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.





More information about the Commits mailing list