Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you change the tone of the bell, echo "\a", ?

Status
Not open for further replies.

squash

MIS
May 21, 2001
99
US
I monitor about 20 different SUN boxes spread across 5 Exceed CDT screens. I have set up several scripts to do a lot of my dirty work like diskspace, cpu, swapspace, error file checking etc. In these scripts I use the bell command to get my attention when needed.

Q. Is there a way to change the tone of the standard bell?

i.e. echo "\a" or echo "\07"

I have searched many web pages and man pages without any luck,

As always we thank you for your support
 
This may help you. In OS X, there is a preference for alert sounds in general. I have changed my alert sound to a different one and done the echo "\a". The alert sound I chose was played. I chose a different one and that sound played. So perhaps on your unix platform (OS X is BSD) there is a sound/alert sound manager which can let you change it.

Worth a try at least.

Kind regards
Ron Holmes
 
Ron,
If I were on a true sun workstation then yes that would sortof work for me.
However I am using Exceed to emulate the SUN workstation.

But thankx for the thought.

 
On Sun Solaris, there's an audio file player utility called [tt]audioplay[/tt]. Solaris also has a little audio file recording utility, [tt]soundtool[/tt] I think. Not sure if you can get it to come through Exceed, but the basic pieces are there to have the system that's trying to get your attention say it's own name! Just record yourself saying each system's name, then have your script that monitoring each system play the audio clip of the system's name. Too Cool!

It would be worth the effort experimenting to get it to work just for the cool factor of making your computers talk to you. Maybe give each one a different personality and voice!

Too Fun!

 
I like the way you think SB, and I will look into this.
Would be lots of fun.
Thankx
Doug
 
Oh squashman! I got yer beeps right here!

I just found the sound files. On my Solaris 8 boxes, there's a directory [tt]/usr/demo/SOUND[/tt]. There's a bunch of stuff there, but there are some sample sounds in a subdirectory. Check out what's there...
[tt]
$ pwd
/usr/demo/SOUND/sounds
$ ls -la
total 1594
drwxrwxr-x 2 root bin 1024 May 7 2002 .
drwxrwxr-x 9 root bin 512 May 7 2002 ..
-rw-r--r-- 1 root bin 2407 Apr 6 1999 bark.au
-rw-r--r-- 1 root bin 12494 Apr 6 1999 bong.au
-rw-r--r-- 1 root bin 31251 Apr 6 1999 bubbles.au
-rw-r--r-- 1 root bin 7932 Apr 6 1999 busy.au
-rw-r--r-- 1 root bin 13169 Apr 6 1999 chirp.au
-rw-r--r-- 1 root bin 8439 Apr 6 1999 clink.au
-rw-r--r-- 1 root bin 21745 Apr 6 1999 computer.au
-rw-r--r-- 1 root bin 12874 Apr 6 1999 cowbell.au
-rw-r--r-- 1 root bin 13930 Apr 6 1999 crash.au
-rw-r--r-- 1 root bin 6400 Apr 6 1999 cuckoo.au
-rw-r--r-- 1 root bin 1648 Apr 6 1999 dialtone.au
-rw-r--r-- 1 root bin 17592 Apr 6 1999 doorbell.au
-rw-r--r-- 1 root bin 759 Apr 6 1999 drip.au
-rw-r--r-- 1 root bin 1812 Apr 6 1999 fastbusy.au
-rw-r--r-- 1 root bin 44182 Apr 6 1999 flush.au
-rw-r--r-- 1 root bin 42068 Apr 6 1999 gong.au
-rw-r--r-- 1 root bin 20760 Apr 6 1999 laugh.au
-rw-r--r-- 1 root bin 52674 Apr 6 1999 laughter.au
-rw-r--r-- 1 root bin 39159 Apr 6 1999 ring.au
-rw-r--r-- 1 root bin 14753 Apr 6 1999 rooster.au
-rw-r--r-- 1 root bin 323888 Apr 6 1999 sample.au
-rw-r--r-- 1 root bin 48072 Apr 6 1999 spacemusic.au
-rw-r--r-- 1 root bin 8961 Apr 6 1999 splat.au
-rw-r--r-- 1 root bin 1010 Apr 6 1999 touchtone.0.au
-rw-r--r-- 1 root bin 946 Apr 6 1999 touchtone.1.au
-rw-r--r-- 1 root bin 1039 Apr 6 1999 touchtone.2.au
-rw-r--r-- 1 root bin 993 Apr 6 1999 touchtone.3.au
-rw-r--r-- 1 root bin 1006 Apr 6 1999 touchtone.4.au
-rw-r--r-- 1 root bin 1016 Apr 6 1999 touchtone.5.au
-rw-r--r-- 1 root bin 1048 Apr 6 1999 touchtone.6.au
-rw-r--r-- 1 root bin 980 Apr 6 1999 touchtone.7.au
-rw-r--r-- 1 root bin 1064 Apr 6 1999 touchtone.8.au
-rw-r--r-- 1 root bin 989 Apr 6 1999 touchtone.9.au
-rw-r--r-- 1 root bin 967 Apr 6 1999 touchtone.pound.au
-rw-r--r-- 1 root bin 1027 Apr 6 1999 touchtone.star.au
-rw-r--r-- 1 root bin 12920 Apr 6 1999 train.au
-rw-r--r-- 1 root bin 12622 Apr 6 1999 whistle.au
$
[/tt]
Awesome!!!! The command is...
[tt]
$ audioplay -v 100 soundfile.au
[/tt]
I've also found a bunch of sample sounds, converters, and players for other operating systems with just a quick google search.

