Giter Club home page Giter Club logo

swcollector's People

Contributors

freedomkk-qfeng avatar gaochao1 avatar goyzc avatar ulricqin avatar yimeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swcollector's Issues

open-falcon portal中无法添加交换机机器作为报警

"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的。
不知道是什么问题,求解? 谢谢了

gosnmp超时

超时是不是因为这里, 毫秒当秒用了

/ 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
}

关于dashboard添加网络设备odi相关咨询

您好,我使用的华为的网络设备,我知道设备的ODI值,我如何自定义内容。
比如:我知道设备名称,内存使用录,温度等的odi值,我在swcollector里面应该如何做才会在dashboard网页显示出相应的东西。目前dashboard只会显示设备的cpu使用录

是否可以新增 端口丢包统计

兄弟:

你好。非常感谢该插件给我们监控实时和离线集群接入和核心交换机带来的便利,爱不释手。

最近随着业务量的增加,虽然交换机的上联带宽还有50%的剩余带宽,但是我们怀疑交换机设备在数据传输中造成的丢包影响到了上层应用的稳定性,尤其是实时集群。

当前该插件还不支持网络设备丢包检查,希望兄弟可以添加该支持。

再次感谢。

too many open files

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

建议添加H3C低端交换机版本为 Software Version 3.10

最新的版本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进去

ping报错

我直接ping交换机的管理口是通的,但监控日志报下面的错,传上来的值一直都是-1.。。请问这种报错是怎么回事啊?

swping.go:40: 10.127.. dial ip4:icmp 10.127..: operation not permitted

另外再问下一台普通的主机(4C8G)能监控多少台交换机呢?

对于交换机整体的进出口流量统计

请问swcollector对于交换机整体的进出口流量能进行统计吗?
现在只能看到单个端口的进出口流量、或者通过sum方法进行累加。
如果有,是哪个counter? 谢谢。

能否增加收集的主机列表从数据库中读取,并把每次ping检测的结果统计到数据库对应的主机上去?

根据你的代码,我加了下把每次swping之后都去操作一次mysql数据库把这个主机的相关信息如ping的次数,失败次数,当前ping的延时等信息记录到mysql当中,这样对这台主机就可以做些其它的数据分析。但我不会写GO,加完后运行几个小时后,进程就报错了。。。也不知道什么原因。

snmp采集服务器指标

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命令测试是没问题的

snmp v3

什么时候支持snmp v3协议获取?

希望添加端口流量百分比

在配置报警的时候,使用带宽需要根具不同的交换机端口绑定不同的模板。如果能添加百分比,可以根具不同的业务区分不同的报警阀值,方便配置。所以希望添加带宽百分比上报。

断图

通过 swcollector 的各种断图, 自带的agent 没问题, 查看last value 有数据, history 就没数据了

堆叠交换机获取不全

作者您好,
我们是5个交换机合并为一个交换机使用,1/0/1-60 ,2/0/1-30 , 3/0/1-30, 4/0/1-30 有这么多口
但是只获取到了1/0/1-60 ,2/0/1-30,日志也没有其他报错,不知道哪里的问题,谢谢
版本4.0.6.3

qq 20180116181858

rpc链接状态未检查

var.go:87: call Transfer.Update fail connection is shut down

如果后端的transfer或者gateway重启,导致swcollector现有建立的链接断开,那么在发送数据的时候则会失败。
而实际上在发送数据时刻,transfer或者gateway服务是正常的。
因此在rpc.go this.insureConn() 这个函数调用中,最好增加对链接状态的检查,如果链接是已经被断开的链接,那么需要重新建立一个新的链接。

或者在发送的时候增加重试,默认重试三次没有成功再丢弃也可以。

如何获取交换机中仅需要的端口?

你好:
请教下,我监控的核心交换端口太多,数量太大。但我实际并不需要监控这么多,并且全部监控会有udp I/O 部分接口超时 等问题会极大影响效率导致断图。
所以我如何配置可以做到仅获取部分端口?
谢谢。求指导。

采集流量数据对不上

采集流量数据和cacti上对比出入比较大,我部署了两套。两套采集出来的数据差异也比较大,大家在用 的时候有这个问题吗?

流量计数器数据过大 出现数据为nil问题

监控思科设备时有如下报错:
image
查找源码将出现问题的oid找了出来,试着用snmpwalk命令采集了下接口计数器的数据,数据为:7501318007234174061`
但当修改源码“packet.go” 将rawValue.BERVariable打印出来发现为unknown
image
打印出来的结果:
image

不过使用snmpwalk模式就不会出现该问题。使用gosnmp就会有如上的报错。

snmpwalk 取端口状态报错问题

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

交换机采集存在与161端口之间建立大量连接问题

根据生产环境反馈,20台交换机,长时间运行,本地会存在大量的udp连接,本地端口161 到远程交换机的established的连接,达到1000多个。
通过在gosnmp库里面的gosnmp.go文件第141行,sendPacket函数中,加入一行代码,
defer x.conn.Close()予以解决,麻烦作者看看,这样改行不行?

sw Endpoint问题

可否调整为将交换机的HOSTNAME作为 Endpoint 上报给Server

ignore meric问题 & tag问题

测试的时候发现一些细节问题:

  1. 可不可以像falcon-agent那样有ignore功能,可以过滤掉不需要的指标(比如我认为默认cpu meric采集数据有误,我可以ignore掉然后自定义cpu meric)
  2. 默认的meric可不可以自定义tag
  3. 自定义meric的时候tag可以打多个吗?配置如何配

read udp io time out

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

麻烦给看看是什么原因? 网络测试不存在问题

采集思科N7K相关问题

hi,
现在是采集思科N7K,上面接口全部是万兆,目前出的图全部是10G,并不是实际使用结果。请问下有解放方案吗?感谢;)

[BUG] v4.0.6.3,out of range, value is -8.215622851060715e+10 Limit is 0

发现在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

所表现出的现象就是“2018/01/12 12:01”带宽高达几百T。
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.