Skip to content

Instantly share code, notes, and snippets.

@dploeger
Last active June 16, 2020 09:35
Show Gist options
  • Save dploeger/3ad7dbc7f22d9e1f5991b0553fa569c0 to your computer and use it in GitHub Desktop.
Save dploeger/3ad7dbc7f22d9e1f5991b0553fa569c0 to your computer and use it in GitHub Desktop.
Tampermonkey script to ring a bell an xymon alerts
// ==UserScript==
// @name Alarm on Xymon alert
// @namespace https://kps.com/
// @version 0.2
// @description Run an alert on Xymon reds
// @author Dennis Ploeger <dennis.ploeger@kps.com>
// @grant none
// @downloadUrl https://gist.githubusercontent.com/dploeger/3ad7dbc7f22d9e1f5991b0553fa569c0/raw
// @updateUrl https://gist.githubusercontent.com/dploeger/3ad7dbc7f22d9e1f5991b0553fa569c0/raw
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require https://unpkg.com/tone
// ==/UserScript==
(function() {
'use strict';
if (document.body.className === 'red') {
var synth = new Tone.Synth().toMaster()
synth.triggerAttackRelease('C5', '8n')
synth.triggerAttackRelease('C6', '8n')
}
// Stop Autoreloading the page
window.setTimeout(() => {window.stop()}, 500)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment