A
A
artemmensk2015-04-16 02:04:54
linux
artemmensk, 2015-04-16 02:04:54

What is the best way to organize interactive monitoring/control of a remote machine via ssh (linux)?

I have a server running n processes,
each of them writes a log.
I need to frequently look at different combinations of online logs (tail -F), run bash commands/scripts at certain points.
I want to write a utility (web application) for these needs.
Clicking on the button is supposed to run a specific bash command on the remote machine.
Online I want to see what's going on in the logs/dmesg/etc.
Tell me how to organize everything so that interactive control occurs using one ssh connection?
So far I've only found one like this:

sshpass -p pass ssh otherhost << EOF
 > ./opt/scripts/some_script1.sh
 > ./opt/scripts/some_script2.sh
 > ./opt/scripts/some_script3.sh

but the entire sequence of commands will be executed only after the final EOF and not at the moment of local insertion ...
Also, please direct me - how best to organize the arrival of streams (from tail -F , dmesg, etc) (ideally, everything is in the same ssh)?
It will be interesting to learn about ready-made universal solutions, linux utilities, libraries.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Yarosh, 2015-04-16
@voidnugget

Now it is generally accepted to index logs in full-text search engines and clean them up as unnecessary. Most often they use logstash fluentd flume with Kibana , everything is indexed in ElasticSearch . Everything is automatically updated in real time, you can even draw beautiful custom graphics for every taste.
Here and there are slightly outdated usage examples. Kibana is now one of the main tools for processing logs in Yandex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question