The meaning is this, I want to write not a big creak that will go to a remote server and ping a large number of devices, it will not ping through normal ping, but through running the script on a remote server, i.e. my creak goes to the server and starts blablabla.sh 192.168.1.1, but this is not important. The bottom line is that when performing ping through a scratch on the server, an error is not returned to me if the device is available the script responds: Looking for OpenVPN client with MAC CCCCCCCCCCC... found! if the device is not available then: Looking for OpenVPN client with MAC CCCCCCCCCCC... not found! So the question is this: is it possible to somehow check print for its output, if found there! or not found! That, respectively, the creak writes is working or not working. Devices will be much more than 100 pcs.
import paramiko import re import time host = 'IP' user = 'LOGIN' port = PORT ssh = 'PATH' a = 'NAME1' a1 = 'NAME2' a2 = 'NAME3' client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname=host, username=user, port=port, key_filename=ssh) stdin, stdout, stderr = client.exec_command('sudo ping_sens.sh CCCCCCCCCC') data = stdout.read() + stderr.read() print(data) Conclusion: Looking for OpenVPN client with MAC CCCCCCCCCC... found!