assign - Need to capture specific text in a text file -


i writing code output of f5 device & take actions based on output. able write file & output looks this.

 status                  availability   : unknown  state          : disabled  reason         : node address not have service checking enabled  monitor        : none  monitor status : unchecked  session status : user-disabled  traffic                serverside  general  bits in                    2.4m        -  bits out                  40.2m        -  packets in                 3.7k        -  packets out                4.4k        -  current connections           0        -  maximum connections           5        -  total connections           278        -  total requests                -      375  current sessions              -        0 

i want find value next session status & current sessions, based on value, want take other actions. not able capture value of current sessions & session status. need pointers on how capture values.

my code below.

import paramiko import sys  # define variable remote connections ssh_conn=paramiko.sshclient() # define policy accept secret keys ssh_conn.set_missing_host_key_policy(paramiko.autoaddpolicy())  log = open('out.txt','w') # define ip connect & username , password connect ssh_conn.connect('x.x.x.x', username='aaaaa', password='bbbbb')  stdin, stdout, stderr = ssh_conn.exec_command("show ltm node x.x.x.x",  get_pty=true)  sys.stdout = open('out.txt','w')  # close current connections ssh_conn.close() 


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -