[PATCH] ndoutils 1.4b7: missing table clearout

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Tue Apr 21 19:29:18 CEST 2009


On Tue, Apr 21, 2009 at 05:40:40PM +0100, Duncan Ferguson wrote:
>
>
> ndoutils is missing a clean out of the nagios_service_contactgroups  
> table.

umong others, yes. Care to submit a patch?

$ for i in $(grep NDO2DB_DBTABLE_ include/db.h | awk '{print($2)}' );do test $(egrep -c "db_clear_tabl.*$i" src/dbhandlers.c) -eq 0 && echo "ndo2db_db_clear_table(idi,ndo2db_db_tablenames[$i]);" ;done
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_INSTANCES]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_CONNINFO]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_OBJECTS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_OBJECTTYPES]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_LOGENTRIES]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_SYSTEMCOMMANDS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EVENTHANDLERS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICECHECKS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_HOSTCHECKS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EXTERNALCOMMANDS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_PROCESSEVENTS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_TIMEDEVENTS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_FLAPPINGHISTORY]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_COMMENTHISTORY]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_NOTIFICATIONS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_CONTACTNOTIFICATIONS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_CONTACTNOTIFICATIONMETHODS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_ACKNOWLEDGEMENTS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_STATEHISTORY]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_DOWNTIMEHISTORY]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED31]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED32]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED33]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED34]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED35]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED36]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED37]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED38]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_RESERVED39]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_HOSTCONTACTGROUPS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICECONTACTGROUPS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_HOSTESCALATIONCONTACTGROUPS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICEESCALATIONCONTACTGROUPS]);

minus RESERVED and possibly other hunks, you get the idea.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p




More information about the Developers mailing list