$7.49 .com domain with free InstantPage Website Builder$1.99 Web Hosting   捷飞网络官方淘宝店   Godaddy 优惠码
返回列表 发帖
分享到:




浅谈 munin ,服务器监控程序

Munin 分为master和node 两部分,Munin master为数据中心,Munin node 为节点中心,向master提供数据,master将数据汇总并进行分析。并支持plugin 进行相关程序监控。 * B1 A* U9 x& J" e
live demo : http://munin.ping.uio.no/ " ?: Y# q6 {3 ~1 k' S7 o9 O# b

: I( D4 h! N$ x6 h1.安装
* q+ d4 w% K9 y+ l4 k! ]
4 V4 [9 a- t8 q( NMunin master
  1. # apt-get install munin
复制代码
Munin node
  1. # apt-get install munin-node
复制代码

$ i$ p/ M$ y7 z2 c; Y+ [$ X/ Y4 k& z
如果您使用suse请加入源 : http://packman.mirrors.skynet.be/pub/packman/suse/11.2/ 3 f1 @0 n8 r" F$ ^5 U/ _, N. q
. g; ^' }( u1 q
2.配置master

. f: d- z4 f: k. ^4 jemacs /etc/munin.conf   I' J+ U3 W8 ^
" `' w7 Z) b% ^4 z5 O. R  F
) g& ~- E9 |2 B9 Q
  1. # Configfile for Munin master
  2. dbdir       /var/lib/munin/
  3. htmldir     /var/www/munin/
  4. logdir      /var/log/munin
  5. rundir      /var/run/munin/

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

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

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

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

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

  19. [Groupname;baz.example.com]   # Associates the host baz.example.com to this group
  20.   address baz.example.com     # The address of the host, where munin-node is running.
  21.   update no                   # Specifies that no services on this host should be updated by munin-update
复制代码
配置apache
2 ~4 b3 X  E8 t; c7 _. B: N
2 f% `9 P8 Z3 a! }" x8 X
+ \* R( u9 R, _) m/ `' O; [$ j3 n. A, O9 g
. e$ H- E7 `" P& f8 g# j
  1. <web-app>

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

  5.     <!-- optional access control -->
  6.     <authenticator>
  7.         <type>com.caucho.server.security.XmlAuthenticator</type>
  8.         <init>
  9.            <user>username:password:munin</user>
  10.            <password-digest>none</password-digest>
  11.         </init>
  12.     </authenticator>
  13.     <login-config>
  14.         <auth-method>basic</auth-method>
  15.     </login-config>
  16.     <security-constraint url-pattern="/*" role-name="munin"/>

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

  20. </web-app>
复制代码
3.配置node
$ z( @$ T# z3 a5 Q* yemacs /etc/munin-node.conf 2 F9 P: R6 l; w
! r1 {2 l5 c$ @2 A( ^! H' n
; ~% ^5 V& D7 E" E- h5 f0 _% ^
  1. 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
复制代码

9 L) O, e* ?9 ?2 x
5 r, t! Z' T  ~; o  L* H) W4.启动服务
/ L5 ]' ^( ^7 X3 ^2 m
" }7 o8 {. C* X5 y( L8 u- R% f" F) ?9 |0 x. s/ V: L. ?' x
  1. sudo /etc/init.d/munin start sudo /etc/init.d/munin-node start
复制代码
5 q, D; O0 H2 [
: s& }1 x$ d! e" m/ f7 b- o0 t- p! n

5 o/ _# G2 U* i3 r$ S3 _7 l* _- _
4 v* F" q- s8 @5 m1 Y
8 `2 z2 C* J6 P: F$ H参考地址:
5 O: J. H! ~" {4 Fhttp://munin.projects.linpro.no/wiki/LinuxInstallation

返回列表
Namecheap
Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
互联网安全