munin für die Überwachung von jails einsetzen.

r_friemer

Active Member
Hallo,

ich habe verschiedene jails (2x Web-, 1x Datenbank- und 1x Mailserver).

Ich möchte nun die Dienste in den jails gerne mit munin überwachen.

Die Installation der munin-nodes und des munin-masters auf dem host-System verlief ohne Fehler und läuft einwandfrei.

Bei der Installation der munin-node ports auf den ersten Webserver-jail (IP:192.168.88.201) bin ich wie bei der Installation vorgegeben vorgegangen.

Die munin-node.conf sieht folgendermaßen aus:
Code:
#
# Example config-file for munin-node
#

log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel

# Regexps for files to ignore

ignore_file ~$
#ignore_file [#~]$  # FIX doesn't work. '#' starts a comment
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

# Set this if the client doesn't report the correct hostname when
# telnetting to localhost, port 4949
#
host_name web_node01

# A list of addresses that are allowed to connect.  This must be a
# regular expression, since Net::Server does not understand CIDR-style
# network notation unless the perl module Net::CIDR is installed.  You
# may repeat the allow line as many times as you'd like

#allow ^127\.0\.0\.1$
allow ^192\.168\.88\.201$
allow ^192\.168\.88\.254$

# If you have installed the Net::CIDR perl module, you can use one or more
# cidr_allow and cidr_deny address/mask patterns.  A connecting client must
# match any cidr_allow, and not match any cidr_deny.  Note that a netmask
# *must* be provided, even if it's /32
#
# Example:
#
# cidr_allow 127.0.0.1/32
# cidr_allow 192.0.2.0/24
# cidr_deny  192.0.2.42/32

# Which address to bind to;
#host *
host 192.168.88.201

# And which port
port 4949

Auf dem Host habe ich in dem munin-master den webserver folgendermaßen integriert.

Code:
[web_node01]
    address 192.168.88.201
    use_node_name yes

Bei diesem Code wird die Ausgabe nicht mehr aktualisiert.

Wenn ich den Code auskommentiere, dann läuft munin wieder und wertet die Daten, die aus dem Host munin-node geholt werden, aus.

Eine telnet-Verbindung zu dem web-node funktioniert:
Code:
telnet web_node01 4949
Trying 192.168.88.201...
Connected to web_node01.
Escape character is '^]'.
# munin node at web_node01
fetch cpu
user.value 11030
nice.value 2539
system.value 5750
interrupt.value 560
idle.value 234771
.
quit
Connection closed by foreign host.

Ich kann leider in keinem log eine Fehler finden.

Was mache ich falsch? Kann mir jemand helfen?

r_friemer
 
Nur eine Vermutung - ist der Master in der Node-Config
Code:
allow ^192\.168\.88\.201$
allow ^192\.168\.88\.254$
mit drin ?
Was hat der Munin-Master bzw. jail-Host für eine Adresse ?

Munin ist auch extrem pingelig bei
Code:
  use_node_name yes
Hat sich eventuell ein Leerzeichen am Ende vom Node-Namen eingeschlichen ?

Aufschluss geben Logfiles unter "/var/log/munin/*", insbesondere "munin-update.log" dort.
 
Zuletzt bearbeitet:
Hallo reakktor,

sorry meine Verwirrung.


Also, der Host hat die IP-Adresse 127.0.0.1 (logisch) und 192.168.88.254.

Der web_node01 hat die IP-Adresse 192.168.88.201.

Ich habe in der munin-node.conf vom web_node01 eingetragen:
Code:
allow ^192\.168\.88\.201$
allow ^192\.168\.88\.254$

Ich habe die IP-Adresse von dem jail und die Addresse des Hosts angegeben, weil ich sicher gehen wollte, dass beide Adressen abrufbar sind.

In der munin.conf des hosts steht folgender Code drinnen:
Code:
[web_node01]
    local_address 192.168.88.254
    address 192.168.88.201
    use_node_name yes

