Giter Site home page Giter Site logo

agent-go's Introduction

Zabbix Agent-go

使用 https://github.com/fujiwara/go-zabbix-get 实现的一个支持被动检查的Agent,源码及打包好的Agent的rpm包 详细使用说明:https://blog.cactifans.com/2019/03/29/%E4%BD%BF%E7%94%A8Golang%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84Zabbix-Agent/
RPM包:https://dl.cactifans.com/tools/agent-go-0.0.1-1.el7.x86_64.rpm
hash

3c39e829e1611543170b3f26fad128a123270234  agent-go-0.0.1-1.el7.x86_64.rpm

模版:https://dl.cactifans.com/tools/template_linux_agent_go.tar.gz
目前一共实现里6个监控指标的被动采集,数据采集使用github.com/shirou/gopsutil

ItemKey 说明 单位
system.info 操作系统信息
agent.go.ping 类似agent.ping检查agent状态
cpu.model cpu类型
mem.total 总内存 MB
mem.used 已使用内存 MB
mem.usedper 内存使用率 %

源码编译

如需修改或编译,可使用以下方法 golang版本1.11以上

git clone https://github.com/canghai908/agent-go.git
cd agent-go/src/
export GO111MODULE=on
export GOPROXY=https://goproxy.io
go build

即可编译成功

使用

目前只提供centos7_x64位rpm包,下载并安装RPM包

wget https://dl.cactifans.com/tools/agent-go-0.0.1-1.el7.x86_64.rpm
rpm -ivh agent-go-0.0.1-1.el7.x86_64.rpm

启动agent

systemctl start agent-go

查看Agent进程

ps -ef|grep agent-go

可以看到agent已经启动

root      5018     1  1 10:12 ?        00:00:00 /usr/bin/agent-go -c /etc/agent-go/agent-go.ini

Agent配置文件位于

/etc/agent-go/agent-go.ini

配置文件介绍

Debug 日志级别1-7
ListenIP agent监听的ip,默认为0.0.0.0所有ip
ListenPort agent监听的port,默认为10049
LogFile 日志路径,默认为/var/log/agent-go.log

Zabbix中导入模版,新建一个主机,并关联导入的模版,主机名可以随意,IP为部署agent的机器ip,端口为10049 1 添加并关联模版。 2 不出意外一会就可以看到主机的Agent状态已变为可用状态 3 并能在Last data里看到最新的数据 4

agent-go's People

Contributors

canghai908 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

agent-go's Issues

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.