[Nagiosplug-checkins] CVS: nagiosplug/plugins check_nwstat.c,1.6,1.7

Ton Voon tonvoon at users.sourceforge.net
Wed May 14 14:52:06 CEST 2003


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

Modified Files:
	check_nwstat.c 
Log Message:
Added DSVER and UPTIME checks (Phil Randal - 737617)


Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** check_nwstat.c	27 Mar 2003 22:53:45 -0000	1.6
--- check_nwstat.c	14 May 2003 21:51:10 -0000	1.7
***************
*** 52,55 ****
--- 52,56 ----
       LRUM     = LRU sitting time in minutes\n\
       DSDB     = check to see if DS Database is open\n\
+      DSVER    = NDS version\n\
       LOGINS   = check to see if logins are enabled\n\
       UPRB     = used packet receive buffers\n\
***************
*** 68,71 ****
--- 69,73 ----
       DCB      = dirty cache buffers as a percentage of the total\n\
       TCB      = dirty cache buffers as a percentage of the original\n\
+      UPTIME   = server uptime\n\
  -w, --warning=INTEGER\n\
    Threshold which will result in a warning status\n\
***************
*** 124,127 ****
--- 126,131 ----
  #define CHECK_DCB           25 /* check dirty cache buffers as a percentage of the total */
  #define CHECK_TCB           26 /* check total cache buffers as a percentage of the original */
+ #define CHECK_DSVER         27 /* check NDS version */
+ #define CHECK_UPTIME        28 /* check server uptime */
  
  #define PORT 9999
***************
*** 665,669 ****
  
  	/* check % total cache buffers as a percentage of the original*/
! 	} else if (vars_to_check==CHECK_TCB) {
  
  		send_buffer = strscpy(send_buffer,"S7\r\n");
--- 669,673 ----
  
  	/* check % total cache buffers as a percentage of the original*/
!         } else if (vars_to_check==CHECK_TCB) {
  
  		send_buffer = strscpy(send_buffer,"S7\r\n");
***************
*** 679,682 ****
--- 683,706 ----
  		asprintf(&output_message,"total cache buffers = %d%% of the original",total_cache_buffers);
  		
+         } else if (vars_to_check==CHECK_DSVER) {
+ 		asprintf(&send_buffer,"S13\r\n");
+           	result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
+           	if(result!=STATE_OK)
+           		return result;
+ 
+           	recv_buffer[strlen(recv_buffer)-1]=0;
+ 
+          	asprintf(&output_message,"NDS Version %s",recv_buffer);
+ 
+         } else if (vars_to_check==CHECK_UPTIME) {
+ 	  	asprintf(&send_buffer,"UPTIME\r\n");
+ 	  	result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
+ 	  	if(result!=STATE_OK)
+ 	 		return result;
+ 
+ 	  	recv_buffer[strlen(recv_buffer)-1]=0;
+ 
+ 	  	asprintf(&output_message,"Up %s",recv_buffer);
+ 
  	} else {
  
***************
*** 848,851 ****
--- 872,879 ----
  				else if(!strcmp(optarg,"TSYNC"))
  					vars_to_check=CHECK_TSYNC;
+ 				else if(!strcmp(optarg,"DSVER"))
+ 					vars_to_check=CHECK_DSVER;
+ 				else if(!strcmp(optarg,"UPTIME"))
+ 					vars_to_check=CHECK_UPTIME;
  				else
  					return ERROR;





More information about the Commits mailing list