CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Post deleted by crashfulltime

 



crashfulltime
New User

Jul 31, 2014, 1:42 PM

Post #1 of 4 (892 views)
Post deleted by crashfulltime

 


wickedxter
User

Jul 31, 2014, 9:02 PM

Post #2 of 4 (881 views)
Re: [crashfulltime] need help creating a script [In reply to] Can't Post

This will keep the data returned from the $con->cmd(if any) in the array in order.

Code
my @output; 

print "sho run | i snmp-server location\n";
push @output, $con->cmd("show running-config | include snmp-server location");

print "config t\n";
push @output, $con->cmd("config t");

print "end\n";
push @output, $con->cmd("end");

print join("\n", reverse(@output)); #this will print the newest first and the first last.



FishMonger
Veteran / Moderator

Aug 1, 2014, 6:13 AM

Post #3 of 4 (877 views)
Re: [crashfulltime] need help creating a script [In reply to] Can't Post

The code you posted doesn't do anything towards dealing with the description of what you want to do.

Do you need to modify a configuration file as you describe, or do you need to issue router/switch commands (possibly via a telnet connection) to modify the devices running-config?


crashfulltime
New User

Aug 6, 2014, 12:57 PM

Post #4 of 4 (804 views)
Re: [FishMonger] need help creating a script [In reply to] Can't Post

Thanks wickedxter and Fishmonger. Like i said i am very new to creating scripts so going to work on this more before i post anything but thanks for the replies.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives