[Nagiosplug-devel] pure-c check_ntp

sean finney seanius at seanius.net
Sat Mar 18 11:21:00 CET 2006


hey guys,

after having spent far too much time learning about the idiosyncracies
of ntp, i've committed an initial version of check_ntp.c into CVS HEAD.

because it's not yet complete, i haven't patched the makefiles to build it
just yet (patch is attached for those who want to play along from home).

what still needs to be done to make it fully compatible with
the current perl version:

- ntpdate sends 4 requests and averages the offsets
- ipv6 support
- jitter support
- i *think* that when a hostname resolves to multiple addresses
  ntpdate/ntpq sends a request to each one.

bill: of these, i could really, really use help with calculating the
jitter as i don't really understand how it's calculated in the first
place.  the rest is fairly trivial to add in, though the multiple hostname
thing might be better generalized into our networking library.

i've done my best to comment up the code so that contributers
don't have to spend as much time reading rfc1305 as i have, but
let me know if you have any questions.


thanks,
	sean

-------------- next part --------------
diff -u -r1.64 Makefile.am
--- Makefile.am	17 Mar 2006 14:07:34 -0000	1.64
+++ Makefile.am	18 Mar 2006 18:53:19 -0000
@@ -14,7 +14,7 @@
 AM_CFLAGS = -Wall
 
 libexec_PROGRAMS = check_disk check_dummy check_http check_load \
-	check_mrtg check_mrtgtraf check_nwstat check_overcr check_ping \
+	check_mrtg check_mrtgtraf check_ntp check_nwstat check_overcr check_ping \
 	check_real check_smtp check_ssh check_tcp check_time \
 	check_udp check_ups check_users negate \
 	urlize @EXTRAS@
@@ -69,6 +69,7 @@
 check_mysql_query_LDADD = $(NETLIBS) $(MYSQLLIBS)
 check_nagios_LDADD = $(BASEOBJS) runcmd.o
 check_nt_LDADD = $(NETLIBS) 
+check_ntp_LDADD = $(NETLIBS) $(MATHLIBS)
 check_nwstat_LDADD = $(NETLIBS)
 check_overcr_LDADD = $(NETLIBS)
 check_pgsql_LDADD = $(NETLIBS) $(PGLIBS)
@@ -107,6 +108,7 @@
 check_mysql_query_DEPENDENCIES = check_mysql_query.c $(NETOBJS) $(DEPLIBS)
 check_nagios_DEPENDENCIES = check_nagios.c $(BASEOBJS) runcmd.o $(DEPLIBS)
 check_nt_DEPENDENCIES = check_nt.c $(NETOBJS) $(DEPLIBS)
+check_ntp_DEPENDENCIES = check_ntp.c $(NETOBJS) $(DEPLIBS)
 check_nwstat_DEPENDENCIES = check_nwstat.c $(NETOBJS) $(DEPLIBS)
 check_overcr_DEPENDENCIES = check_overcr.c $(NETOBJS) $(DEPLIBS)
 check_pgsql_DEPENDENCIES = check_pgsql.c $(NETOBJS)  $(DEPLIBS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20060318/812c62c8/attachment.sig>


More information about the Devel mailing list