This is too funny!!!

 
Cool,

I remember this in Solaris. I should have mentioned that too. SB you seem to be the guru in these parts.

Cheers
Ron Holmes
 
Guru?!? Aw shucks, twarnt nothin'! Just enjoy being helpful. Tek-Tips is my favorite puzzle site. Some people do crosswords, I answer Tek-Tips questions (the ones I can at least).

These sounds can actually be pretty useful. I used to have a DEC workstation on my desk, but other people could log into it over the network. I remember I had put a command into the system login file that would make it "Moo" whenever someone logged on. That way I would know to check before rebooting it or doing anything else that might disrupt the "visitor".

 
Doh,
So close !
On most of my sun boxes I have those files also. On some of the boxes they are in a different directory.

However when I try to use audioplay I get the response

sipcp021wa:/usr/demo/SOUND/sounds >audioplay -v 100 bong.au
audioplay: cannot stat /dev/audio: No such file or directory

So I must have to set up a device for this. But again I am using Exceed to get an X-Window to the Sun Box so I may not be able to play this device.

I look around more on the web maybe exceed site has some pointers.

I will tell you though I did get very excited when I read your post.

:)

Thankx
Doug
 
Don't give up! This is too fun too give up on!

Checking the permissions on the sound device...
[tt]
# ls -l /dev/audio
lrwxrwxrwx 1 root root 7 May 7 2002 /dev/audio -> sound/0
# ls -l /dev/sound/0
lrwxrwxrwx 1 root root 57 May 7 2002 /dev/sound/0 -> ../../devi
ces/sbus@1f,0/SUNW,CS4231@d,c000000:sound,audio
# ls -l /devices/sbus@1f,0/SUNW,CS4231@d,c000000:sound,audio
crw------- 1 root other 108, 0 May 7 2002 /devices/sbus@1f,0/SUNW,CS
4231@d,c000000:sound,audio
#
[/tt]
The "device" [tt]/dev/audio[/tt] is a link to the "device" [tt]/dev/sound/0[/tt], or the first sound device (a machine can have more than one sound device). The "device" [tt]/dev/sound/0[/tt] is a link to the device [tt]/devices/sbus@1f,0/SUNW,CS4231@d,c000000:sound,audio[/tt]. The owner of the actual device seems to change to be the userid of whoever is logged onto the console, so only that user, or [tt]root[/tt] has read write access to the device ([tt]crw-------[/tt]).

Try it from the console or as [tt]root[/tt] and see if you get anything!

 
Well,
I have not given up.
Cool your having fun, I also like a challange.
ok here is what i have so far.

sipcp021wa:root:/dev >ls -l aud*
aud*: No such file or directory
sipcp021wa:root:/dev >ls -l soun*
soun*: No such file or directory
sipcp021wa:root:/dev >cd /devices
sipcp021wa:root:/devices >ls -l
total 28
drwxr-xr-x 3 root sys 512 Jul 3 2002 central@1f,0
drwxr-xr-x 2 root sys 512 Jul 3 2002 fhc@0,f8800000
drwxr-xr-x 2 root sys 512 Jul 3 2002 fhc@4,f8800000
drwxr-xr-x 2 root sys 6656 Nov 11 10:46 pseudo
drwxr-xr-x 3 root sys 512 Jul 3 2002 sbus@2,0
drwxr-xr-x 3 root sys 512 Jul 3 2002 sbus@3,0
drwxr-xr-x 3 root sys 512 Jul 3 2002 sbus@6,0
drwxr-xr-x 3 root sys 512 Jul 3 2002 sbus@7,0


As you can see it looks like the device is not present on this server as well as several others which I have root access too.

Darn it.
I don't have the ability to set up a device on these systems. As they are owned by a large corp and I am just a lowly sysadmin. :)

Your move (hee hee)
This is kind of a cool game.
I will be out of the office for a couple of days but will check back.
Thankx
Doug
 
Well, I think what I would do is get rid of the Exceed/PC thing for monitoring these systems. I would get a little Sun workstation that DOES have sound capability. Then, when one of your systems needs to get your attention, it could [tt]rsh[/tt] to your workstation to make the appropriate sound. You could also make this system be the loghost for all of the machines you're monitoring, so you've got all important syslog info at your fingertips.

Small workstations don't cost much and anyone should be able to get one with a little creative justification.

 
You might want to try the xset command.
xset b 50 1000 100 would set (xset) the bell (b) to 50% amplitude, 1000 Hz for 100 milliseconds. Not guaranteed to work across all terminal types.
 
Sambones,
Unfortunatly I am a lowly contractor. Getting hardware is not an option. But I do appreciate the thought.

Caallison,
Ill look into xset, thx

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top