Python to emulate remote tail -f?

前端 未结 6 1471
攒了一身酷
攒了一身酷 2021-01-04 20:28

We have several application servers, and a central monitoring server.

We are currently running ssh with \"tail -f\" from the monitoring server to stream several text

6条回答
  •  孤城傲影
    2021-01-04 20:46

    I know this doesn't answer your questions, but...

    Maybe you could try using screen. If your session drops, you can always reattach and the tail will still be running. It also supports multiuser, so 2 users can view the same tail command.

    http://en.wikipedia.org/wiki/GNU_Screen

    create with the name "log":

    screen -S log
    

    disconnect:

    [CTRL]+A D
    

    reattach

    screen -r log
    

    list when you can remember the name

    screen -list
    

    To get rid of the session, just type exit while in it.

提交回复
热议问题