Git Product home page Git Product logo

zabbix_manager's Introduction

Zabbix_manager(server)

Supported versions

  • 版本高于 Zabbix 3.0

功能

Monitor

When we plan to monitor, we must first create a host group, and then import some template, and finally add some hosts, zabbix_manager is a better choice

Alarm

When we plan to use zabbix alarm .

  • first, we need to add the alarm mode.
  • the second, we need to create user groups and users.
  • the third, the user configuration of alarms.
  • fourth, create action

Report

Daily we need to export the report, use zabbix manager can export xls file using zabbix_manager will greatly save us time

Zabbix_api version

  • V1.4
    • v1.4.04,2017-11-27 [更新] 更新可用性报表计算方法 详细
    • v1.4.03,2017-10-20 [更新] 添加 dev_hosts_info 判断返回值个数
    • v1.4.02,2017-10-20 [修复] 修复 Zabbix 日常使用报表因添加数据单位导致排序无法正常运行问题
    • v1.4.01,2017-09-23 [更新] 更新 Zabbix_api_lib
  • V1.3Release 下载
    • v1.3.04,2017-09-22 [更新] 添加 dev_hosts_device 输出每台机器的指定挂载目录的使用信息
    • v1.3.03,2017-09-21 [更新] 添加 dev_hosts_info 输出常用监控项信息(可以自己定制), 优化部分程序
    • v1.3.02,2017-09-16 [更新] 更新程序调用时 issues 返回值
    • v1.3.01,2017-09-15 [更新] 增加 item_list方法,issues 方法输出添加item key信息
  • V1.2
    • v1.2.16,2017-09-13 [更新] host_get 输出项中,模板由之前获取的 host(Template name) 修改为 name(Visible name)
    • v1.2.15,2017-09-11 [更新] --hostid/--hostgroupid 参数可以通过直接输入主机名 / 主机组名进行获取主机列表,检查配置文件不存在时会使用本目录下etc下的配置文件
    • v1.2.13,2017-09-09 [更新] agent 自动注册功能修改参数,增加 hostmeta 参数
    • v1.2.12,2017-08-30 [更新] 报表 report_key 修改为使用 key 的正则表达式进行搜索
    • v1.2.11,2017-08-29 [更新] item_get 只输出已启用的监控项 [增加] 增加 report_key
    • v1.2.10,2017-08-26 [修复] 导出报表时设置 --table SingleTable 没有定义的错误
    • v1.2.9,2017-08-01 [更新] 增加 application_get 获取 application 列表功能 [增加] 增加 report_app
    • v1.2.8,2017-07-28 [更新] 增加 3 次重试机制
    • v1.2.7,2017-07-25 [更新] 导出报表时,只计算 item_type 为 0(浮点数) 或者 3(整数) 的数据,其他 item 返回"-1" (2) 执行命令时会输出 zabbix server 的版本号
    • v1.2.6,2017-07-21 [更新] 1 XLSWriter 使之可控制是否显示 logo (2) 可通过配置以适应 apache 搭建的 zabbix server
    • v1.2.4,2017-06-15 [增加] 输出日常使用报表时会在值后面加上单位 (K/M/G 也会自动进行换算)
    • v1.2.3,2017-04-04 [增加] -sign 参数(设置搜索分割符)
    • v1.2.1,2016-12-25 [增加] 对主机批量 link 、clear 模板操作
    • v1.2.0,2016-11-27 [修改] zabbix_api 调用方式(报表类函数不变)
  • V1.1
    • v1.1.7,2016-11-25 优化程序
    • v1.1.6,2016-11-08 Add 通过 profile 参数选择配置文件中不同的 section
    • v1.1.5,2016-10-24 Add report_available2 可以对特定 item 进行输出,除报表项外,其他函数统一输出函数
    • v1.1.4,2016-10-24 Add issues获取最近问题
    • v1.1.3,2016-09-09 Add report_available2, 可设置排序
    • v1.1.2,2016-09-05 Add zabbix_manager gui
    • v1.1.1,2016-08-22 Add mysql_quota
    • v1.1.0,2016-07-14 Release 1.1.0
  • V1.0
    • v1.0.8,2016-07-13 Add report
    • v1.0.6,2016-06-23 Add rule and discovery manage
    • v1.0.5,2016-06-19 Add mediatype manage
    • v1.0.4,2016-06-18 Add usergroup manage
    • v1.0.3,2016-06-11 Add history_report
    • v1.0.2,2016-06-03 Modify the command line in interactive mode
    • v1.0.1,2016-04-16 First edit

参加步骤

  • 在 GitHub 上 fork 到自己的仓库,然后 clone 到本地,并设置用户信息。
$ git clone https://github.com/BillWang139967/zabbix_manager.git
$ cd zabbix_manager
$ git config user.name "yourname"
$ git config user.email "your email"
  • 修改代码后提交,并推送到自己的仓库。
$ #do some change on the content
$ git commit -am "Fix issue #1: change helo to hello"
$ git push
  • 在 GitHub 网站上提交 pull request。
  • 定期使用项目仓库内容更新自己仓库内容。
$ git remote add upstream https://github.com/BillWang139967/zabbix_manager.git
$ git fetch upstream
$ git checkout master
$ git rebase upstream/master
$ git push -f origin master

相关链接

  • zabbix 安装 -------------------------------------------------zabbix_install
  • zabbix 报警工具 ---------------------------------------------zabbix_alert
  • zabbix 常用模板 ---------------------------------------------zabbix_templates
  • 导出报表工具 -----------------------------------------------XLSWriter
  • linux 终端表格 ----------------------------------------------linux_terminal
  • shell 菜单工具 ----------------------------------------------shell_menu

小额捐款

如果觉得 zabbix_manager 对您有帮助,可以请笔者喝杯咖啡

Screenshot

致谢

  1. 感谢南非蜘蛛的指导

zabbix_manager's People

Contributors

meetbill 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

zabbix_manager's Issues

zabbix5.2新版本失效否?

我现在在用zabbix5.2
在服务器也配置了zabbix_manager,测试也正常,也没有报错,但是输出任何条目比如CPU时,结果都是0.00

我看了下日志,都是提示not have trend_data,zabbix上都是有值的

这是新版本失效了吗?

ImportError: No module named w_lib.zabbix_api_lib

zabbix_api user_get --table
Traceback (most recent call last):
File "/bin/zabbix_api", line 16, in
from w_lib.zabbix_api_lib import ZabbixAPI
ImportError: No module named w_lib.zabbix_api_lib
一直都找不到这个模块,不知道什么原因?请教大神,求回复,谢谢,

导出可行性报表时所得数据与zabbix不符

使用如下命令导出
zabbix_api --report_available2 "2019-05-26 00:00:00" "2019-06-02 00:00:00" --table --item_key /root/item_list --hostgroupid "Gateway"
image
image
image
感谢大佬的程序,期待大佬的回复

关于zabbix_api 的ssl配置问题

zabbix_server="https://%s:%s"%(self.server,self.port)
修改完之后报错
w_lib.zabbix_api_lib.ZabbixAPIException: urllib2.URLError - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)

报错?centos7,python2.7

报错?centos7,python2.7
[root@localhost zabbix_manager]# zabbix_api hostgroup_get --table
zabbix_manager:[1.4.01]
Traceback (most recent call last):
File "/usr/bin/zabbix_api", line 2530, in
zabbix=zabbix_api(terminal_table,debug,output_sort=output_sort,sort_reverse=sort_reverse,profile = profile)
File "/usr/bin/zabbix_api", line 81, in init
self.zapi.login(self.user,self.password)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 209, in login
result = self.do_request(obj)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 265, in do_request
raise ZabbixAPIException("urllib2.URLError - %s" % e)
w_lib.zabbix_api_lib.ZabbixAPIException: urllib2.URLError - Not Found

根据key导出报表时报错了,zabbix版本是3.4,db用的是oracle。

zabbix_api --report_key "system.cpu.util[,idle]" "2018-11-07 01:00:00" "2018-11-07 02:00:00" --table --hostgroupid 45

zabbix_manager:[1.4.04]
:OC-NS

   Traceback (most recent call last):

File "/usr/bin/zabbix_api", line 2610, in
zabbix._report_key(args.report_key[0],args.report_key[1],args.report_key[2],export_xls,select_condition)
File "/usr/bin/zabbix_api", line 1050, in _report_key
itemid_all_list = self.__item_get2(host_info[0],item_key)
File "/usr/bin/zabbix_api", line 658, in __item_get2
"monitored":True,
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 333, in method
return self.universal("%s.%s" % (self.data["prefix"], name), opts[0])
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 81, in wrapper
return self.do_request(self.json_obj(method, opts))['result']
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 340, in do_request
return self.parent.do_request(req)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 257, in do_request
raise APITimeout("HTTP read timeout",)
w_lib.zabbix_api_lib.APITimeout: HTTP read timeout

PS:直接zabbix_api --report的不报错,但是获取的数据都是0.

url error

当Zabbix路径为 http://xxx.xxx.xxx.xxx/zabbix 出现下列错误:
如果我在Apache上修改地址改为 http://xxx.xxx.xxx.xxx,就可以正常获取到信息。

[root@Zabbix01 zabbix_manager]# zabbix_api host_get --table
zabbix_manager:[1.4.01]
Traceback (most recent call last):
File "/usr/bin/zabbix_api", line 2530, in
zabbix=zabbix_api(terminal_table,debug,output_sort=output_sort,sort_reverse=sort_reverse,profile = profile)
File "/usr/bin/zabbix_api", line 81, in init
self.zapi.login(self.user,self.password)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 209, in login
result = self.do_request(obj)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 260, in do_request
return self.do_request(json_obj,num_retries-1)
File "/opt/ZabbixTool/lib_zabbix/w_lib/zabbix_api_lib.py", line 265, in do_request
raise ZabbixAPIException("urllib2.URLError - %s" % e)
w_lib.zabbix_api_lib.ZabbixAPIException: urllib2.URLError - Not Found

python

请问使用的python版本是多少,我用的3.4.3执行main.sh报错File "./lib_zabbix/zabbix_api.py", line 37
print "\033[41;37m[Error]: %s \033[0m"%msg
^
SyntaxError: Missing parentheses in call to 'print'

how to config zabbix_manager

start.sh 安装完成以后, 在哪儿配置zabbix 服务器信息? 才可以用 zabbix_api 执行相关命令?

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.