StatsTableCleanup Policy


  • Example Overview
  • Sample Output


  • Example Overview

    Example name : StatsTableCleanup.java
    Location: <Web NMS Home>/default_impl/policies directory

    Data collected from devices are stored either in STATSDATA table (default table defined by Web NMS ) or in user-defined tables. Whatsoever be the case, the tables are created on a daily basis (if % was appended to table name when it was defined) . After some days, if they are not required, they can be removed from database . If not done, they will unnecessarily occupy space and may further create problems while storing new tables.

    Hence the best way is to perform a periodic clean up of such tables. To perform this clean up operation, Web NMS provides a Policy called StatsTableCleanup. StatsTableCleanup policy is executed periodically at the specified time. This policy accepts the input regarding the Policy from the Administrator via a form. Based on those inputs it is executed periodically.
     

    Sample Output

    You have to first configure the Policy by giving inputs to it. This can be done by Web NMS client following these steps :
    1. Choose Administration Tools node and then Policies node from the tree in left frame.
    2. In the screen, you will see the default policy "TableCleanup" policy as a row. Double-click the row.
    You will get a screen as shown below:

    Following inputs have to be provided to this form:
     
    Input Description
    Delete data after days Specify an integer . For example, 3 . It means that any table that is older than 3 days must be removed from database.
    Table name By default , STATSDATA% will be displayed . You can change it to your own table name. Include the % symbol at end to denote the daily tables created. If you do not specify the % symbol, the table with exact name you specify will be searched for deletion.
    clean up hour You can specify the time at which the clean up should take place. You can specify the hour as a number between 0 and 23. For e.g. if you specify 4, cleanup will start at 4 AM.
    Status This can be set to enabled or disabled. If set to disabled, this policy will not be executed and hence table cleanup will not take place.
    name A meaningful string to identify the policy in future.

    Once you specify these inputs, you can see the policy listed in the right frame. If the status of the policy is set to "enabled" then this policy starts working immediately. It waits till the specified "Clean up hour". Once attained, it starts cleaning up the table by checking the input "Delete data after days".

    Thus StatsTableCleanup policy ensures that enough space is made available in the database to store latest collected data.


    Copyright © 1996-2002, AdventNet Inc. All Rights Reserved.