16

While i'm connected to a server via ssh, i want to be alerted for some events. BUT not via email.

I would rather use beep for that alert.

However, if i put beep as a reaction, it will beep on server which of course i can't hear :D

Is there any way to get alert, simply, and not by using email or any other complex alerting system?

mariotanenbaum
  • 372
  • 3
  • 14

3 Answers3

9

Create alias for beep to echo -en "\007" (beep (bell) character)

Normally beep is using your pc speaker, not terminal bell

Marek Wajdzik
  • 421
  • 2
  • 4
  • 1
    I'm afraid you didn't understand what i need. I'm connected from my local PC to a server via ssh. The terminal is always open although i don't watch what is going on there. I want to be warned with beep when something happens there. However, if i run beep on remote server after some event that i catch, it will beep on server WHICH IS in another country :) – mariotanenbaum Apr 19 '13 at 07:29
  • Yes, I understand. Set bell in your terminal emulator (wich you use for ssh connection, and execute echo -en "\007"). You should hear bell. – Marek Wajdzik Apr 19 '13 at 07:41
  • Hm, it doesn't work. If i understood you correctly, i create alias alias beep='echo -en "\007"' locally, connect to a remote server, and whatever beep happens on remote server, i'll hear that on my local machine? – mariotanenbaum Apr 19 '13 at 07:47
  • Yes, If your terminal is configured correctly then it will play sound or flash screen – Marek Wajdzik Apr 19 '13 at 07:52
  • It doesn't work for me... I don't know what is "correctly configured terminal" too. – mariotanenbaum Apr 19 '13 at 07:55
  • PuTTY: Terminal -> Bell in the settings, and set “Taskbar/caption indication on bell – Marek Wajdzik Apr 19 '13 at 07:57
  • 1
    I don't use putty... – mariotanenbaum Apr 19 '13 at 08:00
  • @MarekWajdzik Works here. SSH to remote host, run ` echo -en "\007" ` and there is the beep. I wonder whether there is an advanced version, such as pronouncing some text on the local speaker ? I mean, if there are many beeps, it is hard to tell which is which. – SOUser Aug 04 '14 at 13:19
3

This worked for me on both OSX and a remote unix server, beeping through the normal sound output: echo -e '\a'

beep(){ echo -e '\a';}
beep
sleep 5 & beep # beeps now
sleep 5; beep # beep in 5s
# same thing using ruby -e 'sleep 5'
Rivenfall
  • 131
  • 2
0

I know, old thread, but... In a Windows machine putty sounds the bell characters via Windows' default beep using the PC speakers, not the motherboard buzzer. Maybe you are using an old speakerless PC to monitor servers, like I'm doing?