I want to write a python script to perform a very simple "agent" monitoring of remote processes running on Linux servers.
He would perform the following tasks in psuedocode:
for each remoteIPAddress in listOfIPAddresses:
log into server@remoteIPAddress via ssh
execute the equivalent of a 'ps -ef' command
grep the result to make sure a particular process (by name) is still running
One way to do this is to have python call shell scripts in a subprocess and parse their output. It seems rather inefficient. Is there a better way to do this through python libraries?
All I could find through research here and elsewhere:
- psutil - it seems that it does not perform remote monitoring, so I would have to run agents on remote computers that reports RPC statistics.
- pymeter - I would need to write my own plugin to monitor a specific remote service.
- https://stackoverflow.com/questions/1123323/...- Some useful links, but the poster was looking for a different solution.
Thank you, and please calm down, my first question is :-)
source
share