Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- import logging
- class A(object):
- def f(self):
- url = "192.168.0.201"
- logging.basicConfig(filename='test.log', level=logging.DEBUG)
- logger = logging.getLogger("my_log")
- logger.debug('This message should go to the log file')
- client = paramiko.SSHClient()
- paramiko.util.log_to_file("filename.log")
- client.load_system_host_keys()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(url, port=8333, username='multichainrpc', password='5gPqaBfyG69HbLHq64XLPuwopKi3K7fzY9aEXeU3f9TF')
- #todo ask about url, usern, and passw
- resp = raw_input("Type nodeinfo or networkinfo: ");
- if(resp=="nodeinfo"):
- stdin, stdout, stderr = client.exec_command('multichain-cli proof getaddednodeinfo')
- print(stdout.readLines())
- if(resp=="networkinfo"):
- stdin, stdout, stderr = client.exec_command('multichain-cli proof getnetworkinfo')
- print(stdout.readLines())
- client.close()
- b = A()
- b.f()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement