Wired Intelligent Edge

last person joined: 14 hours ago 

Bring performance and reliability to your network with the HPE Aruba Networking Core, Aggregation, and Access layer switches. Discuss the latest features and functionality of your switching devices, and find ways to improve security across your network to bring together a mobile-first solution
Expand all | Collapse all

Exctract running config via SNMP or API Switch 2930F

This thread has been viewed 2 times
  • 1.  Exctract running config via SNMP or API Switch 2930F

    Posted Mar 22, 2019 07:03 AM

    Hi all,

     

    We've recently purchased some aruba switches 2930F. We are investigating how to automatically back up the configs. Do you know or can you suggest how to do it? We have some other devices that can do it via SNMP or API, but in aruba system I don't find it.

     

    Additionally we want to monoitor some parameters as CPU, Memory, Temperature. Do you know if we can extract them from a snmpwalk? I don't find the OID MIB to match it!

     

    Many thanks in advance!

     

    Best regards,

    Roger



  • 2.  RE: Exctract running config via SNMP or API Switch 2930F
    Best Answer

    MVP GURU
    Posted Mar 22, 2019 09:27 AM

    Hi Roger,

     

    For Memory/CPU on SNMP, it is the standard MIB.

     

    for get configuration, you use API (via AnyCLI)

     

    there is also auto-tftp command for automally push configuration on tftp server

     

     



  • 3.  RE: Exctract running config via SNMP or API Switch 2930F

    Posted Mar 29, 2019 09:48 AM

    Hi,

     

    Many thanks for you answer. We are trying to do it via anyCLI, but we have a problem with the POST command. We want to extract the running config like this (as we see from Internet)

    curl -s --insecure --cookie <cookie> -X POST -d '{"cmd":"show config"}' https://<IP switch>/rest/v3/cli | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["result_base64_encoded"]'| base64 --decode

    But it doesn't work.

    We don't know what is happening.We are thinking in a possible conflict between usesrs or permissions.

     

    400 Bad Request</TITLE>
    <H1>Bad Request</H1>Access is unauthorized.

     

    Do we need to enable something special.

     

    We have read that there is the command aaa authen rest-int

     

    But on our switch there's no this command.

     

    Best regds!

     

     

     



  • 4.  RE: Exctract running config via SNMP or API Switch 2930F

    MVP GURU
    Posted Mar 29, 2019 09:53 AM

    a another command work ? (like get vlan ?)

     

     



  • 5.  RE: Exctract running config via SNMP or API Switch 2930F

    Posted Mar 29, 2019 10:07 AM

    Hi!

    It seems yes!

     

    bash-4.1# curl -s --insecure --cookie <cookie> -X GET https://192.168.2.201/rest/v3/vlans

     

    {"collection_result":{"total_elements_count":7,"filtered_elements_count":7},"vlan_element":[{"uri":"/vlans/1","vlan_id":1,"name":"DEFAULT_VLAN","status":"VS_PORT_BASED","type":"VT_STATIC","is_voice_enabled":false,"is_jumbo_enabled":false,"is_dsnoop_enabled":false,"is_dhcp_server_enabled":false},{"uri":"/vlans/2","vlan_id":2,"name":"DADES","status":"VS_PORT_BASED","type":"VT_STATIC","is_voice_enabled":false,"is_jumbo_enabled":false,"is_dsnoop_enabled":false,"is_dhcp_server_enabled":false},{"uri":"/vlans/20","vlan_id":20,"name":"VLAN20",..................................

     

     

     



  • 6.  RE: Exctract running config via SNMP or API Switch 2930F

    MVP GURU
    Posted Mar 29, 2019 10:17 AM

    do you have check the switch log ?

     

    You are connected on the switch ? (Needed for POST method)



  • 7.  RE: Exctract running config via SNMP or API Switch 2930F

    Posted Apr 10, 2019 03:38 AM

    Hi,

     

    Many thanks for your help. Now we have automated backups via curl.

     

    I have last question for you. We have Nagios to monitor all the network and most of the NTP controls (just say if the machin is synchrinized or no) come via SNMP: I have been looking for this information thru an SNMPWALK but I'm not able to find any parameter that is related to NTP.

     

    Do you know which OID is related with the parameter that says if the machine is synchronized or not?

     

    Many thanks in advance!

     

    Best regards,

    Roger



  • 8.  RE: Exctract running config via SNMP or API Switch 2930F
    Best Answer

    MVP GURU
    Posted Apr 10, 2019 07:59 AM

    Sorry no idea and i don't known if there is a API for this



  • 9.  RE: Exctract running config via SNMP or API Switch 2930F

    EMPLOYEE
    Posted Sep 24, 2019 06:46 AM

    Hello Roger,

    Could you let me know how did you achieve the automated backups using CURL. i am in the same situation as yours.

     

    Regards,

    Fai



  • 10.  RE: Exctract running config via SNMP or API Switch 2930F

    Posted Sep 24, 2019 07:09 AM

    Hi Fai,

    Finally after many attempts this command extracts the config:

     

    curl -s --insecure --cookie $cookie -X POST https://192.168.9.201/rest/v4/cli -d '{\"cmd\":\"show run\"}

     

    You can see in black bold that the post is in v4

     

    Remember first to save the cookie in a variable

     

     

     

    Many thanks,

    Roger



  • 11.  RE: Exctract running config via SNMP or API Switch 2930F

    MVP GURU
    Posted Sep 24, 2019 06:30 PM

    You can use also PowerArubaSW (Powershell module)

     

    and use

    Get-ArubaSWCli -cmd "show run"

    :-)

     

    (the module on Windows/Linux/macOS)