5 Replies Latest reply: Feb 24, 2012 11:28 AM by Appajee Papolu RSS

Programmatic way to get/set CMDB cache refresh interval

Appajee Papolu

Is there an API or easy way of doing this? I looked up fairly quickly in ARServerUser.getServerInfo and a bit in Atrium Java API. But did not find any way of doing this. So the questions is - "CMDB-Cache-Refresh-Interval" is a tag you write into ar.cfg *manually*, and CMDB uses it? Or, can you also get or set this programmatically?

 

thanks

appajee

  • 1. Re: Programmatic way to get/set CMDB cache refresh interval
    Manish Patel

    Hi Appajee,

    I don’t see API for CMDB-Cache-Refresh-Interval unless you make some change at Class definition level. E.g. create dummy attribute and keep changing it whenever you want refresh cache.

     

    Regards,

    Manish

  • 2. Re: Programmatic way to get/set CMDB cache refresh interval
    Carl Wilson

    Hi appajee,

    to answer your question:

     

    By default, the cache is refreshed every five minutes. You can set this interval by

    editing a line in the AR System configuration file.

     

     

     

    Cheers

    Carl

     

    http://www.missingpiecessoftware.com/

     

     

    To set the cache refresh interval

     

    1. Edit the configuration file for the AR System server where BMC Atrium CMDB is

     

    On Windows, this file is

     

    <ARserver_install_dir>

     

     

     

     

    On UNIX, this file is <ARserver_install_dir>

     

     

     

     

    On the

     

    CMDB-Cache-Refresh-Interval

    line, set the value in seconds for the interval

    at which the cache is refreshed.

    For example, to refresh the cache every two minutes, set the line to read

    CMDB-Cache-Refresh-Interval: 120

    If this line does not exist, create it.

     

     

    From the document here:

     

    https://communities.bmc.com/communities/message/75598#75598

     

    (Stupid editor throws out formatting ...)

  • 3. Programmatic way to get/set CMDB cache refresh interval
    Appajee Papolu

    Good to hear from you Manish.

     

    Ok, sounds like a bit of hack. But I am good as long as it works. :-) To better understand that it works, a follow up Q:

    So, if I alter some attribute definition & issue the CMDBClass.SetAttribute to save this attr definition -- this call is *blocked* until (the modification took place plus) the cache is refreshed? So when the response comes back to the client, I can be assured that the cache is already refreshed?

  • 4. Programmatic way to get/set CMDB cache refresh interval
    Appajee Papolu

    Thanks for the response. But, I am only looking at programmatic way of doing this.

  • 5. Programmatic way to get/set CMDB cache refresh interval
    Appajee Papolu

    BTW, your workaround is to "force a cache refresh" if it works the way you described. My original question was the ability to "get/set this cache refresh interval value" programmatically.

     

    In any case, my desire was mainly to wait for completion of a cache refresh before proceeding to doing other work. So I wanted to find what the cache refresh interval value was, and simply have the client sleep that long (plus some offset seconds to be safe). However if you can tell me that your workaround of forcing a refresh by a fake metadata modification, will run synchronously and gives the client control back only upon completion of cache refresh -- my problem is still solved.

     

    But if you say, by this workaround -- I merely kicked off a cache refresh, as a result asychronously the cache is refreshed, control got back to me immediatedly. i.e. Whether the cache refresh is completed or not, is still undeterministic by the time control got back to API client.  This is no good for me.

     

    So in essence, I want to have a foolproof mechanism to make sure I wait for a cache refresh to occur/complete, and only upon its completion, I want my API client to proceed further. Pls confirm if your workaround does the trick for me here, otherwise other suggestions!

     

    thanks

    Appajee