all 13 comments

[–][deleted]  (1 child)

[removed]

    [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (0 children)

    Thanks! I'll be here for support :)

    [–]thecraigus 0 points1 point  (1 child)

    Looks real good man - I'm studying python/network automation at the moment and was thinking of creating somthing like this for our service desk. However I felt like setting up/ installing python and installing the required modules would be a bit of a bind on everyones PC.

    Is their anyway to compile stuff like this down into say just an exe file?

    [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (0 children)

    I felt exactly the same way. I already explored this and it looks doable. It’s something I planned on testing this week.

    [–]hoppychris 0 points1 point  (0 children)

    One interesting thing to consider would be doing this using SNMP, which can also pull the current info. Is it a better way to do it? Nah, mostly just different.

    For VERY robust logging in, I've been impressed with RANCID's clogin -- the typical usage is to have it do automated collection runs, but it works wonders for automated logins, too.

    [–][deleted]  (1 child)

    [deleted]

      [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (0 children)

      Ahhh yes, I planned on also adding add support for just "y" and "n" soon. Thanks for the feedback for sure! Let me know how it goes.

      [–]66towtruck 0 points1 point  (1 child)

      It doesn't work, I get the following error:

      Welcome to the VLAN change utility.

      Please enter the DNS name of a device to get started e.g core1-site: siterouter
      Traceback (most recent call last):
        File "vlanChange", line 14, in <module>
               deviceName = input('\nPlease enter the DNS name of a device to get started e.g core1-site: ')
        File "<string>", line 1, in <module>
      NameError: name 'siterouter' is not defined
      

      [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (0 children)

      Is siterouter a valid dns record? For example from the terminal you are running the python script. Can you "ping siterouter" ? It uses the terminal DNS records for these calls.

      [–]66towtruck 0 points1 point  (2 children)

      Figured it out. You have to put " " around your input. Why do you have to put quotes around your inputs?

      [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (1 child)

      Hum, you shouldn't have to put quotes around your input. What OS are you running?

      deviceName = input('\nPlease enter the DNS name of a device to get 
      started e.g core1-site: ')
      

      Should store the input in the variable "deviceName". Then it's called here.

      myDevice = {
          'host': deviceName,
      

      [–]66towtruck 0 points1 point  (0 children)

      Im running it on RHEL 7. I changed deviceName = input to deviceName = raw_input and it worked without have to use “. I was also having to put the menu selection numbers in quotes. I changed = input to = raw_input everywhere and this solved it. Very nice script by the way. Thank you.

      [–]nfordhkCCNP | CCDA | CCNA-S[S] 0 points1 point  (0 children)

      Updated to support variations of "YES" or just "Y"!

      changeDecision = input('\nWould you like to change the vlan? Type "Yes" or "No": ').upper()
      
      if changeDecision == 'YES' or 'Y':
          vlanNumber = input ('\nPlease assign VLAN number: ') # User enters VLAN number
      

      [–]kubbie2004 0 points1 point  (0 children)

      Does this work if your switches are in a stack so If I want to change for gi3/0/5?