18

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?

3

3 Answers 3

9

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

Normally beep is using your pc speaker, not terminal bell

8
  • 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 :) Apr 19, 2013 at 7: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. Apr 19, 2013 at 7: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? Apr 19, 2013 at 7:47
  • Yes, If your terminal is configured correctly then it will play sound or flash screen Apr 19, 2013 at 7:52
  • 1
    I don't use putty... Apr 19, 2013 at 8:00
4

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'
1

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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .