Created
May 12, 2017 13:55
-
-
Save mrmichalis/f3a2ef3119165e37dc04494d2cabf409 to your computer and use it in GitHub Desktop.
Connect to Cloudera Manager Agent supervisord via xmlrpclib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/lib64/cmf/agent/build/env/bin/python | |
# grep -A2 username /var/run/cloudera-scm-agent/supervisor/supervisord.conf | head -2 | |
# ... | |
# username=6898309654436388381 | |
# password=7733585661005351423 | |
# ... | |
import xmlrpclib | |
server = xmlrpclib.Server('http://6898309654436388381:7733585661005351423@localhost:19001/RPC2') | |
server.system.listMethods() | |
# server.system.listMethods() | |
# ['supervisor.addProcessGroup', 'supervisor.clearAllProcessLogs', 'supervisor.clearLog', | |
# 'supervisor.clearProcessLog', 'supervisor.clearProcessLogs', 'supervisor.getAPIVersion', | |
# 'supervisor.getAllConfigInfo', 'supervisor.getAllProcessInfo', 'supervisor.getIdentification', | |
# 'supervisor.getPID', 'supervisor.getProcessInfo', 'supervisor.getState', 'supervisor.getSupervisorVersion', | |
# 'supervisor.getVersion', 'supervisor.readLog', 'supervisor.readMainLog', 'supervisor.readProcessLog', | |
# 'supervisor.readProcessStderrLog', 'supervisor.readProcessStdoutLog', 'supervisor.reloadConfig', | |
# 'supervisor.removeProcessGroup', 'supervisor.restart', 'supervisor.sendProcessStdin', | |
# 'supervisor.sendRemoteCommEvent', 'supervisor.shutdown', 'supervisor.startAllProcesses', | |
# 'supervisor.startProcess', 'supervisor.startProcessGroup', 'supervisor.stopAllProcesses', | |
# 'supervisor.stopProcess', 'supervisor.stopProcessGroup', 'supervisor.tailProcessLog', | |
# 'supervisor.tailProcessStderrLog', 'supervisor.tailProcessStdoutLog', 'system.listMethods', | |
# 'system.methodHelp', 'system.methodSignature', 'system.multicall'] | |
server.supervisor.getAllProcessInfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment