-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve keepalived alert script and add some comments (#139)
At the ICPC WFs in Egypt the correct sound card to use is 0; just try to set the volume on both 0 and 1. Also try beep and send a desktop notification. Co-authored-by: DOMjudge team <[email protected]>
- Loading branch information
Showing
3 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
provision-contest/ansible/roles/keepalived/files/alerting/bin/alerting.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# Try a couple of different notification methods. | ||
|
||
notify-send -u critical -t 60000 "Alert: keepalived status changed at $(date '+%T') !" | ||
|
||
amixer -c 0 set Master 100% | ||
amixer -c 1 set Master 100% | ||
|
||
for i in 1 2 3 4 5 6 7 8 9 10 ; do | ||
aplay /usr/share/sounds/sound-icons/pipe.wav | ||
done | ||
|
||
beep -f 500 -l 400 -d 100 -r 4 | ||
beep -f 1000 -l 400 -d 100 -r 4 | ||
beep -f 500 -l 200 -d 100 -r 6 |
5 changes: 5 additions & 0 deletions
5
provision-contest/ansible/roles/keepalived/files/alerting/bin/trigger_alert.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# This only copies the script below which contains alerting code | ||
# A desktop autostart application started the alert_listener.sh | ||
# script, which then detects the copy and executes it. | ||
|
||
cp ~/bin/alerting.sh.template ~/alerting.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters