This project is read-only.

some SSH cmds for cisco not working

Dec 9, 2011 at 9:31 PM

i am writing an app/script that will be connecting to some cisco equipment. i am currently using plink.exe as a process in my app to connect SSH and run commands and parse the output in the process. below is an example:

ucs6120a-A#
ucs6120a-A# scope license
ucs6120a-A /license #
ucs6120a-A /license # show usage detail | egrep 'Scope|Total|Used Quant|State'
    Scope: A
    Total Quant: 16
    Used Quant: 10
    State: License Ok
    Scope: B
    Total Quant: 16
    Used Quant: 10
    State: License Ok

when i use the SSH.NET api i can connect and run many commands instead of using plink and parse them, but then today i got towards the end of my list of commands and this one command requires me to enter Scope of License ,  when i execute the code below, the scope license cmd is not working. so my question is how am i suppose to accomplish this kind of task in SSH.NET , to enter a command like "scope license" then run the cmd i need to get the output from license?  any help would be appreciated , i am new to c sharp and .net...

client.Connect(););  

var cmd = client.CreateCommand("scope license"

cmd.Execute();

cmd.Execute("show usage detail | egrep 'Scope|Total|Used Quant|State'"

);