Raspberry/Munin : Installation d’un client SNMP pour Munin

Ma configuration ( admin est le nom de mon serveur QNAP, son IP est dans /etc/hosts ) :

Les étapes :

osmc@osmc:~$ sudo apt-get install libnet-snmp-perl

osmc@osmc:~$ sudo apt-get install nmap

osmc@osmc:~$ sudo munin-node-configure --shell --snmp admin --snmpversion 2 --snmpcommunity QNAP
ln -s '/usr/share/munin/plugins/snmp__df' '/etc/munin/plugins/snmp_admin_df'
ln -s '/usr/share/munin/plugins/snmp__df_ram' '/etc/munin/plugins/snmp_admin_df_ram'
ln -s '/usr/share/munin/plugins/snmp__if_' '/etc/munin/plugins/snmp_admin_if_1'
ln -s '/usr/share/munin/plugins/snmp__if_' '/etc/munin/plugins/snmp_admin_if_3'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_admin_if_err_1'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_admin_if_err_3'
ln -s '/usr/share/munin/plugins/snmp__if_multi' '/etc/munin/plugins/snmp_admin_if_multi'
ln -s '/usr/share/munin/plugins/snmp__memory' '/etc/munin/plugins/snmp_admin_memory'
ln -s '/usr/share/munin/plugins/snmp__netstat' '/etc/munin/plugins/snmp_admin_netstat'
ln -s '/usr/share/munin/plugins/snmp__processes' '/etc/munin/plugins/snmp_admin_processes'
ln -s '/usr/share/munin/plugins/snmp__swap' '/etc/munin/plugins/snmp_admin_swap'
ln -s '/usr/share/munin/plugins/snmp__uptime' '/etc/munin/plugins/snmp_admin_uptime'
ln -s '/usr/share/munin/plugins/snmp__users' '/etc/munin/plugins/snmp_admin_users'
ln -s '/usr/share/munin/plugins/snmp__winload' '/etc/munin/plugins/snmp_admin_winload'
ln -s '/usr/share/munin/plugins/snmp__winmem' '/etc/munin/plugins/snmp_admin_winmem'

osmc@osmc:~$ sudo munin-node-configure --shell --snmp admin --snmpversion 2 --snmpcommunity QNAP | sudo sh

osmc@osmc:~$ sudo systemctl restart munin-node

On peut tester manuellement via un telnet :

osmc@osmc:~$ telnet localhost 4949
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at osmc
list admin
snmp_admin_cpuload snmp_admin_df snmp_admin_df_ram snmp_admin_if_1 snmp_admin_if_3 snmp_admin_if_err_1 snmp_admin_if_err_3 snmp_admin_memory snmp_admin_netstat snmp_admin_processes snmp_admin_swap snmp_admin_uptime snmp_admin_users snmp_admin_winload snmp_admin_winmem

A noter que le QNAP ne fonctionne pas bien en version 3. Misère. Pour finir il faut modifier munin.conf et relance apache :

osmc@osmc:~$ sudo vi /etc/munin/munin.conf 
...
[admin]                                 
   address 127.0.0.1
   use_node_name no    
...
osmc@osmc:~$ sudo vi /etc/munin/plugin-conf.d/snmp_communities
[snmp_admin_*]
env.community QNAP

osmc@osmc:~$ sudo systemctl restart apache2

Pour verifier que cela fonctionne bien vous pouvez voir si les bases sont initialisées :

osmc@osmc:~$ tree /var/lib/munin/admin/
/var/lib/munin/admin/
├── admin-df_inode-_dev_mmcblk0p2-g.rrd
├── admin-df_inode-_dev_sda1-g.rrd
├── admin-df_inode-_dev_shm-g.rrd
├── admin-df_inode-devtmpfs-g.rrd
....

Le passage via SNMP augmente le temps de traitement de munin (+20 sec minimum …) :

Pour le mesurer :

osmc@osmc:~$ sudo su - munin --shell=/bin/bash
munin@osmc:~$ time munin-cron
real	1m29.225s
user	0m11.708s
sys	0m0.900s

Ensuite via l’interface on a :

Il faut noter le projet très intéressant : https://github.com/gpkvt/muninlite .

Muninlite for Qnap

