Forum Discussion

Faintly_Lucky's avatar
Faintly_Lucky
Icon for Nimbostratus rankNimbostratus
Dec 28, 2017

In search of STABLE DB variable to use for determining if a change has been made

Greetings,

 

I have seen the threads started by others in search of such a variable when writing automated backup scripts and have found that while configsync.localconfigtime and ltm.configtime work with LTMs (with the caveat that you must disable software auto-update check and maybe software phone-home to stabilize them), they DO NOT work when other modules such as ASM or APM are in use because they do not stay stable due to datasync, etc.

 

To be clear, I am looking for a variable (if one exists) that records the time of the last USER-INITIATED change or SYNC action. IOW, a variable that is not affected by the various system-initiated tasks that happen in the background.

 

Does such a variable exist and if so, what is it?

 

Sincere thanks in advance.

 

4 Replies

  • this might not what you are looking for but wonder if sync-status rest api is useful.

    e.g.

    [root@bip1a:Active:In Sync] config  curl -sk -u admin:admin https://localhost/mgmt/tm/cm/sync-status |jq '.entries."https://localhost/mgmt/tm/cm/sync-status/0".nestedStats.entries.status.description'
    "In Sync"
    
    • Faintly_Lucky's avatar
      Faintly_Lucky
      Icon for Nimbostratus rankNimbostratus

      Thank you for your response. Unfortunately, that's not what I'm looking for.

       

      My code pulls the DB variable value and compares it to a file called $f5host.lastmod, which contains the variable value returned the last time a change/sync was done. Like this (in perl):

       

      sub modcheck {
       my $lasttimeshitchanged = read_file("/var/f5backup/$f5host.lastmod");  
       $bigip->GET("sys/db/configsync.localconfigtime");
       $jresponse = decode_json $bigip->responseContent();
       my $checkvalue = $jresponse->{"value"};
       if ( $checkvalue > $lasttimeshitchanged ) {
            $shitchanged = 1;
            write_file("/var/f5backup/$f5host.lastmod",$checkvalue);
       }
      }

      Any time a device-group runs a sync operation, whether automatic or manual, that variable changes. After running checks, the APM module seems to not have an issue, but ASM keeps running an automatic sync which de-stabilizes that variable. I could use ltm.configtime, which is stable on the ASMs, but that wouldn't tell me if an ASM change had occurred, only an LTM change. I can write code to recognize when the ASM module is provisioned and check multiple variables, but I haven't been able to find a matching variable (ex. asm.configtime doesn't exist) that tells me the last time a change was made to the ASM module.

       

      Any ideas?

       

      Sincere thanks in advance.

       

  • this might not what you are looking for but wonder if sync-status rest api is useful.

    e.g.

    [root@bip1a:Active:In Sync] config  curl -sk -u admin:admin https://localhost/mgmt/tm/cm/sync-status |jq '.entries."https://localhost/mgmt/tm/cm/sync-status/0".nestedStats.entries.status.description'
    "In Sync"
    
    • Faintly_Lucky's avatar
      Faintly_Lucky
      Icon for Nimbostratus rankNimbostratus

      Thank you for your response. Unfortunately, that's not what I'm looking for.

       

      My code pulls the DB variable value and compares it to a file called $f5host.lastmod, which contains the variable value returned the last time a change/sync was done. Like this (in perl):

       

      sub modcheck {
       my $lasttimeshitchanged = read_file("/var/f5backup/$f5host.lastmod");  
       $bigip->GET("sys/db/configsync.localconfigtime");
       $jresponse = decode_json $bigip->responseContent();
       my $checkvalue = $jresponse->{"value"};
       if ( $checkvalue > $lasttimeshitchanged ) {
            $shitchanged = 1;
            write_file("/var/f5backup/$f5host.lastmod",$checkvalue);
       }
      }

      Any time a device-group runs a sync operation, whether automatic or manual, that variable changes. After running checks, the APM module seems to not have an issue, but ASM keeps running an automatic sync which de-stabilizes that variable. I could use ltm.configtime, which is stable on the ASMs, but that wouldn't tell me if an ASM change had occurred, only an LTM change. I can write code to recognize when the ASM module is provisioned and check multiple variables, but I haven't been able to find a matching variable (ex. asm.configtime doesn't exist) that tells me the last time a change was made to the ASM module.

       

      Any ideas?

       

      Sincere thanks in advance.