gaochao1 / swcollector Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
"switch":{
"enabled": true,
"ipRange":[
"172.31.*.*/ 32"
],
.......
"heartbeat": {
"enabled": true,
"addr": "127.0.0.1:6030",
"interval": 60,
"timeout": 1000
},
"transfer": {
"enabled": true,
"addr": "127.0.0.1:8433",
"interval": 60,
"timeout": 1000
}
这是我的cfg.json配置
在添加host的框中添加交换机IP后,提示no such host, 但是在dashboard中有该交换机的监控数据。
而且open-falcon 自带的agent所处的机器是能够添加到portal的。
不知道是什么问题,求解? 谢谢了
目前不支持 不同community的交换机设备监控
超时是不是因为这里, 毫秒当秒用了
/ Creates a new SNMP Client. Target is the IP address, Community the SNMP Community String and Version the SNMP version.
// Currently only v2c is supported. Timeout parameter is measured in seconds.
func NewGoSNMP(target, community string, version SnmpVersion, timeout int64) (*GoSNMP, error) {
if !strings.Contains(target, ":") {
target = fmt.Sprintf("%s:%d", target, DEFAULT_PORT)
}
// Open a UDP connection to the target
conn, err := net.DialTimeout("udp", target, time.Duration(timeout)*time.Millisecond)
if err != nil {
return nil, fmt.Errorf("Error establishing connection to host: %s\n", err.Error())
}
s := &GoSNMP{target, community, version, time.Duration(timeout) * time.Second, conn, l.CreateLogger(false, false)}
return s, nil
}
您好,我使用的华为的网络设备,我知道设备的ODI值,我如何自定义内容。
比如:我知道设备名称,内存使用录,温度等的odi值,我在swcollector里面应该如何做才会在dashboard网页显示出相应的东西。目前dashboard只会显示设备的cpu使用录
兄弟:
你好。非常感谢该插件给我们监控实时和离线集群接入和核心交换机带来的便利,爱不释手。
最近随着业务量的增加,虽然交换机的上联带宽还有50%的剩余带宽,但是我们怀疑交换机设备在数据传输中造成的丢包影响到了上层应用的稳定性,尤其是实时集群。
当前该插件还不支持网络设备丢包检查,希望兄弟可以添加该支持。
再次感谢。
control start 启动提示 failed to run command `./falcon-swcollector': No such file or directory错误,我找了一下的确没有falcon-swcollector文件,为什么呢?
2017/04/25 06:13:09 swping.go:41: 192.168.1.1 lookup 192.168.1.1: too many open files
2017/04/25 06:13:09 swping.go:41: 192.168.1.2 lookup 192.168.1.2: too many open files
2017/04/25 06:13:09 swping.go:41: 192.168.1.3 lookup 192.168.1.3: too many open files
2017/04/25 06:13:09 swping.go:41: 192.168.1.4 lookup 192.168.1.4: too many open files
2017/04/25 06:13:09 swping.go:41: 192.168.1.5 lookup 192.168.1.5: too many open files
2017/04/25 06:13:09 swping.go:41: 192.168.1.6 lookup 192.168.1.6: too many open files
2017/04/25 06:15:22 rpc.go:44: dial 192.168.43.94:161:8433 fail: dial tcp 192.168.43.94:161:8433: socket: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp: lookup 192.168.1.1: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp: lookup 192.168.1.2: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp 192.168.1.3:161: socket: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp: lookup 192.168.1.4: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp: lookup 192.168.1.5: too many open files
2017/04/25 06:15:18 swmem.go:40: Error establishing connection to host: dial udp: lookup 192.168.1.6: too many open files
最新的版本V4.0.6无法收集这个较旧的交换机内存和CPU信息
CPU: 1.3.6.1.4.1.2011.6.1.1.1.2 Gauge32
MEM: 1.3.6.1.4.1.2011.10.2.6.1.1.1.1.8.20 Integer
func getH3CHWcpumem 这个函数在采取 这个版本的MEM时的method要改为get方式
看是否把getH3CHWcpumem函数多加一个参加传一个method进去
aa
我直接ping交换机的管理口是通的,但监控日志报下面的错,传上来的值一直都是-1.。。请问这种报错是怎么回事啊?
swping.go:40: 10.127.. dial ip4:icmp 10.127..: operation not permitted
另外再问下一台普通的主机(4C8G)能监控多少台交换机呢?
请问swcollector对于交换机整体的进出口流量能进行统计吗?
现在只能看到单个端口的进出口流量、或者通过sum方法进行累加。
如果有,是哪个counter? 谢谢。
根据你的代码,我加了下把每次swping之后都去操作一次mysql数据库把这个主机的相关信息如ping的次数,失败次数,当前ping的延时等信息记录到mysql当中,这样对这台主机就可以做些其它的数据分析。但我不会写GO,加完后运行几个小时后,进程就报错了。。。也不知道什么原因。
光衰 arp丢包率考虑增加吗
swcollector可以采集服务器的指标吗,通过snmp和自定义oid。
是不是只要snmp可以获取的指标,就可以用swcollector去采集。
测试报错:
2018/01/26 14:58:32 cfg.go:138: read config file: cfg.json successfully
2018/01/26 14:58:32 hostcfg.go:51: read hostconfig file: ./hosts.json successfully
2018/01/26 14:58:32 http.go:68: listening :1990
2018/01/26 14:58:32 swifstat.go:149: UpdateIfStats start. The number of concurrent limited to 1000. IP addresses number is 1
2018/01/26 14:58:32 swifstat.go:151: get snmp message by gosnmp
2018/01/26 14:58:37 ifstat.go:459: 172.31.6.112 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 172.31.6.113:47978->172.31.6.112:161: i/o timeout
2018/01/26 14:58:37 ifstat.go:459: 172.31.6.112 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 172.31.6.113:51990->172.31.6.112:161: i/o timeout
2018/01/26 14:58:37 ifstat.go:459: 172.31.6.112 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 172.31.6.113:55929->172.31.6.112:161: i/o timeout
2018/01/26 14:58:37 ifstat.go:459: 172.31.6.112 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 172.31.6.113:56109->172.31.6.112:161: i/o timeout
2018/01/26 14:58:37 swifstat.go:402: UpdateIfStats complete. Process time 5.83268415s. Number of active ip is 1
2018/01/26 14:58:37 swifstat.go:406: AliveIp: 0 172.31.6.112
2018/01/26 14:58:43 swcpu.go:43: Error reading from UDP: read udp 172.31.6.113:57453->172.31.6.112:161: i/o timeout
2018/01/26 14:58:49 swmem.go:43: Error reading from UDP: read udp 172.31.6.113:49271->172.31.6.112:161: i/o timeout
2018/01/26 14:58:50 collector.go:74: INFO : Send metrics to transfer running in the background. Process time : 100.561342ms Send metrics : 1
2018/01/26 14:58:50 var.go:96: <= <Total=1, Invalid:0, Latency=0ms, Message:ok>
用snmpwalk命令测试是没问题的
现在采集间隔都是5分钟,想问下如果想挑战成其他时间如何修改。谢谢
有一些数据一般是固定不变的,比如交换机 vendor,交换机ifname和ifindex等。
这些数据没必要每分钟都采集一次吧,建议将这些数据缓存下来,定期进行更新,可以减少交换机的压力。
我看是直接每次获取整个列表的状态,然后集中发送数据。不知道这样做都有什么优劣呢? #
请问如何设置swcollector 通过snmp抓取hostname
我想添加h3c或者cisco 交换机的hostname 进行识别,目前只能看到全部都是ip,设备过多不太方便。谢谢、
默认60s采集发动采集一次,能修改这个值吗?
我定义了几个metrics在custom.json里面,感觉不起作用
什么时候支持snmp v3协议获取?
在配置报警的时候,使用带宽需要根具不同的交换机端口绑定不同的模板。如果能添加百分比,可以根具不同的业务区分不同的报警阀值,方便配置。所以希望添加带宽百分比上报。
通过 swcollector 的各种断图, 自带的agent 没问题, 查看last value 有数据, history 就没数据了
var.go:87: call Transfer.Update fail connection is shut down
如果后端的transfer或者gateway重启,导致swcollector现有建立的链接断开,那么在发送数据的时候则会失败。
而实际上在发送数据时刻,transfer或者gateway服务是正常的。
因此在rpc.go this.insureConn()
这个函数调用中,最好增加对链接状态的检查,如果链接是已经被断开的链接,那么需要重新建立一个新的链接。
或者在发送的时候增加重试,默认重试三次没有成功再丢弃也可以。
现在都修改了端口.无法监控.
你好:
请教下,我监控的核心交换端口太多,数量太大。但我实际并不需要监控这么多,并且全部监控会有udp I/O 部分接口超时 等问题会极大影响效率导致断图。
所以我如何配置可以做到仅获取部分端口?
谢谢。求指导。
采集流量数据和cacti上对比出入比较大,我部署了两套。两套采集出来的数据差异也比较大,大家在用 的时候有这个问题吗?
Hi,你好,
我在使用时遇到如下问题,请您帮忙查看下:
交换机:华为CE6850交换机
error log : 2016/06/07 17:31:02 ifstat_snmpwalk.go:16: 10.6.0.130 Recovered in ListIfStats_SnmpWalk runtime error: slice bounds out of range
查看代码后发现是这一样包的错
ifstatus := ifstatus_string[(len(ifstatus_string) - 2):(len(ifstatus_string) - 1)]
请问这一样的作用是为了更好的兼容吗?
我的交换机取出来的数据为1或2,len后截取为 ifstatus_string[-1:0] 这样会panic
根据生产环境反馈,20台交换机,长时间运行,本地会存在大量的udp连接,本地端口161 到远程交换机的established的连接,达到1000多个。
通过在gosnmp库里面的gosnmp.go文件第141行,sendPacket函数中,加入一行代码,
defer x.conn.Close()予以解决,麻烦作者看看,这样改行不行?
可否调整为将交换机的HOSTNAME作为 Endpoint 上报给Server
如题, 该如何配置生效?
PS. 这么好的开源项目, 不继续维护就太可惜了 :(
你好:
多个交换机不同的community在cfg.json里如何配置?
测试的时候发现一些细节问题:
https://github.com/humorless/esxicollector
ESXi collector can collect monitoring info through SNMP protocol and push the info into open-falcon system .
2017/07/18 16:06:04 collector.go:74: INFO : Send metrics to transfer running in the background. Process time : 100.13773ms Send metrics : 8
2017/07/18 16:06:04 var.go:79: <= <Total=8, Invalid:6, Latency=0ms, Message:ok>
2017/07/18 16:06:48 swifstat.go:97: UpdateIfStats start. The number of concurrent limited to 1000. IP addresses number is 2
2017/07/18 16:06:48 swifstat.go:99: get snmp message by gosnmp
2017/07/18 16:06:54 ifstat.go:420: 10.17.255.228 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 10.19.247.239:56558->10.17.255.228:161: i/o timeout
2017/07/18 16:06:54 ifstat.go:420: 134.80.66.145 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 10.19.247.239:57661->134.80.66.145:161: i/o timeout
2017/07/18 16:06:54 ifstat.go:420: 10.17.255.228 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 10.19.247.239:59462->10.17.255.228:161: i/o timeout
2017/07/18 16:06:54 ifstat.go:420: 134.80.66.145 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 10.19.247.239:51320->134.80.66.145:161: i/o timeout
2017/07/18 16:06:54 ifstat.go:420: 134.80.66.145 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 10.19.247.239:47045->134.80.66.145:161: i/o timeout
2017/07/18 16:06:54 ifstat.go:420: 10.17.255.228 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 10.19.247.239:34115->10.17.255.228:161: i/o timeout
2017/07/18 16:07:00 ifstat.go:420: 134.80.66.145 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 10.19.247.239:56622->134.80.66.145:161: i/o timeout
2017/07/18 16:07:00 ifstat.go:420: 10.17.255.228 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 10.19.247.239:47996->10.17.255.228:161: i/o timeout
2017/07/18 16:07:00 swifstat.go:343: UpdateIfStats complete. Process time 11.512736182s. Number of active ip is 2
2017/07/18 16:07:00 swifstat.go:347: AliveIp: 0 10.17.255.228
2017/07/18 16:07:00 swifstat.go:347: AliveIp: 1 134.80.66.145
麻烦给看看是什么原因? 网络测试不存在问题
ifName=GE2/0/48 switch.if.In out of range, value is -1.4739726986666667e+08
hi,
现在是采集思科N7K,上面接口全部是万兆,目前出的图全部是10G,并不是实际使用结果。请问下有解放方案吗?感谢;)
请问流量采集处理后推送到openfalcon的流量单位是MB 还是Mb?
这种情况会造成上报给transfer时出现Invalid,所以建议在swcpu.go swmem.go的第28行增加一个对ip是否存在做一个判断
if swCpu.Ip !="" { L = append(L, GaugeValueIp(time.Now().Unix(), swCpu.Ip, "switch.CpuUtilization", swCpu.CpuUtil)) }
发现在swcollector在数据溢出的时候,会产生很高的带宽值~
2018/01/12 12:00:18 swifstat.go:343: 10.x.x.x ifName=te-1/1/48 switch.if.InPkts out of range, value is -4.184087614375e+10 Limit is 0
2018/01/12 12:00:18 swifstat.go:344: IfHCInUcastPkts This Time: 0
2018/01/12 12:00:18 swifstat.go:345: IfHCInUcastPkts Last Time: 2343089064050
2018/01/12 12:00:18 swifstat.go:350: 10.x.x.x ifName=te-1/1/48 switch.if.OutPkts out of range, value is -8.215622851060715e+10 Limit is 0
2018/01/12 12:00:18 swifstat.go:351: IfHCOutUcastPkts This Time: 0
2018/01/12 12:00:18 swifstat.go:352: IfHCOutUcastPkts Last Time: 4600748796594
2018/01/12 12:01:20 swifstat.go:386: 10.x.x.x ifName=te-1/1/31 switch.if.Out out of range, value is -3.9480259035865006e+14
2018/01/12 12:01:20 swifstat.go:387: IfHCOutOctets This Time: 0
2018/01/12 12:01:20 swifstat.go:388: IfHCOutOctets Last Time: 3059720075279538
2018/01/12 12:01:20 swifstat.go:386: 10.x.x.x ifName=te-1/1/48 switch.if.Out out of range, value is -8.631224720379616e+14
2018/01/12 12:01:20 swifstat.go:387: IfHCOutOctets This Time: 0
2018/01/12 12:01:20 swifstat.go:388: IfHCOutOctets Last Time: 6689199158294203
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.