Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
5008cc60
Commit
5008cc60
authored
Jun 06, 2015
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
merge - munin system monitoring
parents
e9e6d94e
9857db96
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
2 deletions
+48
-2
nginx-primaryonly.conf
conf/nginx-primaryonly.conf
+1
-0
daemon.py
management/daemon.py
+12
-1
index.html
management/templates/index.html
+2
-1
munin.sh
setup/munin.sh
+32
-0
start.sh
setup/start.sh
+1
-0
No files found.
conf/nginx-primaryonly.conf
View file @
5008cc60
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# Proxy /admin to our Python based control panel daemon. It is
# Proxy /admin to our Python based control panel daemon. It is
# listening on IPv4 only so use an IP address and not 'localhost'.
# listening on IPv4 only so use an IP address and not 'localhost'.
rewrite
^/
admin
$ /
admin
/;
rewrite
^/
admin
$ /
admin
/;
rewrite
^/
admin
/
munin
$ /
admin
/
munin
redirect
;
location
/
admin
/ {
location
/
admin
/ {
proxy_pass
http
://
127
.
0
.
0
.
1
:
10222
/;
proxy_pass
http
://
127
.
0
.
0
.
1
:
10222
/;
proxy_set_header
X
-
Forwarded
-
For
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
remote_addr
;
...
...
management/daemon.py
View file @
5008cc60
...
@@ -4,7 +4,7 @@ import os, os.path, re, json
...
@@ -4,7 +4,7 @@ import os, os.path, re, json
from
functools
import
wraps
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
import
auth
,
utils
from
mailconfig
import
get_mail_users
,
get_mail_users_ex
,
get_admins
,
add_mail_user
,
set_mail_password
,
remove_mail_user
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():
...
@@ -384,6 +384,17 @@ def backup_status():
from
backup
import
backup_status
from
backup
import
backup_status
return
json_response
(
backup_status
(
env
))
return
json_response
(
backup_status
(
env
))
# MUNIN
@
app
.
route
(
'/munin/'
)
@
app
.
route
(
'/munin/<path:filename>'
)
@
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
# APP
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
management/templates/index.html
View file @
5008cc60
...
@@ -98,9 +98,10 @@
...
@@ -98,9 +98,10 @@
<li><a
href=
"#ssl"
onclick=
"return show_panel(this);"
>
SSL Certificates
</a></li>
<li><a
href=
"#ssl"
onclick=
"return show_panel(this);"
>
SSL Certificates
</a></li>
<li><a
href=
"#system_backup"
onclick=
"return show_panel(this);"
>
Backup Status
</a></li>
<li><a
href=
"#system_backup"
onclick=
"return show_panel(this);"
>
Backup Status
</a></li>
<li
class=
"divider"
></li>
<li
class=
"divider"
></li>
<li
class=
"dropdown-header"
>
Advanced
Option
s
</li>
<li
class=
"dropdown-header"
>
Advanced
Pages
s
</li>
<li><a
href=
"#custom_dns"
onclick=
"return show_panel(this);"
>
Custom DNS
</a></li>
<li><a
href=
"#custom_dns"
onclick=
"return show_panel(this);"
>
Custom DNS
</a></li>
<li><a
href=
"#external_dns"
onclick=
"return show_panel(this);"
>
External DNS
</a></li>
<li><a
href=
"#external_dns"
onclick=
"return show_panel(this);"
>
External DNS
</a></li>
<li><a
href=
"/admin/munin"
>
Munin Monitoring
</a></li>
</ul>
</ul>
</li>
</li>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
...
...
setup/munin.sh
0 → 100755
View file @
5008cc60
#!/bin/bash
# Munin: resource monitoring tool
#################################################
source
setup/functions.sh
# load our functions
source
/etc/mailinabox.conf
# load global vars
# install Munin
apt_install munin munin-node
# edit config
cat
>
/etc/munin/munin.conf
<<
EOF
;
dbdir /var/lib/munin
htmldir /var/cache/munin/www
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
includedir /etc/munin/munin-conf.d
# a simple host tree
[
$PRIMARY_HOSTNAME
]
address 127.0.0.1
# send alerts to the following address
contacts admin
contact.admin.command mail -s "Munin notification
${
var
:host
}
" administrator@
$PRIMARY_HOSTNAME
contact.admin.always_send warning critical
EOF
# generate initial statistics so the directory isn't empty
sudo
-u
munin munin-cron
setup/start.sh
View file @
5008cc60
...
@@ -145,6 +145,7 @@ source setup/webmail.sh
...
@@ -145,6 +145,7 @@ source setup/webmail.sh
source
setup/owncloud.sh
source
setup/owncloud.sh
source
setup/zpush.sh
source
setup/zpush.sh
source
setup/management.sh
source
setup/management.sh
source
setup/munin.sh
# Ping the management daemon to write the DNS and nginx configuration files.
# Ping the management daemon to write the DNS and nginx configuration files.
while
[
!
-f
/var/lib/mailinabox/api.key
]
;
do
while
[
!
-f
/var/lib/mailinabox/api.key
]
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment