知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
http://munin-monitoring.org/
$ sudo apt-get install munin neo@monitor:~$ sudo vim /etc/munin/munin.conf neo@monitor:~$ sudo service munin-node restart [example.com] address 127.0.0.1 use_node_name yes [web2] address 172.16.1.2 use_node_name yes [web3] address 172.16.1.3 use_node_name yes [database] address 172.16.1.10 use_node_name yes
sudo apt-get install munin-node vim /etc/munin/munin-node.conf allow ^172\.16\.1\.2$
ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins/
/etc/munin/plugin-conf.d/munin-node
$ sudo vim /etc/munin/plugin-conf.d/munin-node [mysql*] user root env.mysqlopts --defaults-file=/etc/mysql/debian.cnf env.mysqluser debian-sys-maint env.mysqlconnection DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf [mysql*] env.mysqlopts -h 192.168.3.40 -uneo -pchen
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm # yum install munin -y # yum install munin-node -y # yum install munin-java-plugins -y # yum install unbound-munin -y # service munin-node start # chkconfig munin-node on
test
# telnet localhost 4949 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. # munin node at datacenter.example.com list cpu df df_inode entropy forks fw_packets http_loadtime if_err_eth0 if_eth0 interrupts iostat iostat_ios irqstats load memory munin_stats netstat open_files open_inodes proc_pri processes sendmail_mailqueue sendmail_mailstats sendmail_mailtraffic swap threads uptime users vmstat yum
http://localhost/munin/
$ sudo vim /etc/apache2/conf.d/munin.conf AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user
config: /etc/munin/munin-node.conf
plugins: /usr/share/munin/plugins/
mysql
# ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins
# vim /etc/munin/plugin-conf.d/munin-node env.mysqlopts -uneo -pchen # or env.mysqlopts -h 172.16.1.17 -u monitor -ppassword # service munin-node start
驗證安裝,telnet localhost 4949 之後,執行 fetch mysql_queries
apache
# ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins
# vim /etc/httpd/conf/httpd.conf ExtendedStatus On <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .example.com Allow from localhost </Location>
# /etc/init.d/httpd restart # service munin-node restart
驗證安裝,telnet localhost 4949 之後,執行 fetch apache_processes
memcached plugin要求符號連結名字的格式是: memcached_connections_[IP Address]_[Port], IP與Port是在符號連結名字中配置的
ln -s /usr/share/munin/plugins/memcached_bytes_ /etc/munin/plugins/memcached_bytes_127_0_0_1_11211 ln -s /usr/share/munin/plugins/memcached_connections_ /etc/munin/plugins/memcached_connections_127_0_0_1_11211 ln -s /usr/share/munin/plugins/memcached_hits_ /etc/munin/plugins/memcached_hits_127_0_0_1_11211 ln -s /usr/share/munin/plugins/memcached_items_ /etc/munin/plugins/memcached_items_127_0_0_1_11211 ln -s /usr/share/munin/plugins/memcached_requests_ /etc/munin/plugins/memcached_requests_127_0_0_1_11211 ln -s /usr/share/munin/plugins/memcached_traffic_ /etc/munin/plugins/memcached_traffic_127_0_0_1_11211
驗證安裝,telnet localhost 4949 之後,執行 fetch memcached_requests_127_0_0_1_11211
# vim /etc/munin/munin.conf # a simple host tree [localhost] address 127.0.0.1 use_node_name yes [database] address 192.168.3.40 use_node_name yes