Automation

last person joined: 4 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Using Junos XML (Junoscript) for automation of eg. VLAN creation

    Posted 12-05-2013 05:24

    Hi,

     

    I'm playing around with Junos XML (Junoscript) to automate the creation / update of VLAN's on multiple EX switches.

    For starters, I downloaded the perl client tools and installed the perl modules. Then I run the example script get_chassis_inventory which already fails after succesful authentication:

    $ perl get_chassis_inventory.pl -l username -m ssl 1.2.3.4
    password:
    undefined function: JUNOS::Device::get_chassis_inventory at get_chassis_inventory.pl line 155.

     

    I noticed that when I search for more information and examples of JunosScript, I find near to nothing. So I'm beginning to wonder if this is the way to go for automating thinks like VLAN management?!

     

    I hope someone is willing to share some insights with me.

     

    Thanks!

    Onno.



  • 2.  RE: Using Junos XML (Junoscript) for automation of eg. VLAN creation
    Best Answer

    Posted 12-05-2013 06:55

    @Onno,


    Thank you for your question.  I would suggest you take a look at some recent work using Python.  There is a library called "Junos EZ" that can be quickly used for template building configs (like VLANs) as well as doing advanced troubleshooting and reporting.  You can find a blog series about it here:

     

    http://forums.juniper.net/t5/Network-Automaniac/Python-for-Non-Programmers-Part-1/ba-p/216449

     

    And the project code currently resides here:

     

    https://github.com/jeremyschulman/py-junos-eznc



  • 3.  RE: Using Junos XML (Junoscript) for automation of eg. VLAN creation

    Posted 12-07-2013 06:35

    Hi Jeremy,

     

    Thank you so much for your reply. I just did some playing around with the Python library and at least it worked in an instant.

    So for that matter it's better than the other solution. Now I need to figure out how to implement it in our environment but that won't be much of a problem. I'm thinking of making some sort of API to make the translation between PHP driven code and the python stuff.

     

    Thanks again!

     

    Regards,

    Onno.



  • 4.  RE: Using Junos XML (Junoscript) for automation of eg. VLAN creation

    Posted 01-24-2014 16:25

    @Onno

     

    You may also find useful information as part of Jeremy's PyEZ project on the TechWiki at https://techwiki.juniper.net/Automation_Scripting/Junos_OS_PyEZ.

     

    -Robert



  • 5.  RE: Using Junos XML (Junoscript) for automation of eg. VLAN creation

    Posted 01-25-2014 06:27

    Hi Robert,

     

    Thanks for the link to additional info. Haven't had the time yet to do more with it, but will continue working on this soon again.

     

    Regards,

    Onno.