hpe-storage / python-3parclient

This is a python client that talks to the HPE Alletra 9000 and HPE Primera and HPE 3PAR storage array via REST.
Apache License 2.0
48 stars 70 forks source link

ssh.HPE3PARSSHClient shownode incomplete output #90

Open lsefcik opened 2 years ago

lsefcik commented 2 years ago

We are using ssh.HPE3PARSSHClient for monitoring scripts. For 2-node systems using command shownode we are experiencing incomplete output. Node 0 and also the header is missing. This is not happening all the time, about 6 times per day.

Complete output:

,​,​,​,​,​,​,​Control,​Data,​Cache
Node,​----Name----,​-State-,​Master,​InCluster,​-Service_LED,​---LED---,​Mem(MB),​Mem(MB),​Available(%)
0,​CZ29190K73-0,​OK,​Yes,​Yes,​Off,​GreenBlnk,​16384,​16384,​100
1,​CZ29190K73-1,​OK,​No,​Yes,​Off,​GreenBlnk,​16384,​16384,​100

Incomplete output:

1,​CZ29190K73-1,​OK,​No,​Yes,​Off,​GreenBlnk,​16384,​16384,​100

We have proven there is no problem on the system. In the same time we executed the command in a different way, the output was always complete. The problem does not occur for 4-node systems.

Function getting the data:

def get_data_ssh(array, cmd_list, severity_rc):

    cl = ssh.HPE3PARSSHClient(array, username, password, conn_timeout=timeout_ssh)

    try:
        cl.open()

    except paramiko.ssh_exception.SSHException:
        print('CRITICAL: Login to {} via ssh failed '.format(array))
        print(os.linesep + 'Process runtime: ' + str(time.time() - start_time) + ' seconds')
        exit(severity_rc)

    data = cl.run(cmd_list)
    cl.close()
    return data