collectd+influxdb+grafana组建监控系统

collectd

安装

yum -y install epel-release
yum -y install collectd

配置

vi /etc/collectd.conf

Hostname    "docker-1"
FQDNLookup   true
Interval     10
Timeout         4
LoadPlugin network
<Plugin network>
    Server "172.16.114.201" "25826"
</Plugin>

启动

systemctl start collectd.service
systemctl enable collectd.service

influxdb

配置yum

cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo

[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

安装

yum install influxdb

启动

systemctl start influxdb
systemctl enable influxdb

创建库

influx
CREATE DATABASE collectd
use collectd
CREATE USER "root" WITH PASSWORD 'root' WITH ALL PRIVILEGES

配置

vi /etc/influxdb/influxdb.conf

hostname = "172.16.114.201"
 [[collectd]]
    enabled = true
    bind-address = "172.16.114.201:25826"
    database = "collectd"
    #retention-policy = ""
    #/usr/share/collectd/types.db这个文件,安装collectd之后才会有,没有这个文件时,打开了这个配置,influx是启动不了的
    typesdb = "/usr/share/collectd/types.db"

重启

systemctl restart influxdb

查看25826这个端口是否已经监听,如果有,则代表启动正常

[root@localhost influxdb]# netstat -anp| grep 25826
udp        0      0 172.16.114.201:25826    0.0.0.0:*   125967/influxd

Grafana

下载

需要FQ,地址为https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm

安装

rpm -ivh grafana-2.6.0-1.x86_64.rpm

启动

systemctl enable grafana-server
systemctl start grafana-server

访问

http://172.16.114.201:3000/
用户名:root
密码:root

配置数据源

3CC39BC7-661D-4EE3-B719-7BEEE0A130BA.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容