in reply to Using Net::SSH2::Cisco

What output are you getting on STDOUT, and the /tmp logs ?

Since you are running only one thread, debugging is unnecessarily complicated by your use of Parallel::ForkManager. Try to run without that. You can even use the built-in perl debugger!

Your declaration of "local($host,$model) = @_;" is probably based on a misunderstanding of "local". Please change that to "my".

Try to add error checking when you create the new Cisco object, and when you do the login.

        "I can cast out either one of your demons, but not both of them." -- the XORcist

Replies are listed 'Best First'.
Re^2: Using Net::SSH2::Cisco
by mroe1234 (Initiate) on Dec 17, 2015 at 17:35 UTC

    I'm running one thread for the purposes of debugging, this will eventually have to be set to ~8-16. The logic all works and based on my reading of the documentation the reason I'm not getting anything in @cmdoutput is because it can't find the '#'. I have been playing with timeouts for a while. Here are my logs:

    $ cat /tmp/input.log Trying to connect to tftp server...... TFTP put operation failed:No route to host + Trying to connect to tftp server...... TFTP put operation was successful + Copy complete, now saving to disk (please wait)...
    $ cat /tmp/output.log copy startup-config tftp://192.168.0.206/switches/conf/172.16.2.11-con +fg vrf default copy startup-config tftp://192.168.0.206/switches/conf/172.16.2.11-con +fg vrf management

    I added a few '\n' as you can see above with the same result. when I run the commands manually on the switch I get the following(it takes about 1-2seconds to run manually):

    ewfmb_179_cc7_b# copy startup-config tftp://192.168.0.206/switches/con +f/172.16.2.11-confg vrf management Trying to connect to tftp server...... Connection to Server Established. TFTP put operation was successful + Copy complete, now saving to disk (please wait)... ewfmb_179_cc7_b#

    I send the command twice only because some switches use a management vrf and others do not, that is why you see the first output error with 'no route to host'.