I'll give you a basic example that expands a bit on what Illuminatus said about try one and then the other.
# in pseudocode no less! get $deviceIP ping $deviceIP or report it as not responding and exit ssh $deviceIP if ssh error then if ssh error is 'connection refused' then telnet $deviceIP or report error and exit do work with telnet connection else report error and exit end if end if do work with ssh connection
If you already know which devices use telnet and which use ssh then things get even simpler. Just try the correct protocol!
Update: Oops. I forgot the most important part.
You will not get any good responses until you can give us some clear information regarding your problem and code that demonstrates said problem.
In reply to Re: Forced to modify perl telnet script to use both telnet and ssh
by Mr. Muskrat
in thread Forced to modify perl telnet script to use both telnet and ssh
by essej1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |