[SOLVED] I am trying to remote execute a python command vis ssh. I am getting a syntax error from the remote server.
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to remote execute a python command vis ssh. I am getting a syntax error from the remote server.
[root@fuel ~]# echo "glance-control all status" | ssh root@10.11.32.16 /usr/bin/python
Warning: Permanently added '10.11.32.16' (RSA) to the list of known hosts.
File "<stdin>", line 1
glance-control all status
^
SyntaxError: invalid syntax[/SIZE][/FONT]
[root@fuel ~]#
I have done many searches, and have tried altering syntax. I always get the same error.
True and we probably need more information. From a quick google, glance is a HP-UX monitoring tool similar to nagios and glance-control is the command line access tool. So I believe the op is trying to run a remote command.
You need "-c" to do that, otherwise python tries to execute the file "glance-control", which would fail
Code:
ssh root@10.11.32.16 '/usr/bin/python -c "glance-control all status"'
Almost the Same Error
# ssh root@10.11.32.16 '/usr/bin/python -c "glance-control all status"'
Warning: Permanently added '10.11.32.16' (RSA) to the list of known hosts.
File "<string>", line 1
glance-control all status
^
SyntaxError: invalid syntax
Last edited by buckb; 12-29-2015 at 06:53 AM.
Reason: Changed 'Same Error' to 'Almost the Same Error'
michaelk is correct, in that more information is needed.
1) glance is a piece of openstack.
2) glance-control is a tool to handle bringing up and down the glance daemons. By itself, glance-control works.
e.g. root@node-29:~# glance-control all status
glance-api is stopped
glance-registry is stopped
glance-scrubber is stopped
The problem is trying to get glance-control to work via ssh.
Here is the original error, which I did not post
Quote:
# ssh root@10.11.32.16 'glance-control all status'
Warning: Permanently added '10.11.32.16' (RSA) to the list of known hosts.
Traceback (most recent call last):
File "/usr/bin/glance-control", line 10, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/glance/cmd/control.py", line 362, in main
do_check_status(pid_file, server)
File "/usr/lib/python2.7/dist-packages/glance/cmd/control.py", line 209, in do_check_status
print(_("s is stopped") server)
File "/usr/lib/python2.7/dist-packages/oslo_i18n/_message.py", line 167, in __str__
raise UnicodeError(msg)
UnicodeError
After doing web searches, I tried what is in my original post, as well of variations of the same.
I believe this is a SSH syntax error.
Well, while writing this reply, I solved this problem. I went through the ssh man page again and added the -t option to the ssh command.
Quote:
# ssh -t root@10.11.32.16 'glance-control all status'
Warning: Permanently added '10.11.32.16' (RSA) to the list of known hosts.
glance-api is stopped
glance-registry is stopped
glance-scrubber is stopped
Connection to 10.11.32.16 closed.
Thanks for all who replied.
Last edited by buckb; 12-29-2015 at 07:59 AM.
Reason: Corrected punctuation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.