Kaynağa Gözat

check_uptime - now only supports linux, updated configure and make file

abrist 12 yıl önce
ebeveyn
işleme
c590421fb0
3 değiştirilmiş dosya ile 18 ekleme ve 4 silme
  1. 16 0
      configure.in
  2. 2 2
      plugins/Makefile.am
  3. 0 2
      plugins/check_uptime.c

+ 16 - 0
configure.in

@@ -347,6 +347,22 @@ if test "$FOUNDINCLUDE" = "yes" ; then
 	EXTRAS="$EXTRAS check_ide_smart"
 	EXTRAS="$EXTRAS check_ide_smart"
 fi
 fi
 
 
+dnl Check for headers used by check_uptime
+case $host in
+  *linux*)
+    AC_CHECK_HEADER(sys/time.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+    if test "$FOUNDINCLUDE" = "no" ; then
+	AC_MSG_WARN([Skipping check_uptime plugin.])
+	AC_MSG_WARN([check_uptime requires sys/time.h])
+    else
+        EXTRAS="$EXTRAS check_uptime"
+    fi
+  ;;
+  *)
+    AC_MSG_WARN([Skipping check_uptime plugin.])
+    AC_MSG_WARN([check_uptime works only on Linux])
+esac
+
 dnl Check for mysql libraries
 dnl Check for mysql libraries
 np_mysqlclient
 np_mysqlclient
 if test $with_mysql = "no" ; then
 if test $with_mysql = "no" ; then

+ 2 - 2
plugins/Makefile.am

@@ -28,7 +28,7 @@ MATHLIBS = @MATHLIBS@
 libexec_PROGRAMS = check_apt check_cluster check_disk check_dummy check_http check_load \
 libexec_PROGRAMS = check_apt check_cluster check_disk check_dummy check_http check_load \
 	check_mrtg check_mrtgtraf check_ntp check_ntp_peer check_nwstat check_overcr check_ping \
 	check_mrtg check_mrtgtraf check_ntp check_ntp_peer check_nwstat check_overcr check_ping \
 	check_real check_smtp check_ssh check_tcp check_time check_ntp_time \
 	check_real check_smtp check_ssh check_tcp check_time check_ntp_time \
-	check_ups check_users check_uptime negate \
+	check_ups check_users negate \
 	urlize @EXTRAS@
 	urlize @EXTRAS@
 
 
 check_tcp_programs = check_ftp check_imap check_nntp check_pop \
 check_tcp_programs = check_ftp check_imap check_nntp check_pop \
@@ -37,7 +37,7 @@ check_tcp_programs = check_ftp check_imap check_nntp check_pop \
 EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \
 EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \
 	check_swap check_fping check_ldap check_game check_dig \
 	check_swap check_fping check_ldap check_game check_dig \
 	check_nagios check_by_ssh check_dns check_nt check_ide_smart	\
 	check_nagios check_by_ssh check_dns check_nt check_ide_smart	\
-	check_procs check_mysql_query check_apt check_dbi
+	check_procs check_mysql_query check_apt check_dbi check_uptime
 
 
 EXTRA_DIST = t tests
 EXTRA_DIST = t tests
 
 

+ 0 - 2
plugins/check_uptime.c

@@ -103,7 +103,6 @@ int main (int argc, char **argv) {
 
 
 } // end main
 } // end main
 
 
-#ifdef HAVE_CLOCK_GETTIME
 int getuptime () {
 int getuptime () {
 
 
 	struct timespec t;
 	struct timespec t;
@@ -116,7 +115,6 @@ int getuptime () {
 	}
 	}
 
 
 } // end getuptime
 } // end getuptime
-#endif
 
 
 static int process_arguments (int argc, char **argv) {
 static int process_arguments (int argc, char **argv) {