Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- import datetime
- with open('password.txt') as f:
- for line in f:
- pw = line
- with open('host.txt') as f:
- for line in f:
- host = line
- with open('username.txt') as f:
- for line in f:
- username = line
- print("logging into " + username + "@" + host)
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(host, username=username, password=pw)
- print ("gathering queue statistic")
- print ("executing qstat ...")
- ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command('qstat -f')
- current_time = datetime.datetime.now()
- new_file = open(str(current_time), 'w')
- for line in iter(ssh_stdout.readline, ""):
- new_file.write(line)
- new_file.close()
- print('finished')
Add Comment
Please, Sign In to add comment