Code Monkey home page Code Monkey logo

zbxtable's Introduction

English | 简体中文

ZbxTable

Build Status

ZbxTable is a Zabbix report system developed using Go language.

Features

  • Custom drawing topology
  • Device classification display and export
  • Export Zabbix alert messages to xlsx within a specific time period
  • Analyze the alarm messages in a specific time period, alarm Top 10, etc.

Architecture

1

Component

ZbxTable: Backend written using beego framework.

ZbxTable-Web: Front end written using Vue.

MS-Agent: Installed on Zabbix Server, used to receive alarms generated by Zabbix Server and send to ZbxTable.

Demo

https://demo.zbxtable.com

Compatibility

Zabbix Version Compatibility
6.4.x
6.2.x
6.0.x
5.4.x
5.2.x
5.0.x LTS
4.4.x
4.2.x
4.0.x LTS
3.4.x untested
3.2.x untested
3.0.x LTS untested

Documentation

ZbxTable Documentation

Code

ZbxTable: https://github.com/canghai908/zbxtable

ZbxTable-Web: https://github.com/canghai908/zbxtable-web

MS-Agent: https://github.com/canghai908/ms-agent

Compile

go >=1.21

mkdir -p $GOPATH/src/github.com/canghai908
cd $GOPATH/src/github.com/canghai908
git clone github.com/canghai908/zbxtable.git
cd zbxtable
wget -q -c https://dl.cactifans.com/stable/zbxtable/web-latest.tar.gz && tar xf web-latest.tar.gz
go install github.com/go-bindata/go-bindata/go-bindata@latest
./control build
./control pack

Team

Back-end development

canghai908

Front-end development

ahyiru

License

ZbxTable is available under the Apache-2.0 license. See the LICENSE file for more info.

zbxtable's People

Contributors

canghai908 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

zbxtable's Issues

zbxtable无法启动

