Tiny Core Base > Micro Core
How do I get microcore to sound a System Bell Beep?
mrstarr:
I can't get my microcore installation to sound a system beep (Control-G) from the BASH shell to save my life.
I installed alsa with 'ab' app browser. Plugged speakers into external speaker jack (just in case there was no onboard pc speaker). What else can I try? What else do I need to install? Is there any other way to make sound? (or how else can I kludge around this so I get some kind of audible or other alert from a monitor/headless pc short of having it email another device(grr))
http://unix.stackexchange.com/questions/1974/how-do-i-make-my-pc-speaker-beep
http://forum.tinycorelinux.net/index.php/topic,15098.msg86568.html#msg86568
What I am trying to do, is write a Ping Monitoring Bash script, that will ping the IP of my servers about every minute and beep if any one of them is down:
--- Code: ---#!/bin/bash
# script to ping ip of servers and check if they are up or down, and beep if they aren't
# usage:
# ./check_hosts.sh google.com yahoo.com 192.168.1.2 mylinuxbox N2100
# ./check_hosts.sh 71.226.8.1 192.168.2.1 192.2.11 192.168.1.1 192.168.2.3
while :
do
for i in $@
do
ping -c 1 $i &> /dev/null
if [ $? -ne 0 ]; then
echo "`date`: ping failed, $i host is down!"
echo -ne '/07' # beep = echo -ne '/07'
fi
done
sleep 60
done
--- End code ---
gerald_clark:
echo -ne "\007"
mrstarr:
Flipping the slash \/ didn't help. With or without external speakers plugged in.
I just found the on board speaker, so that verifies that at least exists.
What package contains the "beep" command, maybe that would help. AB "contains" search did not turn up anything.
I installed oss, oss-alsa, and alsa...
Also, is there a simple way to generate a sound, like a simple way to play a .wav or other sound type file... with those sound packages installed?
gerald_clark:
The command I gave you works.
mrstarr:
Pictures of my 5 year old Microcore Webserver/Samba server, running on a fanless HP5135 (400mghz, 110mb RAM, 8 watts), that this script would run on. These pictures are hosted on same webserver pictured...
Speaker:
I have 7 wifi routers and boxes on a 10 acre farm, that are all linked together in a string in what I call RadioLan... to get high speed internet from one end of the farm to the other (over a field, across a pond, through a yard, etc). To get high speed internet at the furthest point, a packet goes through a Linksys Wifi Router connected to a DWL-2100 ap, which is connected (for upstream internet) as client to Cisco Wifi router, which itself is connected to a DWL-2100 as client, which is connects to a Belkin configured as AP, which itself connects to Dlink Gaming router, then Cablemodem (then network gateway).
Of course, if any one of these networking wifi boxes goes down, and since they are all a mishmash of consumer grade hardware, exposed to extremes of temperature and interference... well... reliability is less than optimal.
I polished my ping kludge script in initial post to actually work (yeah I know original post code is rife with errors, I was typing from memory, can't copy and paste from microcore box) and format output nicely and it works great... except I need an audible alert if one box don't respond, so then I can turn on the monitor, and see which it is.
There is a Win equivalent of such an app called Peer Monitor, and it works just as great, but it'd be great if I could use my script on the microcore all solid state box since its on 24/7/365 already.
Micocore has worked great on this box all these years. Sometimes the webserver on the microcore box dies for no reason, and httpd -restart won't work cause of locked sockets, so I have to reboot it with "sudo reboot" or cntrl alt delete every two weeks or so. Have yet to figure out why... :-/
Navigation
[0] Message Index
[#] Next page
Go to full version