[Nagios-checkins] ndoutils/src db.c,1.7,1.8 ndo2db.c,1.22,1.23

Duncan Ferguson duncan_ferguson at users.sourceforge.net
Thu Aug 6 15:01:51 UTC 2009


Update of /cvsroot/nagios/ndoutils/src
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2600/src

Modified Files:
	db.c ndo2db.c 
Log Message:
Allow externalcommands table to be trimmed with a specific time limit (Opsera Ltd)


Index: db.c
===================================================================
RCS file: /cvsroot/nagios/ndoutils/src/db.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** db.c	6 Aug 2009 14:51:09 -0000	1.7
--- db.c	6 Aug 2009 15:01:49 -0000	1.8
***************
*** 142,145 ****
--- 142,146 ----
  	idi->dbinfo.max_hostchecks_age=ndo2db_db_settings.max_hostchecks_age;
  	idi->dbinfo.max_eventhandlers_age=ndo2db_db_settings.max_eventhandlers_age;
+ 	idi->dbinfo.max_externalcommands_age=ndo2db_db_settings.max_externalcommands_age;
  	idi->dbinfo.last_table_trim_time=(time_t)0L;
  	idi->dbinfo.last_logentry_time=(time_t)0L;
***************
*** 764,767 ****
--- 765,770 ----
  		if(idi->dbinfo.max_eventhandlers_age>0L)
  			ndo2db_db_trim_data_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EVENTHANDLERS],"start_time",(time_t)((unsigned long)current_time-idi->dbinfo.max_eventhandlers_age));
+ 		if(idi->dbinfo.max_externalcommands_age>0L)
+ 			ndo2db_db_trim_data_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EXTERNALCOMMANDS],"entry_time",(time_t)((unsigned long)current_time-idi->dbinfo.max_externalcommands_age));
  		idi->dbinfo.last_table_trim_time=current_time;
  	        }

Index: ndo2db.c
===================================================================
RCS file: /cvsroot/nagios/ndoutils/src/ndo2db.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** ndo2db.c	6 Aug 2009 14:39:36 -0000	1.22
--- ndo2db.c	6 Aug 2009 15:01:49 -0000	1.23
***************
*** 366,369 ****
--- 366,371 ----
  	else if(!strcmp(var,"max_eventhandlers_age"))
  		ndo2db_db_settings.max_eventhandlers_age=strtoul(val,NULL,0)*60;
+ 	else if(!strcmp(var,"max_externalcommands_age"))
+ 		ndo2db_db_settings.max_externalcommands_age=strtoul(val,NULL,0)*60;
  
  	else if(!strcmp(var,"ndo2db_user"))
***************
*** 402,405 ****
--- 404,408 ----
  	ndo2db_db_settings.max_hostchecks_age=0L;
  	ndo2db_db_settings.max_eventhandlers_age=0L;
+ 	ndo2db_db_settings.max_externalcommands_age=0L;
  
  	return NDO_OK;





More information about the Nagios-commits mailing list