Last active
June 16, 2020 09:35
-
-
Save dploeger/3ad7dbc7f22d9e1f5991b0553fa569c0 to your computer and use it in GitHub Desktop.
Tampermonkey script to ring a bell an xymon alerts
This file contains hidden or 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
// ==UserScript== | |
// @name Alarm on Xymon alert | |
// @namespace https://kps.com/ | |
// @version 0.2 | |
// @description Run an alert on Xymon reds | |
// @author Dennis Ploeger <[email protected]> | |
// @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