日志提示信息:
6月 03 19:15:33 localhost.localdomain polkitd[1041]: Unregistered Authentication Agent for unix-process:128472:128796 (system bus name :1.42, object path /org/freedesktop/PolicyKit1/AuthenticationAgent
6月 03 19:15:33 localhost.localdomain bash[128479]: 2021/06/03 19:15:33.974 [I] [command.go:163]
6月 03 19:15:33 localhost.localdomain bash[128479]: $$$$$$$$\ $$$$$$$\ $$\ $$\ $$$$$$$$\ $$$$$$\ $$$$$$$\ $$\ $$$$$$$$
6月 03 19:15:33 localhost.localdomain bash[128479]: _$$ |$$ __$$\ $$ | $$ |_$$ __|$$ __$$\ $$ __$$\ $$ | $$ _____|
6月 03 19:15:33 localhost.localdomain bash[128479]: $$ / $$ | $$ |$$\ $$ | $$ | $$ / $$ |$$ | $$ |$$ | $$ |
6月 03 19:15:33 localhost.localdomain bash[128479]: $$ / $$$$$$$\ | $$$$ / $$ | $$$$$$$$ |$$$$$$$\ |$$ | $$$$$
6月 03 19:15:33 localhost.localdomain bash[128479]: $$ / $$ __$$\ $$ $$< $$ | $$ __$$ |$$ __$$\ $$ | $$ __|
6月 03 19:15:33 localhost.localdomain bash[128479]: $$ / $$ | $$ |$$ /$$\ $$ | $$ | $$ |$$ | $$ |$$ | $$ |
6月 03 19:15:33 localhost.localdomain bash[128479]: $$$$$$$$\ $$$$$$$ |$$ / $$ | $$ | $$ | $$ |$$$$$$$ |$$$$$$$$\ $$$$$$$$
6月 03 19:15:33 localhost.localdomain bash[128479]: _
|_/ _| _| _| _| _|_/ _|_______|
6月 03 19:15:33 localhost.localdomain bash[128479]: 2021/06/03 19:15:33.979 [I] [web.go:47] Connected to database zbxtable successfully!
6月 03 19:15:34 localhost.localdomain bash[128479]: 2021/06/03 19:15:34.092 [I] [web.go:47] Connected to zabbix web successfully!Zabbix version is : 5.2.5
6月 03 19:15:34 localhost.localdomain bash[128479]: table zbxtable_alarm already exists, skip
6月 03 19:15:34 localhost.localdomain bash[128479]: table zbxtable_manager already exists, skip
6月 03 19:15:34 localhost.localdomain bash[128479]: 2021/06/03 19:15:34.323 [E] [base.go:78] Login to Zabbix failed!
6月 03 19:15:34 localhost.localdomain systemd[1]: zbxtable.service: main process exited, code=exited, status=1/FAILURE
6月 03 19:15:34 localhost.localdomain systemd[1]: Unit zbxtable.service entered failed state.
6月 03 19:15:34 localhost.localdomain systemd[1]: zbxtable.service failed.

原先部署成功过一次,因为太久没用忘记密码,数据库密码也忘了。就重新部署了,结果几次都是这么提示,账号密码都没错。

主机页面报错TypeError: Cannot read property 'color' of undefined

TypeError: Cannot read property 'color' of undefined
at render (http://192.168.73.104:8088/js/views_srcManage_groups_jsx-views_srcManage_index_jsx-views_srcManage_templates_jsx-views_syst-0b9ab8_ce2659e1.chunk.js:1:5892)
at http://192.168.73.104:8088/js/vendors-node_modules_antd_es_table_index_js-node_modules_antd_es_table_style_css_js_64a8fca4.chunk.js:1:85085
at Ki (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:59001)
at Oa (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:66957)
at vo (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:107423)
at cu (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:97723)
at ou (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:97648)
at Zo (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:94678)
at http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:46385
at t.unstable_runWithPriority (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:127518)
at Wl (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:46094)
at Bl (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:46330)
at Hl (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:46265)
at qo (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:91463)
at ma (http://192.168.73.104:8088/js/react-vendors-node_modules_react-dom_index_js_59df9e09.js:2:63345)
at http://192.168.73.104:8088/js/vendors-node_modules_ant-design_icons_es_icons_AlertOutlined_js-node_modules_ant-design_icons-e9b21a_59df9e09.js:2:156754
微信截图_20210814161109

打开ZBXtable的图形管理无法正常显示图片

打开ZBXtable的图形管理无法正常显示图片
后台log报错
2021/10/22 08:39:08.544 [C] [panic.go:965] the request url is /v1/images/2683
2021/10/22 08:39:08.544 [C] [panic.go:965] Handler crashed with error can't find templatefile in the path:views/imagescontroller/getone.tpl

zbxtable服务启动报错

服务启动报错信息:
bash[6633]: [ORM]2020/12/02 10:43:07 register db Ping default, Error 1045: Access denied for user 'zbxtable'@'::1' (using password: YES)

zbxtable后台2.0升级2.1时报错table `zbxtable_manager` already exists, skip add column `zbxtable/models.Manager.Updated` for table `zbxtable_manager` ALTER TABLE `zbxtable_manager` ADD COLUMN `updated` datetime NOT NULL 2022/12/05 13:23:51.583 [E] [web.go:47] Error 1292: Incorrect datetime value: '0000-00-00 00:00:00'

zbxtable后台2.0升级2.1时报错
table zbxtable_manager already exists, skip add column zbxtable/models.Manager.Updated for table zbxtable_manager
ALTER TABLE zbxtable_manager ADD COLUMN updated datetime NOT NULL
2022/12/05 13:23:51.583 [E] [web.go:47] Error 1292: Incorrect datetime value: '0000-00-00 00:00:00'

初始化一个组后,大概20台主机,zbxtable无法启动

你好,初始化一个zabbix组后,大概20多台主机,zbxtable后台程序就启动失败了,日志如下:

panic: runtime error: index out of range [0] with length 0

goroutine 48 [running]:
zbxtable/models.TOP()
/opt/ss/zbxtable/models/cron.go:148 +0xea9
github.com/astaxie/beego/toolbox.(*Task).Run(0xc0004bc180)
/home/mygo/pkg/mod/github.com/astaxie/[email protected]/toolbox/task.go:145 +0x26
created by github.com/astaxie/beego/toolbox.run
/home/mygo/pkg/mod/github.com/astaxie/[email protected]/toolbox/task.go:431 +0x692

ms-agent安装成功,日志显示收到zabbix告警,但是前端界面不显示

您好,我在使用过程中遇到一些问题,试过了很多方法也花了很长时间还是没解决,想请您提供一点儿建议。
首先是我按照您提供的安装文档,安装ms-agent全程没有报错,zbxtable和ms-agent的token配置的也是一致的,在zabbix中测试ms-agent的媒介类型是成功的。
Snipaste_2022-07-28_21-57-21
但是当zabbix产生问题告警时ms-agent会提示"No message defined for media type."
Snipaste_2022-07-28_22-15-27
上网查询是因为没有配置报警媒介类型中的Message templates
Snipaste_2022-07-28_22-02-56
配置完后这个问题解决,zabbix显示将告警发送给了zbxtable,我将/usr/lib/zabbix/alertscripts
/app.ini中的模式调成Debug,查看/tmp文件夹下的日志文件也显示成功
Snipaste_2022-07-28_22-05-32
查看zbxtable日志/usr/local/zbxtable/logs/app/logs/app.log有大量的提示
Snipaste_2022-07-28_22-08-38
然后前端界面上没有任何显示(ms-agent-1.0.3.tar.gz或者ms-agent-1.0.4.tar.gz都是一样的效果)
Snipaste_2022-07-28_22-10-06
请问是我ms-agent的安装不对吗?或者配置有错误?我是卸载zbxtable1.0后安装2.0的,以前1.0版本没有这个问题。谢谢您的帮助

2.0.1 功能很棒

1、系统能实现自动采集服务器/网络资产CMDB(cpu数量、内存大小、磁盘大小、网卡速度、SN号码、MAC地址等)功能,好像有了基础功能,需要对接zabbix的采集模板和显示即可
2、实现top10功能,比如cpu/mem/disk/interface等

报表无法导出

使用rpm包安装的最新版zbxtable,资源管理-》图形管理里面,点击导出按钮,一直在转圈,无法导出数据

zbxtable 无法启动| zbxtable 脚本报错

[root@localhost zbxtable]# systemctl status zbxtable
● zbxtable.service - zbxtable
Loaded: loaded (/usr/lib/systemd/system/zbxtable.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 二 2020-08-11 10:26:15 CST; 5s ago
Process: 2472 ExecStart=/bin/bash -c /usr/local/zbxtable/zbxtable web (code=exited, status=2)
Main PID: 2472 (code=exited, status=2)

8月 11 10:26:15 localhost.localdomain systemd[1]: Started zbxtable.
8月 11 10:26:15 localhost.localdomain bash[2472]: table zbxtable_alarm already exists, skip
8月 11 10:26:15 localhost.localdomain bash[2472]: table zbxtable_manager already exists, skip
8月 11 10:26:15 localhost.localdomain bash[2472]: [ORM]2020/08/11 10:26:15 -[Queries/default] - [ OK / db.QueryRow / 0.3ms] - [SELECT id, username, passwo... - admin`
8月 11 10:26:15 localhost.localdomain bash[2472]: panic: interface conversion: interface {} is nil, not string
8月 11 10:26:15 localhost.localdomain systemd[1]: zbxtable.service: main process exited, code=exited, status=2/INVALIDARGUMENT
8月 11 10:26:15 localhost.localdomain systemd[1]: Unit zbxtable.service entered failed state.
8月 11 10:26:15 localhost.localdomain systemd[1]: zbxtable.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


[root@localhost zbxtable]# ./zbxtable install
2020/08/11 10:25:40.079 [I] [install.go:44] Zabbix API Address: https://monitor.cokutau.cn/api_jsonrpc.php
2020/08/11 10:25:40.079 [I] [install.go:45] Zabbix Admin User: xxxxxxxxxx
2020/08/11 10:25:40.079 [I] [install.go:46] Zabbix Admin Password: xxxxxxxxxx
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/canghai908/zabbix-go.(*API).Login(0xc0000853e0, 0xc000034f40, 0xc, 0xc000034f60, 0x9, 0xc000038330, 0x2a, 0x4f4a98, 0x68)
/home/mygo/pkg/mod/github.com/canghai908/[email protected]/base.go:141 +0x2b3
github.com/canghai908/zbxtable/cmd.installAagent(0xc0002de840)
/var/lib/jenkins/workspace/zbxtable-rpm-centos7/cmd/install.go:48 +0x331
github.com/urfave/cli.HandleAction(0xcfa6a0, 0xec1520, 0xc0002de840, 0xc0002de840, 0x0)
/home/mygo/pkg/mod/github.com/urfave/[email protected]/app.go:528 +0x7c
github.com/urfave/cli.Command.Run(0xe76f44, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe988e3, 0x27, 0x0, ...)
/home/mygo/pkg/mod/github.com/urfave/[email protected]/command.go:174 +0x57a
github.com/urfave/cli.(*App).Run(0xc0000e3880, 0xc00000e080, 0x2, 0x2, 0x0, 0x0)
/home/mygo/pkg/mod/github.com/urfave/[email protected]/app.go:279 +0x7c7
main.main()
/var/lib/jenkins/workspace/zbxtable-rpm-centos7/zbxtable.go:39 +0x16a


#zbxtable
appname = zbxtable
httpport = 8084
#runmode = prod
runmode = dev
autorender = false
copyrequestbody = true
EnableDocs = true

#session过期时间,单位为小时,默认12小时。如需大屏自动刷新,建议配置较大配置时间
session_timeout = 24

#database
hostname = localhost
username = zbxtable
dbpsword = Zabbixtable@123!
database = zbxtable
port = 3306
dbprefix = zbxtable_

#zabbix web info
zabbix_server = https://xxxxxxxxxx
zabbix_user = xxxxxxxxxx
zabbix_pass = xxxxxxxxxx

#alarm send token
token = ec573cf7388da56916f75ba9bbe46a69

遇到一个新问题

之前因为各主机没有进行分组 ,所以在初始化的时候esxi和window主机全部添加进来了。(如图)
image
我现在对window和esxi进行重新分组并且进行初始化 但是esxi还是在window主机的这个组里面 我想问下如何去除?还是我遇到bug了
image

translate

could you create a file to do the translation?

TOP需求

能否支持TopCpu,Top内存,Top流量等相关功能

选择框没自适应导致无法看到具体信息

当前位置: 指标报表 指标导出这里,主机组,主机下拉框比较小,无法显示完整信息,当主机比较多的时候就需要一个一个点才知道是那个主机,另外建议增加导出功能导出的是一段时间内的最大 最小,平均,95 值

问题数显示不准确及页面参数刷新后失效

屏幕截图 2020-12-07 103529

右上角问题数与中间的”全部“”警告“”一般“数字不吻合,另外,设置刷新时间和每页条数,刷新浏览器界面后又回到了默认值。
本地部署和官网demo都存在这个问题

在图形管理界面,图形无法显示

用浏览器点开一台服务器查看图形时图片裂开无法显示。
查看日志会出现错误信息 Handler crashed with error can't find templatefile in the path:views/imagescontroller/getone.tpl

pack error

[root@bogon zbxtable]# ./control pack
cp: cannot stat ‘zbxtable’: No such file or directory

password

Can you tell me what if I forget my zbxtable password?
Thank U.

Responsible disclosure policy

Hello 👋

I run a security community that finds and fixes vulnerabilities in OSS. A researcher (@b4zinga) has found a potential issue, which I would be eager to share with you.

Could you add a SECURITY.md file with an e-mail address for me to send further details to? GitHub recommends a security policy to ensure issues are responsibly disclosed, and it would help direct researchers in the future.

Looking forward to hearing from you 👍

(cc @huntr-helper)

zabxtable2.1收不到告警查询

zabxtable2.1收不到告警查询,两边的token对了一下是一致的。我是按照配置步骤一步一步来的
image
zabbix提示:No message defined for media type.

zbxtable install error

[command.go:163] -32602 (Invalid parms.): Invalid parameter "/1": unexpected parameter "type".
在执行/zbxtable install时报此错误,可能是什么原因导致的?

脚本运行错误

2020/11/16 11:54:58.906 [I] [install.go:45] Zabbix Admin User: Admin
2020/11/16 11:54:58.906 [I] [install.go:46] Zabbix Admin Password: zabbix
2020/11/16 11:54:59.066 [I] [install.go:53] 登录zabbix平台成功!
2020/11/16 11:54:59.117 [I] [install.go:59] zabbix版本为: 5.2.0
2020/11/16 11:54:59.210 [I] [install.go:103] 创建告警媒介成功!
2020/11/16 11:54:59.294 [I] [install.go:116] 创建告警用户组成功!
2020/11/16 11:54:59.401 [E] [install.go:141] -32602 (Invalid params.): Invalid parameter "/1": unexpected parameter "type".

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.