{{tag>Brouillon}}
= Install de Munin sur RedHat /CentOS
Source : http://tecadmin.net/installing-munin-in-centos-rhel-and-fedora/
Install
yum install epel-release
yum --enablerepo=epel install munin munin-node rrdtool
Changement binding sur localhost (inutile d'écouter sur les cartes réseaux, car on communique en localhost)
sed -i -e 's/^host \*/host 127.0.0.1/' /etc/munin/munin-node.conf
Création MDP
htpasswd -cm /etc/munin/munin-htpasswd muninadmin
Nous ajoutons dans le fichier /etc/httpd/conf.d/munin.conf la ligne suivante :
''/etc/httpd/conf.d/munin.conf''
Alias /munin /var/www/html/munin
Sur ma conf j'ai dû aussi ajouter un ''DirectoryIndex index.html''
Normalement ça devrait ressembler à :
''/etc/httpd/conf.d/munin.conf''
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/www/html/munin) must have "AllowOverride all" or something close
# to that set.
#
# As a config file enclose it in like so:
#
AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user
# This next part requires mod_expires to be enabled.
#
# We could use around here, but I want it to be
# as evident as possible that you either have to load mod_expires _or_
# you coment out/remove these lines.
# Set the default expiery time for files 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
ExpiresActive On
ExpiresDefault M310
# Ajout
DirectoryIndex index.html
ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph
AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user
# Ajout
Alias /munin /var/www/html/munin
systemctl enable munin-node
systemctl start munin-node
En vérifie que la conf est ok
apachectl -t
Si ok
systemctl reload httpd
NB, les graphes sont générés grâce à la cron ''/etc/cron.d/munin''
== Notes brouillon
CentOS6
=== MySQL
ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins/
service munin-node restart
''/etc/munin/plugin-conf.d/munin-node''
[diskstats]
user munin
[iostat_ios]
user munin
[mysql*]
user root
env.mysqlopts --defaults-extra-file=/var/lib/munin/.my.cnf
''/var/lib/munin/.my.cnf''
[mysqldump]
user=root
password=P@ssw0rd
[mysql]
user=root
password=P@ssw0rd
[mysqladmin]
user=root
password=P@ssw0rd
[mysqlshow]
user=root
password=P@ssw0rd
chown munin:munin /var/lib/munin/.my.cnf
chmod 600 /var/lib/munin/.my.cnf
service munin-node restart
=== Apache
''/etc/httpd/conf/httpd.conf''
LoadModule status_module modules/mod_status.so
ExtendedStatus On
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 ::1
service httpd restart
ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins/
service munin-node restart
== Pb MySQL bug : mysql innodb free tablespace
Voir :
* https://forums.cpanel.net/threads/munin-plugin-warn-mysql-innodb-free-tablespace.208591/
Test
su - munin -s /bin/bash
cd /etc/munin/plugins
./mysql_innodb
Erreur
./mysql_innodb: Error: No visible tables use InnoDB
free.value U
Désactiver la sonde
unlink /etc/munin/plugins/mysql_innodb
service munin-node restart