Ubuntu怎么配置Munin

這篇文章主要講解了“Ubuntu怎么配置Munin”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Ubuntu怎么配置Munin”吧!

成都創(chuàng)新互聯(lián)公司是一家專(zhuān)注于網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站制作與策劃設(shè)計(jì),內(nèi)丘網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專(zhuān)注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計(jì)領(lǐng)域的專(zhuān)業(yè)建站公司;建站業(yè)務(wù)涵蓋:內(nèi)丘等地區(qū)。內(nèi)丘做網(wǎng)站價(jià)格咨詢:18982081108

1. 添加apt源

1

2

3

sudo add–apt–repository ppa:tuxpoldo/munin

sudo apt–get update

sudo apt–get dist–upgrade

可能要導(dǎo)入key,方法如下

1

sudo apt–key adv —keyserver keyserver.ubuntu.com —recv–keys KEY_ID

2. 創(chuàng)建依賴關(guān)系和安裝

1

2

sudo apt–get build–dep munin

sudo apt–get install munin munin–node

munin主節(jié)點(diǎn)需要安裝munin和munin-node,被監(jiān)控節(jié)點(diǎn)只需要安裝munin-node。

3. 配置munin.conf

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

# Example configuration file for Munin, generated by ‘make build’

# The next three variables specifies where the location of the RRD

# databases, the HTML output, logs and the lock/pid files.  They all

# must be writable by the user running munin-cron.  They are all

# defaulted to the values you see here.

#

#dbdir  /var/lib/munin

#htmldir /var/cache/munin/www

#logdir /var/log/munin

#rundir  /var/run/munin

# Where to look for the HTML templates

#

#tmpldir        /etc/munin/templates

# Where to look for the static www files

#

#staticdir /etc/munin/static

# temporary cgi files are here. note that it has to be writable by

# the cgi user (usually nobody or httpd).

#

# cgitmpdir /var/lib/munin/cgi-tmp

# (Exactly one) directory to include all files from.

includedir /etc/munin/munin–conf.d

# You can choose the time reference for “DERIVE” like graphs, and show

# “per minute”, “per hour” values instead of the default “per second”

#

#graph_period second

# Graphics files are generated either via cron or by a CGI process.

# See http://munin-monitoring.org/wiki/CgiHowto2 for more

# documentation.

# Since 2.0, munin-graph has been rewritten to use the cgi code.

# It is single threaded *by design* now.

#

#graph_strategy cron

# munin-cgi-graph is invoked by the web server up to very many times at the

# same time.  This is not optimal since it results in high CPU and memory

# consumption to the degree that the system can thrash.  Again the default is

# 6.  Most likely the optimal number for max_cgi_graph_jobs is the same as

# max_graph_jobs.

#

#munin_cgi_graph_jobs 6

# If the automatic CGI url is wrong for your system override it here:

#

#cgiurl_graph /munin-cgi/munin-cgi-graph

# max_size_x and max_size_y are the max size of images in pixel.

# Default is 4000. Do not make it too large otherwise RRD might use all

# RAM to generate the images.

#

#max_size_x 4000

#max_size_y 4000

# HTML files are normally generated by munin-html, no matter if the

# files are used or not. You can change this to on-demand generation

# by following the instructions in http://munin-monitoring.org/wiki/CgiHowto2

#

# Notes:

# – moving to CGI for HTML means you cannot have graph generated by cron.

# – cgi html has some bugs, mostly you still have to launch munin-html by hand

#

#html_strategy cron

# munin-update runs in parallel.

#

# The default max number of processes is 16, and is probably ok for you.

#

# If set too high, it might hit some process/ram/filedesc limits.

# If set too low, munin-update might take more than 5 min.

#

# If you want munin-update to not be parallel set it to 0.

#

#max_processes 16

# RRD updates are per default, performed directly on the rrd files.

# To reduce IO and enable the use of the rrdcached, uncomment it and set it to

# the location of the socket that rrdcached uses.

#

#rrdcached_socket /var/run/rrdcached.sock

# Drop somejuser@fnord.comm and anotheruser@trustauth.cn an email everytime

# something changes (OK -> WARNING, CRITICAL -> OK, etc)

#contact.sometrustauth.cnmand mail -s “Munin notification” somejuser@fnord.comm

#contact.anothertrustauth.cnmand mail -s “Munin notification” anotheruser@trustauth.cn

contact.ttlsa_monitor.command /usr/local/bin/sendEmail  –f support@ttlsa.com –s smtp.exmail.qq.com –xu support@ttlsa.com –xp ttlsa.com –o message–content–type=html  –o message–charset=utf8  –t monitor@ttlsa.com \

        –u “* ${if:cfields PROBLEM }${if:wfields PROBLEM }${if:fofields RECOVERY } – ${var:host}/${var:graph_title} is ${if:cfields CRITICAL}${if:wfields WARNING}${if:fofields OK} *” \

        –m “Group: ${var:group}<p> Host: ${var:host}<p> \

            Warngin: ${loop<,>:wfields – ${var:value} outside range [${var:wrange}] (${var:label})}<p> \

                Critical: ${loop<,>:cfields – ${var:value} outside range [${var:crange}] (${var:label})}<p> \

                OK: ${ loop<,>:fofields – ${var:value} = ${var:label} }” \

         –l /tmp/mail.log

contact.ttlsa_monitor.always_send warning critical

#

# For those with Nagios, the following might come in handy. In addition,

# the services must be defined in the Nagios server as well.

#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf

# Alert log

contact.log.command tee –a /var/log/munin/alert.log

# a simple host tree

[ttlsa;web1]

    address X.X.X.X

    use_node_name yes

    contacts ttlsa_monitor

4. 配置munin-node.conf

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

#

# 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 root

# This is the timeout for the whole transaction.

# Units are in sec. Default is 15 min

#

# global_timeout 900

# This is the timeout for each plugin.

# Units are in sec. Default is 1 min

#

# timeout 60

# Regexps for files to ignore

ignore_file [\#~]$

ignore_file DEADJOE$

ignore_file \.bak$

ignore_file %$

ignore_file \.dpkg–(tmp|new|old|dist)$

ignore_file \.rpm(save|new)$

ignore_file \.pod$

# Set this if the client doesn’t report the correct hostname when

# telnetting to trustauth.cn, port 4949

#

#host_name trustauth.cn.localdomain

host_name web1

# 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 ^::1$

allow ^X\.X\.X\.X$    #munin master ip address

# 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 N.N.N.N

# host 127.0.0.1

# And which port

port 4949

5. 插件生效

1

sudo munin–node–configure —shell —families=contrib,auto | sh –x

或者,自己創(chuàng)建軟連接即可。

6. 配置nginx

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

server {

        listen 80;

        server_name monitor.ttlsa.com;

        access_log  /data/logs/access–monitor.log;

        error_log /data/logs/error–monitor.log;

        location ^~ /munin–cgi/munin–cgi–graph/ {

                fastcgi_split_path_info ^(/munin–cgi/munin–cgi–graph)(.*);

                fastcgi_param PATH_INFO $fastcgi_path_info;

                fastcgi_pass unix:/var/run/munin/fcgi–graph.sock;

                include fastcgi_params;

        }

        location /munin/static/ {

                alias /etc/munin/static/;

        }

        location /munin {

                alias /var/cache/munin/www/;

                auth_basic “mechat munin”;

                auth_basic_user_file “/etc/munin/munin-htpasswd”;    

        }

        location / {

                rewrite ^/$ munin/ redirect; break;

        }

}

需要安裝spawn-fcgi,并啟動(dòng)下面的進(jìn)程。

1

spawn–fcgi –s /var/run/munin/fcgi–graph.sock –U www–data –u munin –g munin /usr/lib/munin/cgi/munin–cgi–graph

感謝各位的閱讀,以上就是“Ubuntu怎么配置Munin”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)Ubuntu怎么配置Munin這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

網(wǎng)站名稱(chēng):Ubuntu怎么配置Munin
網(wǎng)站網(wǎng)址:http://bm7419.com/article34/goidpe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、面包屑導(dǎo)航網(wǎng)站改版、全網(wǎng)營(yíng)銷(xiāo)推廣、用戶體驗(yàn)、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司