Automation of command(s) to NI/NX controllers via telnet/SSH
marting
Posts: 20
Hi all,
Been trying to figure out a way to automatically send one or more (ideally more) commands to a controller via telnet/SSH. Putty and its brother plink are both supposed to support this. However, when I try the commands that are supposed to work:
putty [controller] -ssh -l administrator -pw [password] -m asdf.txt (where asdf.txt has one or more commands)
plink [controller] -ssh -l administrator -pw [password] [AMX_telnet_command]
...I get no love:
FATAL ERROR: Server refused to start a shell/command
Any ideas on what can be done to make this work? Also open to other solutions that would let me do this.
Been trying to figure out a way to automatically send one or more (ideally more) commands to a controller via telnet/SSH. Putty and its brother plink are both supposed to support this. However, when I try the commands that are supposed to work:
putty [controller] -ssh -l administrator -pw [password] -m asdf.txt (where asdf.txt has one or more commands)
plink [controller] -ssh -l administrator -pw [password] [AMX_telnet_command]
...I get no love:
FATAL ERROR: Server refused to start a shell/command
Any ideas on what can be done to make this work? Also open to other solutions that would let me do this.
0
Comments
https://github.com/ansible/ansible
Let us know when you get the profiles all written!
That seems awfully heavy for what I'm trying to do. Especially since we're Windows-based and the Ansible control system has to be Linux.
I had limited success with the following:
ECHO [AMX_telnet_command] | plink [controller] -ssh -l administrator -pw [password]
This works for sending a single command to an NI (i.e. reboot). Unfortunately, on the NXes, it doesn't even work for that... Still playing around with and open to other options if anyone has suggestions!
I was able to do what I need using KiTTY which is based on a fork of putty (www.9bis.net/kitty/).
Examples
Rebooting a controller:
kitty [hostname] -ssh -l [username] -pw [password] -cmd reboot
Wiping the URL list on a controller (up to 10 entries):
kitty [hostname] -ssh -l [username] -pw [password] -cmd "set url\nD\nD\nD\nD\nD\nD\nD\nD\nD\nD\n"
Paul