Skip to content

Commit 970274e

Browse files
DOMjudge teammeisterT
DOMjudge team
authored andcommitted
Improve keepalived alert script and add some comments
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.
1 parent d5522ff commit 970274e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3+
# Try a couple of different notification methods.
4+
5+
notify-send -u critical -t 60000 "Alert: keepalived status changed at $(date '+%T') !"
6+
7+
amixer -c 0 set Master 100%
38
amixer -c 1 set Master 100%
49

510
for i in 1 2 3 4 5 6 7 8 9 10 ; do
611
aplay /usr/share/sounds/sound-icons/pipe.wav
712
done
13+
14+
beep -f 500 -l 400 -d 100 -r 4
15+
beep -f 1000 -l 400 -d 100 -r 4
16+
beep -f 500 -l 200 -d 100 -r 6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
3+
# This only copies the script below which contains alerting code
4+
# A desktop autostart application started the alert_listener.sh
5+
# script, which then detects the copy and executes it.
6+
27
cp ~/bin/alerting.sh.template ~/alerting.sh

Diff for: provision-contest/ansible/roles/keepalived/tasks/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
# These tasks install keepalived with IP failover
33

4-
- name: Install keepalived
4+
- name: Install keepalived and beep (for alerting)
55
apt:
66
state: present
77
pkg:
88
- keepalived
9+
- beep
910

1011
- name: Configure keepalived for domjudge IP failover
1112
template:

0 commit comments

Comments
 (0)