1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-22 02:17:26 +00:00

needed libcgi-fast-perl and chown log files

This commit is contained in:
mike 2016-01-13 23:55:45 -05:00
parent 6d6f3ea391
commit 8932aaf4ef
2 changed files with 9 additions and 17 deletions

View File

@ -514,33 +514,20 @@ def munin(filename=""):
@authorized_personnel_only @authorized_personnel_only
def munin_cgi(filename=""): def munin_cgi(filename=""):
""" Relay munin cgi dynazoom requests """ Relay munin cgi dynazoom requests
/usr/lib/munin/cgi/munin-cgi-graph is a perl cgi script in the munin package /usr/lib/munin/cgi/munin-cgi-graph is a perl cgi script in the munin package
that is responsible for generating binary png images _and_ associated HTTP that is responsible for generating binary png images _and_ associated HTTP
headers based on parameters in the requesting URL. All output is written headers based on parameters in the requesting URL. All output is written
to stdout which munin_cgi splits into response headers and binary response to stdout which munin_cgi splits into response headers and binary response
data. data.
munin-cgi-graph reads environment variables as well as passed input to determine
munin-cgi-graph reads environment variables as well as passed input to determin
what it should do. It expects a path to be in the env-var PATH_INFO, and a what it should do. It expects a path to be in the env-var PATH_INFO, and a
querystring to be in the env-var QUERY_STRING as well as passed as input to the querystring to be in the env-var QUERY_STRING as well as passed as input to the
command. command.
munin-cgi-graph has several failure modes. Some write HTTP Status headers and
munin-cgi-graph has several failure modes. Some write HTTP 404 Status headers others return nonzero exit codes.
and others return nonzero exit codes. munin_cgi has some basic handling, and
logs errors to app.logger.
= Reasoning =
Situating munin_cgi between the user-agent and munin-cgi-graph enables keeping Situating munin_cgi between the user-agent and munin-cgi-graph enables keeping
the cgi script behind mailinabox's auth mechanisms and avoids additional the cgi script behind mailinabox's auth mechanisms and avoids additional
support infrastructure like spawn-fcgi. support infrastructure like spawn-fcgi.
= Configuration =
A single configuration change is all that is required to enable the
functionality of munin_cgi. In the munin.conf file (/etc/munin/munin.conf) add
the following line above your server listings:
`cgiurl_graph /admin/munin/cgi-graph`
This will tell munin to override the default path for dynazoom requests.
""" """
COMMAND = 'su - munin --preserve-environment --shell=/bin/bash -c "/usr/lib/munin/cgi/munin-cgi-graph \'%s\'"' COMMAND = 'su - munin --preserve-environment --shell=/bin/bash -c "/usr/lib/munin/cgi/munin-cgi-graph \'%s\'"'

View File

@ -7,7 +7,8 @@ source /etc/mailinabox.conf # load global vars
# install Munin # install Munin
echo "Installing Munin (system monitoring)..." echo "Installing Munin (system monitoring)..."
apt_install munin munin-node apt_install munin munin-node libcgi-fast-perl
# libcgi-fast-perl is needed by /usr/lib/munin/cgi/munin-cgi-graph
# edit config # edit config
cat > /etc/munin/munin.conf <<EOF; cat > /etc/munin/munin.conf <<EOF;
@ -32,6 +33,10 @@ contact.admin.command mail -s "Munin notification ${var:host}" administrator@$PR
contact.admin.always_send warning critical contact.admin.always_send warning critical
EOF EOF
# The Debian installer touches these files and chowns them to www-data:adm for use with spawn-fcgi
chown munin. /var/log/munin/munin-cgi-html.log
chown munin. /var/log/munin/munin-cgi-graph.log
# ensure munin-node knows the name of this machine # ensure munin-node knows the name of this machine
tools/editconf.py /etc/munin/munin-node.conf -s \ tools/editconf.py /etc/munin/munin-node.conf -s \
host_name=$PRIMARY_HOSTNAME host_name=$PRIMARY_HOSTNAME