Ich habe auf Grund eines Hinweises auf der Seite von munin (s. Node level directives) noch den Punkt "local_address" hinzugefügt. Das liest sich für mich so, als ob er mit dieser Addresse sich bei dem web_node anmelden würde. Es ist aber egal, ob ich den Punkt "local_address" drin habe oder nicht. Beide male bleibt munin hängen. :-( Leider!

r_friemer
 
Hallo,
hast du die Munin Nodes (Jailhost und nativer Host) alle so konfiguriert, dass alle per 'host' ausschliesslich auf ihre jeweilige IP-Adresse binden? Wenn du einen vergessen haben solltest, ist die Bindung dieses Nodes auch auf allen Jailadressen und das stört dann.

Grüße
Mario
 
Hallo DSBuser,

Der munin-node auf dem Host ist folgende:
Code:
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel

ignore_file ~$
#ignore_file [#~]$  # FIX doesn't work. '#' starts a comment
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

host_name redbeastie

allow ^192\.168\.88\.254$

host 192.168.88.254

port 4949

Die munin-node.conf auf dem web_node01, die im Moment die einzige ist die läuft, ist folgende:
Code:
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel

ignore_file ~$
#ignore_file [#~]$  # FIX doesn't work. '#' starts a comment
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

host_name web_node01

allow ^192\.168\.88\.201$
allow ^192\.168\.88\.254$

host 192.168.88.201

port 4949

Die munin.conf auf dem Host ist folgende:
Code:
dbdir   /var/munin
htmldir /home/server/htdocs/munin
logdir /var/log/munin
rundir  /var/run/munin

tmpldir /usr/local/etc/munin/templates

includedir /usr/local/etc/munin/munin-conf.d

local_address 192.168.88.254

# a simple host tree
[redbeastie]
    address 192.168.88.254
    use_node_name yes
    
[web_node01]
    address 192.168.88.201
    use_node_name yes

Ich habe gemerkt, das wenn ich auf dem munin-node in dem jail die eigene IP erlaube, dann komme ich per telnet drauf, ansonsten nicht.

Was ist hier verkehrt?

r_friemer
 
Zuletzt bearbeitet:
Ich habe nun die munin-node auf den host so angepasst, dass er über die localhost-Addresse die Daten austauscht:

Die munin-node.conf sieht so aus:
Code:
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel

ignore_file ~$
#ignore_file [#~]$  # FIX doesn't work. '#' starts a comment
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

host_name redbeastie

allow ^127\.0\.0\.1$

host 127.0.0.1

port 4949

Die munin.conf habe ich auch entsprechend angepasst.
Code:
dbdir   /var/munin
htmldir /home/server/htdocs/munin
logdir /var/log/munin
rundir  /var/run/munin

tmpldir /usr/local/etc/munin/templates

includedir /usr/local/etc/munin/munin-conf.d

# a simple host tree
[redbeastie]
    address 127.0.0.1
    use_node_name yes
    
#[web_node01]
#    local_address 192.168.88.254
#    address 192.168.88.201
#    use_node_name yes

Wenn ich nun den web_node aktiviere, dann geht wieder nix.
 
Versuche doch mal in der Node-Config ein

Code:
[web_node01]
...
...
# Which address to bind to;
host *

Ich glaube, ich hatte da auch mal ein komisches Problem, seit dem steht das Sternchen da drin.
Ansonsten *muss* dazu was in Logs zu finden sein, Munin ist da sehr gesprächig.

Eventuell hilft auch folgender Link weiter: http://munin-monitoring.org/wiki/Debugging_Munin_plugins

Z.B.: "This step will tell you whether munin (the server) is able to communicate with munin-node (the agent)."
Code:
# su -s /bin/bash munin
# /usr/share/munin/munin-update --debug --nofork --stdout --host foo.example.com --service df
 
Hallo reakktor,

ich habe es mit der Konfiguration von Dir versucht.

Wenn ich den Befehl als munin ausführe, dann bekomme ich folgendes zurück.
Code:
/usr/local/share/munin/munin-update --debug --nofork --host web_node01 --service load
2011/12/08 19:43:05 [DEBUG] Creating new lock file /var/run/munin/munin-update.lock
2011/12/08 19:43:05 [DEBUG] Creating lock : /var/run/munin/munin-update.lock succeeded
2011/12/08 19:43:05 [INFO]: Starting munin-update
2011/12/08 19:43:05 [DEBUG] Creating new lock file /var/run/munin/munin-datafile.lock
2011/12/08 19:43:05 [DEBUG] Creating lock : /var/run/munin/munin-datafile.lock succeeded
2011/12/08 19:43:05 [INFO]: Munin-update finished (0.00 sec)

Wenn ich es auf den "lokalen" munin-node ausführe bekomme ich:
Code:
/usr/local/share/munin/munin-update --debug --nofork --host redbeastie --service load
2011/12/08 19:47:48 [DEBUG] Creating new lock file /var/run/munin/munin-update.lock
2011/12/08 19:47:48 [DEBUG] Creating lock : /var/run/munin/munin-update.lock succeeded
2011/12/08 19:47:48 [INFO]: Starting munin-update
2011/12/08 19:47:48 [DEBUG] Creating new lock file /var/run/munin/munin-redbeastie-redbeastie.lock
2011/12/08 19:47:48 [DEBUG] Creating lock : /var/run/munin/munin-redbeastie-redbeastie.lock succeeded
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "# munin node at redbeastie".
2011/12/08 19:47:48 TLS set to "disabled".
2011/12/08 19:47:48 [DEBUG] Negotiating capabilities
2011/12/08 19:47:48 [DEBUG] Writing to socket: "cap multigraph
".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "cap multigraph dirtyconfig".
2011/12/08 19:47:48 [DEBUG] Node says /cap multigraph dirtyconfig/
2011/12/08 19:47:48 [DEBUG] Writing to socket: "list redbeastie
".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "cpu df df_inode env if_sk0 if_tun0 iostat load memory netstat open_files pf processes systat vmstat".
2011/12/08 19:47:48 [DEBUG] Fetching service configuration for 'load'
2011/12/08 19:47:48 [DEBUG] Writing to socket: "config load
".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_title Load average".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_args --base 1000 -l 0".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_vlabel load".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_noscale true".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_category system".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "load.label load".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "load.warning 10".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "load.critical 120".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "load.info Average load for the five minutes.".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: ".".
2011/12/08 19:47:48 [DEBUG] Reading from socket: "graph_title Load average\ngraph_args --base 1000 -l 0\ngraph_vlabel load\ngraph_noscale true\ngraph_category system\nload.label load\nload.warning 10\nload.critical 120\ngraph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").\nload.info Average load for the five minutes.".
2011/12/08 19:47:48 [DEBUG] Now parsing config output from plugin load on redbeastie
2011/12/08 19:47:48 [CONFIG from load] graph_title Load average
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_title = Load average
2011/12/08 19:47:48 [CONFIG from load] graph_args --base 1000 -l 0
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_args = --base 1000 -l 0
2011/12/08 19:47:48 [CONFIG from load] graph_vlabel load
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_vlabel = load
2011/12/08 19:47:48 [CONFIG from load] graph_noscale true
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_noscale = true
2011/12/08 19:47:48 [CONFIG from load] graph_category system
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_category = system
2011/12/08 19:47:48 [CONFIG from load] load.label load
2011/12/08 19:47:48 [CONFIG dataseries load] load->load.label = load
2011/12/08 19:47:48 [CONFIG from load] load.warning 10
2011/12/08 19:47:48 [CONFIG dataseries load] load->load.warning = 10
2011/12/08 19:47:48 [CONFIG from load] load.critical 120
2011/12/08 19:47:48 [CONFIG dataseries load] load->load.critical = 120
2011/12/08 19:47:48 [CONFIG from load] graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").
2011/12/08 19:47:48 [CONFIG graph global load] load->graph_info = The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").
2011/12/08 19:47:48 [CONFIG from load] load.info Average load for the five minutes.
2011/12/08 19:47:48 [CONFIG dataseries load] load->load.info = Average load for the five minutes.
2011/12/08 19:47:48 [DEBUG] Writing to socket: "fetch load
".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: "load.value 0.25".
2011/12/08 19:47:48 [DEBUG] Reading from socket to redbeastie: ".".
2011/12/08 19:47:48 [DEBUG] Reading from socket: "load.value 0.25".
2011/12/08 19:47:48 [DEBUG] Now parsing fetch output from plugin load on redbeastie/127.0.0.1:4949
2011/12/08 19:47:48 [FETCH from load] load.value 0.25
2011/12/08 19:47:48 [FETCH from load] Storing 0.25 in load
2011/12/08 19:47:48 [DEBUG] Made rrd filename: /var/munin/redbeastie/redbeastie-load-load-g.rrd
2011/12/08 19:47:48 [DEBUG] Updating /var/munin/redbeastie/redbeastie-load-load-g.rrd with N:0.25
2011/12/08 19:47:48 [DEBUG] Creating new lock file /var/run/munin/munin-datafile.lock
2011/12/08 19:47:48 [DEBUG] Creating lock : /var/run/munin/munin-datafile.lock succeeded
2011/12/08 19:47:48 [INFO]: Munin-update finished (0.41 sec)

