jamiecaesar / securecrt-tools

SecureCRT scripts, written in Python, for doing various tasks when connected to Cisco equipment.
Apache License 2.0
246 stars 78 forks source link

Running Scripts from Command Line #55

Open loftyworld opened 2 years ago

loftyworld commented 2 years ago

Hi fantastic work. The scripts both yours and mine work fine when launching the session within securecrt and then running them. If I launch Securecrt from the command line and pass the script as an argument to run, the session launches fine but then I get "Unknown or Unsupported device OS" Do you have any idea why I would get this? It happens on all scripts.

Thank you

jamiecaesar commented 2 years ago

Hmm, interesting. I wasn't even aware that you could launch them from the command line via SecureCRT. What OS are you doing this on, and can you share some examples of the command you use to launch the scripts?

Just FYI that I'm traveling for a couple weeks, and I unfortunately do not use these scripts regularly on my current project, so finding time to make updates has been difficult recently. Hopefully I might find some time in the not too distant future, though!

loftyworld commented 2 years ago

Hi Jamie, thank you very much for the reply. The work you have done is exactly what I am looking for, so for example I want to get route tables, arp entries etc, all from Cisco devices. However I would like to schedule them so they can get them at various times of the day, therefore I can schedule it by running the SecureCRT scripts from the command line. I am running on Windows 10 and the command is as follows:

C:\Program Files\VanDyke Software\Clients>SecureCRT.exe /SCRIPT "C:\Users\xxx\OneDrive\Documents\securecrt-tools/s_arp_to_csv.py" /SSH2 172.16.121.24 /L XXX /PASSWORD XXX

The command launches SecureCRT, it connects to the device, gets the version and then pauses before giving the attached error.

Your help is extremely well received. Kind Regards Screenshot 2022-03-31 183914