Automation

last person joined: 2 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  event-options Command: Are there any System Variables that can be used

    Posted 01-21-2016 08:15

    Hi,

     

    Is it possible to use System Variables, such as e.g. $HOSTNAME, that can be used in command for event-option definition?

     

    The command I have to automate requires the hostname of the system and IP_Address of a DHCP based interface. Is it possible to use these dynamic values in Commands in Event-Options?

     

    Thanks.



  • 2.  RE: event-options Command: Are there any System Variables that can be used
    Best Answer

     
    Posted 01-21-2016 08:30

    Hi,

     

    Not as such no; however there are some variables that are available from within an event-script, so if you define the event-option policy to execute an event script.  The event script would then have access internally to a variable $hostname which would contain the hostname of the local routing-engine that the script is running on, or the script could make an RPC call to obtain the configured hostname of the device etc.

     

    In a scenario where-by you wanted some other variable out of the system to be processed such as your example of the dhcp based ip address, then the script can make an RPC call to obtain that information and then parse the response to trigger what-ever actions are necessary etc.

     

    Regards,

    Andy