Basically I am writing a script in Python that will check for me the status of my servers. I need it to ping five different IPs and then detect what the output is. I will then need an if statement for example:
import.os
Server1 = os.system('ping 123.123.123.123')
if Server1 == 'Request timed out':
print('Server 1 is down.')
else:
print('Server 1 is up.')
I am not exactly sure how to go about this. Let me know.
Thanks.