Python to emulate remote tail -f?

前端 未结 6 1470
攒了一身酷
攒了一身酷 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

    The paramiko module supports connecting with via ssh with python.

    http://www.lag.net/paramiko/

    The pysftp has some examples of using it and the execute command method might be what your looking for. It will create a file like object of the command you execute. I can't say if it gives you live data though.

    http://code.google.com/p/pysftp/

提交回复
热议问题