At the moment there is no IPKG available to install Munin-Node on your QNAP-Device. Fortunately you can use muninlite (http://sourceforge.net/projects/muninlite/). Anyway muninlite doesn’t support QNAP-Devices very well, so I made some tweaks. You can either use the patch file and get muninlite directly from SourceForge, or you can use the complete Script from this repository. The Script is based on muninlite 1.0.4 (with all plugins enabled) and was tested on a QNAP TS-419 Pro.

Pour plus d’information sur le plugin : http://guide.munin-monitoring.org/en/latest/tutorial/snmp.html .

A suivre.

MacOS High Sierra : Installation de Munin

( C’est instable … sniff ) 

Installation de Munin Server sur MacOS.

Etape n°1 : Installation de MacPorts :

Le lien : https://www.macports.org/install.php pour le téléchargement : macOS High Sierra v10.13

Etape n°2 : Installation de la partie serveur :

Installation

# sudo port install munin +server
Password:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for munin
The following dependencies will be installed:
...
Continue? [Y/n]: Y
...
--->  Extracting munin
--->  Applying patches to munin
--->  Configuring munin
--->  Building munin
--->  Staging munin into destroot
###########################################################
# A startup item has been generated that will cause the
# Munin server to fetch data from all nodes every 5 mins.
# It is disabled by default, please execute the following
# command to enable:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.munin-cron.plist
###########################################################
--->  Creating launchd control script 'munin-node'
--->  Installing munin @1.4.7_6+server
--->  Activating munin @1.4.7_6+server
--->  Cleaning munin
--->  Updating database of binaries
--->  Updating database of C++ stdlib usage              
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
--->  Some of the ports you installed have notes:
  libidn has the following notes:
    Please be aware that GNU libidn2 is the successor of GNU libidn. It comes
    with IDNA 2008  
    and TR46 implementations and also provides a compatibility layer for GNU
    libidn.
  munin has the following notes:
    To detect supported Munin plugins please use the following command:
    
    sudo -u munin munin-node-configure --suggest --shell | sudo sh

    A startup item has been generated that will aid in starting munin with
    launchd. It is disabled by default. Execute the following command to start
    it, and to cause it to launch at startup:
    
        sudo port load munin
  python27 has the following notes:
    To make this the default Python or Python 2 (i.e., the version run by the
    'python' or 'python2' commands), run one or both of:
    
        sudo port select --set python python27
        sudo port select --set python2 python27

# sudo port install munin
--->  Fetching distfiles for munin
--->  Verifying checksums for munin
--->  Extracting munin
--->  Applying patches to munin
--->  Configuring munin
--->  Building munin
--->  Staging munin into destroot
--->  Creating launchd control script 'munin-node'
--->  Installing munin @1.4.7_6
--->  Unloading startupitem 'munin-node' for munin
--->  Deactivating munin @1.4.7_6+server
--->  Cleaning munin
--->  Activating munin @1.4.7_6
--->  Cleaning munin
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
--->  Some of the ports you installed have notes:
  munin has the following notes:
    To detect supported Munin plugins please use the following command:
    
    sudo -u munin munin-node-configure --suggest --shell | sudo sh

    A startup item has been generated that will aid in starting munin with launchd. It is disabled by default. Execute the following command to start
    it, and to cause it to launch at startup:
    
        sudo port load munin
# sudo -u munin munin-node-configure --suggest --shell 
# The following plugins caused errors:
# apache_processes:
# 	Non-zero exit during autoconf (255)
# if_:
# 	Timed out during suggest
# 	No valid suggestions
# if_err_:
# 	Timed out during suggest
# 	No valid suggestions
# mysql_:
# 	Non-zero exit during autoconf (2)
# slony_lag_:
# 	Non-zero exit during autoconf (2)
# varnish_:
# 	Non-zero exit during autoconf (255)

Je supprime le –shell :

$ sudo -u munin munin-node-configure --suggest 
Plugin                     | Used | Suggestions                            
------                     | ---- | -----------                            
amavis                     | no   | no                                     
apache_accesses            | no   | no [LWP::UserAgent not found]          
apache_processes           | no   | no                                     
apache_volume              | no   | no [LWP::UserAgent not found]          
apc_envunit_               | no   | no [no units to monitor]               
courier_mta_mailqueue      | no   | no [spooldir not found]                
courier_mta_mailstats      | no   | no [could not find executable]         
courier_mta_mailvolume     | no   | no [could not find executable]         
cupsys_pages               | no   | no [logfile not found]                 
df                         | yes  | yes                                    
df_inode                   | yes  | yes                                    
exim_mailqueue             | no   | no [no exiqgrep]                       
exim_mailstats             | no   | no ['/usr/sbin/exim -bP log_file_path' returned an error]
fail2ban                   | no   | no [/usr/bin/fail2ban-client not found]
hddtemp_smartctl           | no   | no [smartctl not found]                
http_loadtime              | no   | no [need time and wget programs]       
if_                        | no   | yes                                    
if_err_                    | no   | yes                                    
jmx_                       | no   | no [connection to 127.0.0.1:5400 failed]
load                       | yes  | yes                                    
lpstat                     | yes  | yes                                    
munin_stats                | yes  | no [munin-update was not found at /opt/local/lib/munin/munin-update]
mysql_                     | no   | no                                     
netstat                    | yes  | yes                                    
nginx_request              | no   | no [LWP::UserAgent not found]          
nginx_status               | no   | no [LWP::UserAgent not found]          
ntp_kernel_err             | no   | no                                     
ntp_kernel_pll_freq        | no   | no                                     
ntp_kernel_pll_off         | no   | no                                     
ntp_offset                 | yes  | yes                                    
nvidia_                    | no   | no [no nvclock executable at /usr/bin/nvclock, please configure]
postfix_mailqueue          | yes  | yes                                    
postfix_mailvolume         | no   | no [logfile '/var/log/syslog' not found]
postgres_bgwriter          | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_cache_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_checkpoints       | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_db    | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_locks_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_querylength_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_scans_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_size_             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_transactions_     | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_tuples_           | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_users             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_xlog              | no   | no [DBD::Pg not found, and cannot do psql yet]
processes                  | yes  | yes                                    
ps_                        | no   | no                                     
qmailqstat                 | no   | no                                     
sendmail_mailqueue         | no   | no                                     
sendmail_mailstats         | no   | no [no mailstats command]              
sendmail_mailtraffic       | no   | no [no mailstats command]              
slapd_                     | no   | no [Net::LDAP not found]               
slapd_bdb_cache_           | no   | no [Can't execute db_stat file '/usr/bin/db4.6_stat']
slony_lag_                 | no   | no                                     
smart_                     | no   | no [smartmontools not found]           
snort_alerts               | no   | no [/var/snort/snort.stats not readable]
snort_bytes_pkt            | no   | no [/var/snort/snort.stats not readable]
snort_drop_rate            | no   | no [/var/snort/snort.stats not readable]
snort_pattern_match        | no   | no [/var/snort/snort.stats not readable]
snort_pkts                 | no   | no [/var/snort/snort.stats not readable]
snort_traffic              | no   | no [/var/snort/snort.stats not readable]
squeezebox_                | no   | no [no connection on localhost port 9090]
squid_cache                | no   | no [could not connect: Connection refused]
squid_objectsize           | no   | no [could not connect: Connection refused]
squid_requests             | no   | no [could not connect: Connection refused]
squid_traffic              | no   | no [could not connect: Connection refused]
tomcat_                    | no   | no                                     
users                      | yes  | yes                                    
varnish_                   | no   | no                                     
vmstat                     | no   | no [could not run "vmstat"]            
zimbra_                    | no   | no [No Text::CSV_XS]                   
# The following plugins caused errors:
# apache_processes:
# 	Non-zero exit during autoconf (255)
# if_:
# 	Timed out during suggest
# 	No valid suggestions
# if_err_:
# 	Timed out during suggest
# 	No valid suggestions
# mysql_:
# 	Non-zero exit during autoconf (2)
# slony_lag_:
# 	Non-zero exit during autoconf (2)
# varnish_:
# 	Non-zero exit during autoconf (255)


# sudo port install munin
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for munin
--->  Cleaning munin
--->  Scanning binaries for linking errors
--->  No broken files found.

A noter l’avertissement suivant :

Il faut donc comprendre l’erreur avec Apache qui empêche de faire la configuration, c’est surement que je n’ai pas autoconf :

# brew install autoconf automake libtool
...
==> Caveats
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.
==> Summary
?  /usr/local/Cellar/libtool/2.4.6_1: 71 files, 3.7MB
==> Caveats
==> autoconf
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/autoconf
==> libtool
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.

# brew install rrdtool
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
cromwell              fn                    glide                 kubernetes-helm       llnode                nifi-registry         pre-commit

==> Installing dependencies for rrdtool: gettext, libffi, pcre, glib, libpng, freetype, fontconfig, pixman, cairo, fribidi, graphite2, icu4c, harfbuzz, pango
...
?  /usr/local/Cellar/rrdtool/1.7.0_1: 155 files, 3MB
==> Caveats
==> gettext
gettext is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD gettext library & some software gets confused if both are in the library path.

If you need to have gettext first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

For compilers to find gettext you may need to set:
  export LDFLAGS="-L/usr/local/opt/gettext/lib"
  export CPPFLAGS="-I/usr/local/opt/gettext/include"

==> libffi
libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"


$ sudo -u munin munin-node-configure --suggest --shell 
# The following plugins caused errors:
# apache_processes:
# 	Non-zero exit during autoconf (255)
# if_:
# 	Timed out during suggest
# 	No valid suggestions
# if_err_:
# 	Timed out during suggest
# 	No valid suggestions
# mysql_:
# 	Non-zero exit during autoconf (2)
# slony_lag_:
# 	Non-zero exit during autoconf (2)
# varnish_:
# 	Non-zero exit during autoconf (255)

Si je regarde la liste des plugins :

$ ls -l /opt/local/etc/munin/plugins/*
lrwxr-xr-x  1 root  admin  31 26 sep 17:19 /opt/local/etc/munin/plugins/df -> /opt/local/lib/munin/plugins/df
lrwxr-xr-x  1 root  admin  37 26 sep 17:19 /opt/local/etc/munin/plugins/df_inode -> /opt/local/lib/munin/plugins/df_inode
lrwxr-xr-x  1 root  admin  33 26 sep 17:19 /opt/local/etc/munin/plugins/load -> /opt/local/lib/munin/plugins/load
lrwxr-xr-x  1 root  admin  35 26 sep 17:19 /opt/local/etc/munin/plugins/lpstat -> /opt/local/lib/munin/plugins/lpstat
lrwxr-xr-x  1 root  admin  40 26 sep 17:19 /opt/local/etc/munin/plugins/munin_stats -> /opt/local/lib/munin/plugins/munin_stats
lrwxr-xr-x  1 root  admin  36 26 sep 17:19 /opt/local/etc/munin/plugins/netstat -> /opt/local/lib/munin/plugins/netstat
lrwxr-xr-x  1 root  admin  39 26 sep 17:19 /opt/local/etc/munin/plugins/ntp_offset -> /opt/local/lib/munin/plugins/ntp_offset
lrwxr-xr-x  1 root  admin  46 26 sep 17:19 /opt/local/etc/munin/plugins/postfix_mailqueue -> /opt/local/lib/munin/plugins/postfix_mailqueue
lrwxr-xr-x  1 root  admin  38 26 sep 17:19 /opt/local/etc/munin/plugins/processes -> /opt/local/lib/munin/plugins/processes
lrwxr-xr-x  1 root  admin  34 26 sep 17:19 /opt/local/etc/munin/plugins/users -> /opt/local/lib/munin/plugins/users

Je supprime lpstat & ntp_offset:

$ sudo /opt/local/etc/munin/plugins/lpstat 
Password:
lpstat: No destinations added.
lpstat: No destinations added.
$ sudo rm /opt/local/etc/munin/plugins/lpstat
$ sudo /opt/local/etc/munin/plugins/ntp_offset 
ntpq: read: Connection refused
delay.value U
offset.value U
jitter.value U
$ sudo rm /opt/local/etc/munin/plugins/ntp_offset

Ensuite il faut lancer Apache :

# sudo apachectl -k restart

Il suffit de faire le test suivant : http://127.0.0.1/ .

Attention sur mon installation j’ai déjà JAVA, XCODE, APACHE .

$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
$ xcode-select -version
xcode-select version 2349.
$ apachectl -version
Server version: Apache/2.4.33 (Unix)
Server built:   Apr  3 2018 23:45:11

Pour information les fichiers de configuration sont :

  • /opt/local/etc/munin/munin.conf
  • /opt/local/etc/munin/munin-node.conf

Les donnes sont dans :

  • /opt/local/var/munin

Le WWW pour afficher les données sont dans :

  • /opt/local/www/munin/

Les fichiers de logs :

  • /opt/local/var/log/munin/munin-node.log

Les binaires (en perl) :

  • /opt/local/sbin/

Ensuite il faut donc modifier le fichier de configuration : /etc/apache2/httpd.conf

….

On fait un test manuel sur Munin :

$ telnet 127.0.0.1 4949
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at XXXXXX.local
list
df df_inode load munin_stats netstat postfix_mailqueue processes users
fetch netstat
resets.value 0
failed.value 0
.

Pour faire un test en temps que root (déconseillé) :

$ sudo mkdir /plugins/
$ sudo ln -s /opt/local/lib/munin/plugins/plugin.sh /plugins/plugin.sh
$ sudo /opt/local/etc/munin/plugins/load 
load.value 1,59

Sinon on a l’erreur :

$ /opt/local/etc/munin/plugins/df
/opt/local/etc/munin/plugins/df: line 24: /plugins/plugin.sh: No such file or directory

La méthode plus propre est la suivante :

$ sudo /opt/local/sbin/munin-run df autoconf --debug
# Setting up environment
# About to run '/opt/local/etc/munin/plugins/df autoconf'
yes
$ sudo /opt/local/sbin/munin-run df config --debug
# Setting up environment
# About to run '/opt/local/etc/munin/plugins/df config'
graph_title Filesystem usage (in %)
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_scale no
_dev_disk1s1.label /
_dev_disk1s4.label /private/var/vm
$ sudo /opt/local/sbin/munin-run df --debug
# Setting up environment
# About to run '/opt/local/etc/munin/plugins/df'
_dev_disk1s1.value 92
_dev_disk1s4.value 6

A noter que pour l’instant ce n’est pas stable !!! J’ai du ma à comprendre.

Mes fichiers :

$ sudo cat /Library/LaunchDaemons/org.macports.munin-node.plist 
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>org.macports.munin-node</string>
<key>ProgramArguments</key>
<array>
	<string>/opt/local/bin/daemondo</string>
	<string>--label=munin-node</string>
	<string>--start-cmd</string>
	<string>/opt/local/etc/LaunchDaemons/org.macports.munin-node/munin-node.wrapper</string>
	<string>start</string>
	<string>;</string>
	<string>--stop-cmd</string>
	<string>/opt/local/etc/LaunchDaemons/org.macports.munin-node/munin-node.wrapper</string>
	<string>stop</string>
	<string>;</string>
	<string>--restart-cmd</string>
	<string>/opt/local/etc/LaunchDaemons/org.macports.munin-node/munin-node.wrapper</string>
	<string>restart</string>
	<string>;</string>
	<string>--pid=none</string>
</array>
<key>Disabled</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>

$ sudo cat /Library/LaunchDaemons/org.macports.munin-cron.plist 
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
    <dict>
        <key>Label</key>
        <string>org.macports.munin-cron</string>
        <key>UserName</key>
        <string>munin</string>
        <key>ProgramArguments</key>
        <array>
            <string>/opt/local/sbin/munin-run</string>
        </array>
        <key>LowPriorityIO</key>
        <true/>
        <key>Nice</key>
        <integer>1</integer>
        <key>StartInterval</key>
        <integer>300</integer>
    </dict>
</plist>

 

Raspberry/Munin : Monitor d’un site WordPress distant ( httpresponsetime )

Installation d’un plugin en python : https://github.com/arthur-debert/munin-httpresponse-plugin/blob/master/httpresponsetime

$ sudo vi /usr/share/munin/plugins/httpresponsetime
 -> Copie du script.
$ sudo ln -s  /usr/share/munin/plugins/httpresponsetime /etc/munin/plugins/httpresponsetime
$ sudo chmod +x  /usr/share/munin/plugins/httpresponsetime /etc/munin/plugins/httpresponsetime
$ sudo apt-get install python-setuptools python-dev build-essential
$ sudo easy_install pip
$ sudo pip install httplib2

Ajout dans le fichier :

$ sudo vi /etc/munin/plugin-conf.d/munin-node
...
[httpresponsetime]
    env.urls https://www.cyber-neurones.org
...

Et on relance :

$ sudo munin-node-configure --shell
$ sudo service munin-node restart

Et voici le résultat :

Raspberry/Munin : RRDs: libpng12.so.0: cannot open shared object file ( DynaLoader.pm line 187 )

Après 24h ou Munin a fonctionné parfaitement, maintenant j’ai une erreur ?! Je pense qu’une mise à jours à casser Perl :

osmc@osmc:~$ sudo su - munin --shell=/bin/bash
munin@osmc:~$ munin-cron --debug
Can't load '/usr/lib/arm-linux-gnueabihf/perl5/5.20/auto/RRDs/RRDs.so' for module RRDs: libpng12.so.0: cannot open shared object file: No such file or directory at /usr/lib/arm-linux-gnueabihf/perl/5.20/DynaLoader.pm line 187.
 at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
Compilation failed in require at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
BEGIN failed--compilation aborted at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
Compilation failed in require at /usr/share/perl5/Munin/Master/Update.pm line 17.
BEGIN failed--compilation aborted at /usr/share/perl5/Munin/Master/Update.pm line 17.
Compilation failed in require at /usr/share/munin/munin-update line 14.
BEGIN failed--compilation aborted at /usr/share/munin/munin-update line 14.

A noter aussi que le ldconfig est un peu mal :

osmc@osmc:~$ sudo ldconfig
/sbin/ldconfig.real: /usr/lib/arm-linux-gnueabihf/libtevent-util.so.0.0.1 n'est pas un fichier de type ELF - il a un octet magique au début incorrect.
/sbin/ldconfig.real: /usr/lib/arm-linux-gnueabihf/libtevent-util.so.0 n'est pas un fichier de type ELF - il a un octet magique au début incorrect.

Je commence donc par une upgrade :

osmc@osmc:~$ sudo apt-get -f dist-upgrade
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
Calcul de la mise à jour... Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
  libass5 rbp2-image-4.4.16-4-osmc
Veuillez utiliser « apt-get autoremove » pour les supprimer.
Fait
Les paquets suivants seront ENLEVÉS :
  diskmount-osmc udisks udisks-glue
Les NOUVEAUX paquets suivants seront installés :
  armv7-diskmount-osmc armv7-libass-osmc armv7-udisks-glue-osmc armv7-udisks-osmc rbp2-image-4.9.29-10-osmc
Les paquets suivants seront mis à jour :
  apt apt-utils armv7-connman-osmc armv7-libbluray-osmc armv7-libcrossguid-osmc armv7-libsqlite-osmc armv7-network-osmc armv7-splash-osmc base-files-osmc bind9-host busybox
  ca-certificates curl debian-archive-keyring eject fuse gcc-4.9-base gnupg gpgv libapache2-mod-php5 libapt-inst1.5 libbind9-90 libc-bin libc6 libconfuse-common libconfuse0 libcups2
  libcurl3 libdns100 libevent-2.0-5 libexpat1 libffi6 libfreetype6 libfuse2 libgcc1 libgcrypt20 libgnutls-deb0-28 libgraphite2-3 libicu52 libidn11 libisc95 libisccc90 libisccfg90
  libjasper1 liblcms2-2 libldap-2.4-2 liblwres90 libmad0 libmysqlclient18 libpcsclite1 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libprocps3 librtmp1 libsmbclient
  libssl1.0.0 libstdc++6 libtag1-vanilla libtasn1-6 libtevent0 libtiff5 libtirpc1 libvorbis0a libvorbisenc2 libwbclient0 libxml2 libxslt1.1 locales login mediacenter-addon-osmc
  mediacenter-skin-osmc multiarch-support mysql-common ntfs-3g openssh-client openssh-server openssh-sftp-server openssl passwd perftune-osmc php5-cli php5-common policykit-1 procps
  python-imaging python-pil rbp-bootloader-osmc rbp-userland-osmc rbp2-device-osmc rbp2-ftr-osmc rbp2-kernel-osmc rbp2-libcec-osmc rbp2-mediacenter-osmc rpcbind samba-common samba-libs
  sensible-utils ssh-app-osmc sudo tar wireless-firmware-osmc wpasupplicant
103 mis à jour, 5 nouvellement installés, 3 à enlever et 0 non mis à jour.
Il est nécessaire de prendre 125 Mo dans les archives.
Après cette opération, 71,2 Mo d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] O
...
osmc@osmc:~$ sudo ldconfig 
osmc@osmc:~$ 

Plus d’erreur avec ldconfig … Mais j’ai toujours un erreur :

osmc@osmc:~$ /usr/bin/munin-cron 
Can't load '/usr/lib/arm-linux-gnueabihf/perl5/5.20/auto/RRDs/RRDs.so' for module RRDs: libpng12.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type at /usr/lib/arm-linux-gnueabihf/perl/5.20/DynaLoader.pm line 187.
 at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
Compilation failed in require at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
BEGIN failed--compilation aborted at /usr/share/perl5/Munin/Master/UpdateWorker.pm line 19.
Compilation failed in require at /usr/share/perl5/Munin/Master/Update.pm line 17.
BEGIN failed--compilation aborted at /usr/share/perl5/Munin/Master/Update.pm line 17.
Compilation failed in require at /usr/share/munin/munin-update line 14.
BEGIN failed--compilation aborted at /usr/share/munin/munin-update line 14.

Je vais donc refaire une installation de munin !

osmc@osmc:~$ sudo apt-get autoremove
...
osmc@osmc:~$ sudo apt-get update -y
...
osmc@osmc:~$ sudo apt-get install munin
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
Vous pouvez lancer « apt-get -f install » pour corriger ces problèmes :
Les paquets suivants contiennent des dépendances non satisfaites :
 munin : Dépend: librrds-perl mais ne sera pas installé
         Dépend: munin-common (>= 2.0.33-1) mais 2.0.25-1+deb8u3 devra être installé
         Dépend: rrdtool mais ne sera pas installé
 rbp2-device-osmc : Dépend: armv7-splash-osmc mais ne sera pas installé
                    Dépend: rbp2-mediacenter-osmc mais ne sera pas installé
E: Dépendances non satisfaites. Essayez « apt-get -f install » sans paquet
(ou indiquez une solution).
...
osmc@osmc:~$ sudo apt-get -f install
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
Correction des dépendances... Fait
Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
  ca-certificates-java fonts-dejavu fonts-dejavu-extra libasyncns0 libatk-wrapper-java libatk1.0-0 libatk1.0-data libdate-manip-perl libdatrie1 libdbi1 libdrm2 libfile-copy-recursive-perl
  libflac8 libgdk-pixbuf2.0-common libgif4 libgl1-mesa-glx libglapi-mesa libgtk2.0-common libhtml-template-perl libice6 libjasper1 libnspr4 libnss3 libpixman-1-0 libpulse0 libsctp1 libsm6
  libsndfile1 libthai-data libthai0 liburi-perl libvpx1 libx11-6 libx11-data libx11-xcb1 libxau6 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1
  libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxtst6 libxxf86vm1 nginx-common tzdata-java
  x11-common
Veuillez utiliser « apt-get autoremove » pour les supprimer.
Les paquets supplémentaires suivants seront installés : 
  armv7-libass-osmc armv7-libbluray-osmc armv7-libnfs-osmc armv7-librtmp-osmc armv7-libshairplay-osmc armv7-libsqlite-osmc armv7-splash-osmc fbset fontconfig-config gcc-6-base libc-bin libc-l10n
  libc6 libcdio13 libcrossguid0 libenca0 libfontconfig1 libfreetype6 libfribidi0 libgcrypt20 libgif7 libgnutls30 libgssapi-krb5-2 libharfbuzz0b libhogweed4 libicu57 libk5crypto3 libkrb5-3
  libkrb5support0 libldb1 liblzo2-2 libmad0 libmariadbclient18 libmicrohttpd12 libncurses5 libncursesw5 libnettle6 libp11-kit0 libpcrecpp0v5 libplist3 libpng16-16 libpython2.7
  libpython2.7-minimal libpython2.7-stdlib libreadline7 libsamplerate0 libsmbclient libssh-4 libssl1.0.2 libssl1.1 libstdc++6 libtag1v5-vanilla libtasn1-6 libtdb1 libtevent0 libtinfo5
  libtinyxml2.6.2v5 libwbclient0 libwebp6 libwebpdemux2 libwebpmux2 libyajl2 locales mediacenter-addon-osmc mediacenter-eventclients-common-osmc mediacenter-send-osmc mediacenter-skin-osmc
  mysql-common python-chardet python-imaging python-pexpect python-pil python-pkg-resources python-ptyprocess python-requests python-six python-talloc python-unidecode python-urllib3 python2.7
  python2.7-minimal rbp2-libcec-osmc rbp2-mediacenter-osmc samba-libs
Paquets suggérés :
  glibc-doc rng-tools gnutls-bin krb5-doc krb5-user python-pexpect-doc python-pil-doc python-pil-dbg python-setuptools python-cryptography python-idna python-openssl python-socks python-ntlm
  python2.7-doc binfmt-support
Paquets recommandés :
  manpages krb5-locales libgpm2 python-ipaddress
Les NOUVEAUX paquets suivants seront installés :
  armv7-libass-osmc armv7-libbluray-osmc armv7-libnfs-osmc armv7-librtmp-osmc armv7-libshairplay-osmc armv7-libsqlite-osmc armv7-splash-osmc fbset gcc-6-base libc-l10n libcdio13 libcrossguid0
  libenca0 libfontconfig1 libfreetype6 libfribidi0 libgif7 libgnutls30 libharfbuzz0b libhogweed4 libicu57 libldb1 liblzo2-2 libmad0 libmariadbclient18 libmicrohttpd12 libnettle6 libpcrecpp0v5
  libplist3 libpng16-16 libpython2.7 libreadline7 libsamplerate0 libsmbclient libssh-4 libssl1.0.2 libssl1.1 libtag1v5-vanilla libtdb1 libtevent0 libtinyxml2.6.2v5 libwebp6 libwebpdemux2
  libwebpmux2 libyajl2 mediacenter-addon-osmc mediacenter-eventclients-common-osmc mediacenter-send-osmc mediacenter-skin-osmc mysql-common python-chardet python-imaging python-pexpect python-pil
  python-pkg-resources python-ptyprocess python-requests python-six python-talloc python-unidecode python-urllib3 rbp2-libcec-osmc rbp2-mediacenter-osmc samba-libs
Les paquets suivants seront mis à jour :
  fontconfig-config libc-bin libc6 libgcrypt20 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libncurses5 libncursesw5 libp11-kit0 libpython2.7-minimal libpython2.7-stdlib libstdc++6
  libtasn1-6 libtinfo5 libwbclient0 locales python2.7 python2.7-minimal
20 mis à jour, 64 nouvellement installés, 0 à enlever et 344 non mis à jour.
Il est nécessaire de prendre 94,3 Mo dans les archives.
Après cette opération, 224 Mo d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] O
....
osmc@osmc:~$ sudo apt-get install munin
...

C’est bon le problème est fixé ! Il fallait donc faire une réinstallation complète avec gestion des dépendances.

osmc@osmc:~$ ls -l /var/log/munin/*
-rw-r----- 1 www-data adm        0 sept. 19 21:09 /var/log/munin/munin-cgi-graph.log
-rw-r----- 1 www-data adm        0 sept. 19 21:09 /var/log/munin/munin-cgi-html.log
-rw-r--r-- 1 munin    munin      0 sept. 19 21:20 /var/log/munin/munin-graph.log
-rw-r--r-- 1 munin    munin 113181 sept. 21 19:05 /var/log/munin/munin-html.log
-rw-r--r-- 1 munin    munin  65840 sept. 21 19:05 /var/log/munin/munin-limits.log
-rw-r--r-- 1 root     root    4137 sept. 19 21:14 /var/log/munin/munin-node-configure.log
-rw-r--r-- 1 root     root  183560 sept. 21 19:05 /var/log/munin/munin-node.log
-rw-r--r-- 1 munin    munin 826029 sept. 21 19:05 /var/log/munin/munin-update.log
osmc@osmc:~$ hostnamectl 
   Static hostname: osmc
         Icon name: computer
           Chassis: n/a
        Machine ID: 1671b5b617884fdf85a465a5ac731b8f
           Boot ID: f8c6d2de5291463aa3a641224d1cda08
  Operating System: Open Source Media Center
            Kernel: Linux 4.9.29-10-osmc
      Architecture: arm