浅谈 munin ,服务器监控程序

浅谈 munin ,服务器监控程序
blog 地址: http://edisonlz.iteye.com
Munin 分为master和node 两部分,Munin master为数据中心,Munin node 为节点中心,向master提供数据,master将数据汇总并进行分析。并支持plugin 进行相关程序监控。
live demo : http://munin.ping.uio.no/

1.安装

Munin master
# apt-get install munin

Munin node 
# apt-get install munin-node


如果您使用suse请加入源 : http://packman.mirrors.skynet.be/pub/packman/suse/11.2/

2.配置master

emacs /etc/munin.conf
# Configfile for Munin master
dbdir       /var/lib/munin/
htmldir     /var/www/munin/
logdir      /var/log/munin
rundir      /var/run/munin/

# This is an example of the correct way to activate Nagios warnings
contact.nagios.command /usr/local/nagios/bin/send_nsca nagioshost.example.com -c /usr/local/nagios/etc/send_nsca.cfg -to 60

# From and including the first host, no more global directives can be defined.
# Everything after one host definition belongs to that host, until another host definition is found.

[foo.example.com]             # Defines the group "example.com" and then
                              # "foo.example.com" under that group.
  address localhost           # The address (IP or host name) of the host, where munin-node is running.

[example.com;bar.example.com] # Same as above, but with an explicit definition.
                              # of the host's group.
  address bar.example.com     # The address.
  df.contacts no              # Don't warn Nagios (or whatever) if the 'df' plugin exceed warning values.

[Groupname;]                  # Defines the group "Groupname"
  contacts nagios             # Notifications shall go to nagios for hosts in this group

[Groupname;baz.example.com]   # Associates the host baz.example.com to this group
  address baz.example.com     # The address of the host, where munin-node is running.
  update no                   # Specifies that no services on this host should be updated by munin-update




配置apache

<web-app>

    <display-name>Munin</display-name>
    <description>Monitoring Server Based on RRD Tool</description>
    <welcome-file-list>index.html</welcome-file-list>

    <!-- optional access control -->
    <authenticator>
        <type>com.caucho.server.security.XmlAuthenticator</type>
        <init>
           <user>username:password:munin</user>
           <password-digest>none</password-digest>
        </init>
    </authenticator>
    <login-config>
        <auth-method>basic</auth-method>
    </login-config>
    <security-constraint url-pattern="/*" role-name="munin"/>

    <servlet servlet-name="cgiservlet" servlet-class="com.caucho.servlets.CGIServlet" />
    <servlet-mapping url-pattern="/cgi/munin-cgi-graph" servlet-name="cgiservlet" />
    <path-mapping url-pattern="/*" real-path="/var/www/html/munin" />

</web-app>




3.配置node
emacs /etc/munin-node.conf
log_level 4
log_file /var/log/munin/munin-node.log
port 4949
pid_file /var/run/munin/munin-node.pid
background 1
host *
user root
group root
setsid yes
ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
# host_name localhost.localdomain
allow ^127\.0\.0\.1$
allow ^192\.168\.10\.3$
cidr_allow 10.20.30.0/16
cidr_deny 10.10.30.12/24


4.启动服务
sudo /etc/init.d/munin start
sudo /etc/init.d/munin-node start





参考地址:
http://munin.projects.linpro.no/wiki/LinuxInstallation

你可能感兴趣的:(apache,Security,SuSE,emacs,nagios)