Ping Server

Posted on
Sat Nov 17, 2018 2:08 am
davinci offline
Posts: 249
Joined: Feb 14, 2015

Ping Server

Just in case someone is looking for a simple script to ping servers:
Code: Select all
import os
hostname = "SERVER_IP"
response = os.system("/sbin/ping -c 1 " + hostname)

if response == 0:
    indigo.variable.updateValue(VAR_ID, "true")
    indigo.server.log("Ping: Server is online")
else:
    indigo.variable.updateValue(VAR_ID, "false")
    indigo.server.log("Ping: Server is offline")

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest