首页 > 其他 > 详细

CentOS 7上安装Munin 监控

时间:2020-05-25 17:59:13      阅读:62      评论:0      收藏:0      [点我收藏+]

1.添加EPEL仓库(如果已安装可以跳过,如有提示按“y"键 确认继续)

# yum install epel-release
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

升级包管理:(可以跳过

# yum update

2.安装Apache Web服务器(如有提示按“y"键 确认继续)

#yum install httpd

技术分享图片

 

 

启用Apache服务,并查看服务状态

#systemctl enable httpd 
#systemctl start httpd 
#systemctl status httpd

技术分享图片

 

 

3.使用‘yum‘命令通过CentOS 上的可用存储库安装Munin和Munin Node(如有提示按“y"键 确认继续)(目前安装的是Munin version 2.0.54 )

# yum install munin munin-node

技术分享图片

 

 

启用Munin Node服务

# systemctl enable munin-node
# systemctl start munin-node
# systemctl status munin-node

技术分享图片

 

 

4.Munin配置(修改/etc/munin/munin.conf文件)

# vim /etc/munin/munin.conf
修改(把以下配置前面的#号去掉,如下):
[localhost]
    address 127.0.0.1
    use_node_name yes

修改(把以下配置前面的#号去掉,如下)
dbdir     /var/lib/munin
htmldir   /var/www/html/munin
logdir    /var/log/munin
rundir    /var/run/munin
tmpldir   /etc/munin/templates
includedir /etc/munin/conf.d

5.配置 apache web 服务器使其包括 munin 配置。在 /etc/apache/conf.d 目录中编辑或创建文件 munin.conf 用于包括 Munin 和 Apache 相关的配置,另外注意一点,默认其它和 web 相关的 Munin 配置保存在 /var/www/munin 目录。

vim /etc/apache/conf.d/munin.conf

内容:

Alias /munin /var/www/html/munin
<Directory /var/www/html/munin>
    AuthUserFile /etc/munin/munin-htpasswd
    AuthName "admin"
    AuthType Basic
    require valid-user
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 172.0.0.0/24    
</Directory>

6:为 web 界面创建用户名和密码。现在为查看 munin 的图示而创建用户名和密码,命令如下(账号:munin 密码123456(你可以修改成你记住的密码)):

# htpasswd -c /etc/munin/munin-htpasswd munin

技术分享图片

 

 

7.重启Apache与munin-node

# systemctl restart httpd
# systemctl restart munin-node

8.输入网址:http://127.0.0.1/munin/index.htm  输入账号munin 密码123456即可访问

如果提示Forbidden  You don‘t have permission to access /munin/ on this server.用命令

chmod -R 777  /var/www/html/munin/*

技术分享图片

 

参考文章:

https://www.cnblogs.com/linuxprobe/p/5340054.html

http://www.vue5.com/centos/23012.html

https://www.cnblogs.com/longronglang/p/8295186.html

 https://www.zxar520.com/linux/623.html

https://www.cnblogs.com/vae860514/p/8276916.html

CentOS 7上安装Munin 监控

原文:https://www.cnblogs.com/q149072205/p/12958106.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!