aboutsummaryrefslogtreecommitdiff
path: root/config/monit.conf
blob: 2b77d0ddf35ef42d9d2cd5ee0ca359745117d60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#####################################
#
# For use with Monit:  https://mmonit.com/monit/
#
# New: added search box to top of page
#
# Usage:
#    Use MonitProxy /monit 127.0.0.1 2812
#         ^--- Make Monit server running on 127.0.0.1:2812 available
#              through the parent VirtualHost
#
#####################################
<Macro MonitProxy $path $host $port>
  <Location "$path/">
    ProxyPass "http://$host:$port/"

    RequestHeader unset Accept-Encoding

    SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE

    Substitute "s|href='|href='$path/|in"
    Substitute "s|<meta HTTP-EQUIV='REFRESH' CONTENT=30>||in"
    Substitute "s|<head>|<head><link rel=\"shortcut icon\" href=\"$path/favicon.ico\" /><script type=\"text/javascript\" src=\"https://code.jquery.com/jquery-3.1.1.min.js\"></script>|in"
    Substitute "s|<center>|<script type=\"text/javascript\">function resetSearch() { $(\"#searchtext\").val(\"\"); $(\"#searchtext\").focus(); $(\"span.red-text,span.green-text\").parent(\"td\").parent(\"tr\").show(); } function searchPage() { $(\"span.red-text,span.green-text\").parent(\"td\").parent(\"tr\").hide();$(\"td:contains('\" + $('#searchtext').val() + \"')\").parent(\"tr\").show(); }</script><div style=\"text-align:center;\"><br/>Search Text: <input type=\"text\" id=\"searchtext\" onKeyPress=\"if (event.keyCode == 13) { searchPage(); } \"/><button type=\"button\" onClick=\"if ($('#searchtext').val().length > 0) { searchPage(); }\">Search</button><button type=\"button\" onClick=\"resetSearch();\">Reset</button><button type=\"button\" onClick=\"if (window.location.search == '\?dorefresh') { location.href = location.href.replace('\?dorefresh',''); } else { location.href = location.href + '\?dorefresh'; }\"><script type=\"text/javascript\">if (window.location.search == '\?dorefresh') { document.write('Turn refresh off'); } else { document.write('Turn refresh on'); }</script></button></div><center>|in"
    Substitute "s|<body>|<body onLoad=\"$('#searchtext').focus(); if (window.location.search == '\?dorefresh') { setTimeout(function() { location.href = location.href; }, 30000); }\">|in"
  </Location>

  ProxyPassReverse $path http://$host:port
</Macro>