AXAPI: Determine when configuration last updated

Community Forum Forums Thunder and AX Series General AXAPI: Determine when configuration last updated

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by avatar shawnbe 1 year ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13362
    avatar
    shawnbe
    Member

    Hi folks,

    I’ve been scouring the SDK documentation for the 4.1.x ADC code and have been unable to figure out how to determine the date time of the last configuration change. In the CLI I can run ‘show running-config’ and look at the top where it indicates when it was last updated and when it was last saved.

    In the earlier 2.x AXAPI I was able to get this using a call to system.config_status.get.

    Any idea how to do this through the AXAPI in 4.1.x?

    Thanks!
    Shawn

    #13372
    avatar
    tjones
    Member

    Try:

    http://192.168.0.152/axapi/v3/version/oper

    JSON response:

    {
        "version": {
            "oper": {
                "hw-platform": "vThunder",
                "copyright": "Copyright 2007-2017 by A10 Networks, Inc.",
                "sw-version": "4.1.0-P10 build 105 (Oct-30-2017,17:16)",
                "plat-features": "",
                "boot-from": "HD_PRIMARY",
                "serial-number": "vThunder3869D3001FD943DBA06B6A0E67F8B36D605C6360",
                "aflex-version": "2.0.0",
                "firmware-version": "0.0.0",
                "hd-pri": "4.1.0-P10.105",
                "hd-sec": "4.1.1-P6.46",
                "last-config-saved-time": "Nov-28-2017, 22:09",
                "virtualization-type": "KVM",
                "hw-code": "N/A",
                "current-time": "Nov-28-2017, 22:20",
                "up-time": "8 days, 4 hours, 19 minutes"
            },
            "a10-url": "/axapi/v3/version/oper"
        }
    }
    • This reply was modified 1 year ago by avatar tjones.
    #13392
    avatar
    shawnbe
    Member

    Hi tjones,

    Thanks for that. From this I can get the last time the config was saved to disk, but more importantly I need to know the last time the running config was changed. I’d like to cache config and only re-read when it’s changed.

    Thanks!
    Shawn

    #13402
    avatar
    tjones
    Member

    Hi Shawn,

    I would say to try:

    http://192.168.0.152/axapi/v3/running-config

    however it doesn’t appear to return anything for me, so another approach would be to run cli-deploy to get the running-config. The running-config has the info I think you are looking for at the top. If you wanted, you could also hash the response and then check the hash against the previous hash to see if it changed. Would this work for you?

    curl -X POST \
      http://192.168.0.152/axapi/v3/clideploy \
      -H 'authorization: A10 6121c2b4423d55bc5435fd6f8318b0' \
      -H 'content-type: text/plain' \
      -d 'show running-config'
    !Current configuration: 18822 bytes     
    !Configuration last updated at 22:27:45 PST Tue Nov 28 2017
    !Configuration last saved at 22:28:01 PST Tue Nov 28 2017
    !64-bit Advanced Core OS (ACOS) version 4.1.0-P10, build 105 (Oct-30-2017,17:16)
    !
    vrrp-a common 
      device-id 2 
      set-id 5 
      enable 
    !
    ...
    #13412
    avatar
    shawnbe
    Member

    That’s what I’d feared. That’s a decent work-around though. I can limit the output by passing something along the lines of “show running-config | include !Configuration last updated”.

    That way I just get the single line.

    Thanks for the help!
    -Shawn

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.