diff --git a/conf/nginx-primaryonly.conf b/conf/nginx-primaryonly.conf index f46a3d45..3826211c 100644 --- a/conf/nginx-primaryonly.conf +++ b/conf/nginx-primaryonly.conf @@ -2,6 +2,7 @@ # Proxy /admin to our Python based control panel daemon. It is # listening on IPv4 only so use an IP address and not 'localhost'. rewrite ^/admin$ /admin/; + rewrite ^/admin/munin$ /admin/munin redirect; location /admin/ { proxy_pass http://127.0.0.1:10222/; proxy_set_header X-Forwarded-For $remote_addr; diff --git a/management/daemon.py b/management/daemon.py index 00cfd717..e821ce36 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -4,7 +4,7 @@ import os, os.path, re, json from functools import wraps -from flask import Flask, request, render_template, abort, Response +from flask import Flask, request, render_template, abort, Response, send_from_directory import auth, utils from mailconfig import get_mail_users, get_mail_users_ex, get_admins, add_mail_user, set_mail_password, remove_mail_user @@ -384,6 +384,17 @@ def backup_status(): from backup import backup_status return json_response(backup_status(env)) +# MUNIN + +@app.route('/munin/') +@app.route('/munin/') +@authorized_personnel_only +def munin(filename=""): + # Checks administrative access (@authorized_personnel_only) and then just proxies + # the request to static files. + if filename == "": filename = "index.html" + return send_from_directory("/var/cache/munin/www", filename) + # APP if __name__ == '__main__': diff --git a/management/templates/index.html b/management/templates/index.html index 4eceb2ed..78e2365f 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -98,9 +98,10 @@
  • SSL Certificates
  • Backup Status
  • - +
  • Custom DNS
  • External DNS
  • +
  • Munin Monitoring