Changing retention period in events_live and events_archive tables
search cancel

Changing retention period in events_live and events_archive tables

book

Article ID: 333375

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

  • Currently in watch4net the resync period delay in processing notifications takes approximately 12 hours. Events_archive is updated every 12 hours, with events that are closed for at least 24 hours. So from a time an event archives in Smarts, it is 24-36 hours before it appears in events_archive.
  • How to set the amount of time to keep Smarts events archived in the Watch4net events_live and events_archive databases

Environment

Watch4Net/M&R - 7.x

Resolution

  • Check the processing.xml (<APG_BASE>/Event-Processing/Event-Processing-Manager/<Instance_Name>/conf/), file has content similar to below:
<processing-manager xmlns="http://www.<hostname>.com/Events/DefaultProcessingManager" xmlns:xsi="http://www.<hostname>.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.<hostname>.com/Events/DefaultProcessingManager DefaultProcessingManager.xsd ">
       <processing-element name="DW-A" config="Generic-Live-Writer/<Instance_Name>/conf/my-smarts-archive.xml" />
       <processing-element name="EVENT-VALIDATOR" config="Event-Processing-Utils/<Instance_Name>/conf/rpe-event-validator.xml" type="EventValidator" data="DW-A"  />
       <processing-element name="DW-L" config="Generic-Live-Writer/<Instance_Name>/conf/my-smarts-live.xml" command="AC" data="EVENT-VALIDATOR AC[command]" />
       <processing-element name="AC" config="Active-Cache/<Instance_Name>/conf/active-cache.xml" data="DW-L" command="DW-L" />
       <processing-element name="Smarts" config="Smarts-Listener/<Instance_Name>/conf/smarts-listener.xml" data="AC" />
</processing-manager>
  • The active cache would write the data out to Generic-Live-Writer
  • Check the my-smarts-live.xml file, look for line:
    • <moveout field="ClosedAt UpdatedAt" period="2h" timeout="1d" />
  • The timeout is what basically tells us when to archive the event. The above configuration is basically saying archive an event so long as the difference between the created time and closedAt time is at least 1 day . You can tweak this accordingly to suit your needs.
  • Once change is done, save and close the file, followed by service restart. 

 

Additional Information

To set the retention time for events stored in the watch4net/MnR events_live and events_archive databases, do the following:

  • On the Watch4net event processing server, open the my-smarts-archive.xml file in an XML editor. This file is found in <APG_BASE>/Event-Processing/Generic-Live-Writer/Event-Processing/Generic-Live-Writer/<Instance-Name>/conf/my-smarts-archive.xml
  • Set the desired retention time settings in the line (default values shown):
    • <expiration field="ClosedAt" period="1d" timeout="365d" />
  • Changing the timeout will change the retention for old events based on the ClosedAt date.
  • Save and close the my-smarts-archive.xml file.
  • Restart event-processor service.