Müssen denn im jail bestimmte filesysteme freigegeben werden (procfs oder so etwas?).

r_friemer
 
Es hat geklappt!!!

Danke an KobRheTilla.

Ich habe beim dem munin-master für den web_node01 den Punkt use_node_name auskommentiert und dann kam folgende Ausgabe.

Code:
/usr/local/share/munin/munin-update --debug --nofork --host web_node01.friemnet.local --service cpu
2011/12/08 21:48:59 [ERROR] Hostname 'web_node01.friemnet.local' contains illegal characters (http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names).  Please fix this by replacing illegal characters with '-'.  Remember to do it on both in the master configuration and on the munin-node.
2011/12/08 21:48:59 [ERROR] Error occured in under [web_node01.friemnet.local] in the configuration.
ERROR: Failed to parse config file '/usr/local/etc/munin/munin.conf': [ERROR] Error occured in under [web_node01.friemnet.local] in the configuration.  Please refer to the log if details are missing here.
 at /usr/local/share/munin/munin-update line 48

Es war der Unterstrich!

Ich habe die Konfiguration so angepasst, dass der Unterstrich weder im munin-master, noch in dem munin-node des webservers steht. Den munin-node habe ich noch an die jail-IP gebunden und nun läuft alles. :-) :-D

hier noch einma die Konfiguration des munin-masters (munin.conf)
Code:
dbdir   /var/munin
htmldir /home/server/htdocs/munin
logdir /var/log/munin
rundir  /var/run/munin

tmpldir /usr/local/etc/munin/templates

includedir /usr/local/etc/munin/munin-conf.d

# a simple host tree
[redbeastie.friemnet.local]
    address 127.0.0.1
    use_node_name yes

[webnode01.friemnet.local]
    address 192.168.88.201
    use_node_name yes

Dies ist die Konfiguration des munin-nodes auf dem web_node01:
Code:
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel

ignore_file ~$
#ignore_file [#~]$  # FIX doesn't work. '#' starts a comment
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

host_name webnode01.friemnet.local

allow ^192\.168\.88\.201$
allow ^192\.168\.88\.254$

host 192.168.88.201

port 4949

Vielen Dank an alle, die mir geholfen haben.

r_friemer
 
Zurück
Oben