I've got a series of production servers that I'd like to be able to run certain utilities on without having to SSH into the machine.
Unfortunately, some of those programs (top and iotop I've tried so far) require curses and/or a TERM environment variable to be set, and executing from the shell via SSH doesn't work:
$ ssh myserver top
TERM environment variable not set.
$ ssh myserver iotop
Traceback (most recent call last):
File "/usr/sbin/iotop", line 16, in <module>
main()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 571, in main
main_loop()
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 561, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 465, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib/python2.7/curses/wrapper.py", line 22, in wrapper
stdscr = curses.initscr()
File "/usr/lib/python2.7/curses/__init__.py", line 33, in initscr
fd=_sys.__stdout__.fileno())
_curses.error: setupterm: could not find terminal
Any tips? Is this possible?