This topic is very old and I'm almost ashamed by my bash skills back then. Anyway to make the alarm work you need mpg321 on the computer running the script and a sound file named alarm.mp3 in the same folder.
sudo apt-get install mpg321
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
sudo apt-get install mpg321
#! /bin/bash
printf '\033]2;%s\007' "Network Monitor"
if curl --connect-timeout 30 --silent --head http://www.google.com/ |egrep "20[0-9] Found|30[0-9] Found" >/dev/null
then
echo Internet status: OK
else
printf '\033]2;%s\007' "**** ALERT ****"
echo Internet status: ERROR
mpg321 alarm.mp3 &> /dev/null
fi
if curl --connect-timeout 30 --silent --head http://BAMTworkerIP/ |egrep "20[0-9] OK|30[0-9] OK" >/dev/null # *** Don't forget to edit http address ***
then
echo Miner status: OK
else
printf '\033]2;%s\007' "**** ALERT ****"
echo Miner status: ERROR
mpg321 alarm.mp3 &> /dev/null
fi
## You can add a worker by uncommenting this section
#
# if curl --connect-timeout 30 --silent --head http://BAMTworkerIP 2/ |egrep "20[0-9] OK|30[0-9] OK" >/dev/null
# then
# echo Miner 2 status: OK
#
# else
# printf '\033]2;%s\007' "**** ALERT ****"
# echo Miner 2 status: ERROR
# mpg321 alarm.mp3 &> /dev/null
# fi
##
sleep 60
clear
./alarm.sh
sudo apt-get install curl mpg321
@echo off
cls
TITLE Network Monitor
ping -n 1 -w 30000 google.com >NULL
if %errorlevel% == 0 echo Internet status: OK
if %errorlevel% == 1 echo Internet status: ERROR
if %errorlevel% == 1 TITLE *** ALERT ***
if %errorlevel% == 1 mpg123.exe alarm.mp3 2>NULL
REM *** IMPORTANT EDIT BAMTminerIP ***
ping -n 1 -w 30000 BAMTminerIP >NULL
if %errorlevel% == 0 echo Miner status: OK
if %errorlevel% == 1 echo Miner status: ERROR
if %errorlevel% == 1 TITLE *** ALERT ***
if %errorlevel% == 1 mpg123.exe alarm.mp3 2>NULL
REM *** Remove "REM" from next section to add a worker ***
REM ping -n 1 -w 30000 BAMTminerIP2 >NULL
REM if %errorlevel% == 0 echo Miner 2 status: OK
REM if %errorlevel% == 1 echo Miner 2 status: ERROR
REM if %errorlevel% == 1 TITLE *** ALERT ***
REM if %errorlevel% == 1 mpg123.exe alarm.mp3 2>NULL
ping 1.0.0.0 -n 1 -w 60000 >NULL
alarm.bat