open-falcon ---客户机agent操作

简介:

open-falcon的agent用于采集机器负载监控指标,比如cpu.idle、load.1min、disk.io.util等等,每隔60秒push给Transfer。agent与Transfer建立了长连接,数据发送速度比较快,agent提供了一个http接口/v1/push用于接收用户手工push的一些数据,然后通过长连接迅速转发给Transfer。agent项目之前是一个独立项目名字叫falcon-eye ,其自带有web页面来自于linux-dash项目。参考:https://book.open-falcon.org/zh/quick_install/graph_components.html

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
客户机上只需要配置启动agent即可:
[root@IDC-Admin-02 ~] # cat /data/work/open-falcon/agent/cfg.json
{
     "debug" true ,
     "hostname" "" ,
     "ip" "" ,
     "plugin" : {
         "enabled" false ,                                     #默认不开启插件机制
         "dir" "./plugin" ,
         "git" "https://github.com/open-falcon/plugin.git" ,
         "logs" "./logs"
     },
     "heartbeat" : {
         "enabled" true ,                                     #此处enabled要设置为true
         "addr" "127.0.0.1:6030" ,                            #hbs的地址,端口是hbs的rpc端口
         "interval" : 60,
         "timeout" : 1000
     },
     "transfer" : {
         "enabled" true ,                                    #此处enabled要设置为true
         "addrs" : [
             "192.168.1.30:8433" ,                            #transfer的地址,这里写服务端的IP地址,因为transfer部署在服务端,端口是transfer的rpc端口
             "192.168.1.30:8433"
         ],
         "interval" : 60,
         "timeout" : 1000
     },
     "http" : {
         "enabled" true ,
         "listen" ":1988" ,
         "backdoor" false
     },
     "collector" : {
         "ifacePrefix" : [ "bond" "em" ]            #默认配置只会采集网卡名称前缀是bond、em的网卡流量,配置为空就会采集所有的,lo的也会采集。
     },
     "ignore" : {                                  #默认采集了200多个metric,可以通过ignore设置为不采集
         "cpu.busy" true ,
         "df.bytes.free" true ,
         "df.bytes.total" true ,
         "df.bytes.used" true ,
         "df.bytes.used.percent" true ,
         "df.inodes.total" true ,
         "df.inodes.free" true ,
         "df.inodes.used" true ,
         "df.inodes.used.percent" true ,
         "mem.memtotal" true ,
         "mem.memused" true ,
         "mem.memused.percent" true ,
         "mem.memfree" true ,
         "mem.swaptotal" true ,
         "mem.swapused" true ,
         "mem.swapfree" true
     }
}
 
 
[root@IDC-Admin-02 ~] # cd /data/work/open-falcon/agent/
[root@IDC-Admin-02 agent] # ./control start
falcon-agent started..., pid=183538
[root@IDC-Admin-02 agent] # ps -ef|grep 183538
root     183538      1  0 00:08 pts /0     00:00:00 . /falcon-agent  -c cfg.json
root     183555 183270  0 00:08 pts /0     00:00:00  grep  183538
[root@IDC-Admin-02 agent] # lsof -i:1988
COMMAND      PID USER   FD   TYPE  DEVICE SIZE /OFF  NODE NAME
falcon-ag 183538 root    4u  IPv6 9968490      0t0  TCP *: tr -rsrb-p2 (LISTEN)
 
验证
看var目录下的log是否正常,或者浏览器访问其1988端口。另外agent提供了一个--check参数,可以检查agent是否可以正常跑在当前机器上。
[root@IDC-Admin-02 agent] # ./falcon-agent --check
cpustat  ... ok
disk.io  ... ok
memory   ... ok
ss -s    ... ok
netstat   ... ok
ss -tln  ... ok
ps  aux   ... ok
du  -bs   ... ok
kernel   ... ok
df .bytes ... ok
net. if    ... ok
loadavg  ... ok
 
打开url  http: //IP :1988可以查看相关监控信息   (假设这里客户机ip为192.168.1.22)

由于这台客户机的hostname为IDC-Admin-02。所以可以在服务端的dashboard界面里搜索Endpoint。(这里是根据客户机的hostname来匹配搜索的,可以将客户机的主机名按照一定的规则命名或者做hosts映射,比如web01.wang.com、web02.wang.com、backup.wang.com等*.wang.com,那么这里Endpoint搜索的话,就根据wang.com进行搜索,就会匹配出对应的客户机)

***************当你发现自己的才华撑不起野心时,就请安静下来学习吧***************

本文转自散尽浮华博客园博客,原文链接:http://www.cnblogs.com/kevingrace/p/7361963.html,如需转载请自行联系原作者
相关文章
|
1月前
|
监控 Unix Windows
Zabbix【部署 04】 Windows系统安装配置agent及agent2
Zabbix【部署 04】 Windows系统安装配置agent及agent2
289 0
|
1月前
|
缓存 监控 安全
zabbix服务器监控之了解agent的启动过程
zabbix服务器监控之了解agent的启动过程
31 0
|
1月前
|
监控 网络协议 Unix
centos7 zabbix安装客户端agent -配置监控远程主机 在需要监控的电脑上安装
centos7 zabbix安装客户端agent -配置监控远程主机 在需要监控的电脑上安装
58 0
|
11月前
|
监控 网络协议 Shell
使用脚本安装zabbix agent 6.0(新手友好)
使用脚本安装zabbix agent 6.0(新手友好)
|
10月前
|
存储 数据采集 缓存
【运维知识进阶篇】Zabbix5.0稳定版详解9(Zabbix优化:高并发对MySQL进行拆分、Zabbix-agent主动上报模式、使用proxy代理模式、系统自带监控项优化、进程优化、缓存优化)
【运维知识进阶篇】Zabbix5.0稳定版详解9(Zabbix优化:高并发对MySQL进行拆分、Zabbix-agent主动上报模式、使用proxy代理模式、系统自带监控项优化、进程优化、缓存优化)
324 0
|
11月前
|
运维 监控
【运维】在zabbix-server的web界面配置agent主机监控
【运维】在zabbix-server的web界面配置agent主机监控