#!/bin/bash set -e # configutarion watchdog_name=ALARM watchdog_host="http://localhost" script_path="/usr/share/sysal/bin" export PATH=$PATH:.:$script_path # this command uses SNMP #triggerWatchdogAtWagnerTech # this command uses curl triggerWatchdog_REST $watchdog_host/sysal/rest $watchdog_name $(hostname) time=$(ping -w 2 -q wagnertech.de | cut -d "/" -s -f5 | cut -d "." -f1) if [ $? -ne 0 ] then set_alarm NoInternetConnection exit fi reset_alarm NoInternetConnection set_alarm SlowInternetConnection $time