|
/Admin/Monitoring/munin:
Turn on the Apache Munin Plugins
You need to enable extended status on Apache. Assuming the status module is enabled, create another file /etc/apache2/conf.d/extendedStatus containing the following:
ExtendedStatus On SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 localhost
(Note that /etc/apache2/mods-enabled/status.conf contains some of the above, but may not be enough.)
Restart Apache, and now on the server itself, if you use a terminal-based web browser like w3m, for instance, this
w3m localhost/server-status
should show you Apache's status page. And now these plugins should work:
apache_accesses -> /usr/share/munin/plugins/apache_accesses
apache_processes -> /usr/share/munin/plugins/apache_processes
apache_volume -> /usr/share/munin/plugins/apache_volume
And finally, if due to some insoluble weirdness in your Apache configuration you cannot get it working, I have found (thanks to [1]) that putting the status stuff on another port can work, ie. /etc/apache2/mods-enabled/status.conf:
# # Allow server status reports generated by mod_status, # with the URL of http://servername/server-status # Uncomment and change the ".example.com" to allow # access from other hosts. # Listen 8001 ExtendedStatus On SetHandler server-status Order deny,allow Deny from all Allow from localhost ip6-localhost # Allow from .example.com
Then in the tree /usr/share/munin/plugins/apache_* files, replace
my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
with
my @PORTS = (8001);
And hopefully you are good to go.
[1] http://serverfault.com/questions/200320/apache-server-status-403-at-non-standard-port
posted at: 09:04 | path: /Admin/Monitoring/munin | permanent link to this entry
/Admin/Monitoring/munin:
Server Monitoring for Dummies
Munin[1] is almost trivial to install and configure. You need two servers, one to be monitored (client) and one to do the monitoring (master). On a Debian/Ubuntu system, install Munin:
apt-get install munin-node (on the client)
apt-get install munin munin-node (on the master)
I recommend installing munin-node on the master too, not only to monitor, but to get monitoring working on localhost before playing with ports and firewalls. On my Debian master, localhost monitoring worked out of the box. The only complication: documentation says to point your browser at http://master/munin/ to see the output graphs. On Debian, Apache barfs if your web browser is not on the master machine. You need to edit /etc/apache2/conf.d/munin and replace the "Allow from 127.0.0.1" with an "Allow from all".
On the client machine, open port 4949. Edit /etc/munin/munin-node.conf so that the "allow" line specifies the IP address of your master machine. Restart the munin-node daemon so your change takes effect. And now monitoring should be working for your remote machine (the client / node).
Note that on the master machine, the Munin master is not a daemon but a cron entry. On my Debian machine it fires every five minutes by default, so you have to wait for up to five minutes to see changes take effect in the displayed graphs.
One other thing you probably want to do is to add to or reduce the number of things you are collecting data for and monitoring. This is done very simply in the /etc/munin/plugins/ directory of the client node. Add links for plugins you want to add to monitoring (and do not forget to restart the munin-node daemon). Delete links for data items you do not want to monitor.
One possibly useful utility is:
munin-node-configure --suggest
which will list all the installed plugins, tell you whether they are turned on, and make a best guess as to whether they would be useful if you were to turn them on.
[1] http://munin-monitoring.org/wiki/Documentation
posted at: 13:50 | path: /Admin/Monitoring/munin | permanent link to this entry