zabbix服务端接收的数据类型,便于编写脚本向服务端提交数据
1.数据类型1:zabbix_agent执行脚本提交字典
UserParameter=tcp_port_listen,/usr/local/zabbix/share/script/get_game_port.py
{ "data": [ { "{#GG_PORT}": 3001, "{#GT_PORT}": 2001, "{#GT_WEB_PORT}": 8001, "{#SERVER_ID}": 1, "{#SERVER_NAME}": "dddjs_test_s001a" }, { "{#GAME_ANALYS_NGINX_HTTPS_PORT}": 8081, "{#GAME_ANALYS_PORT}": 9001, "{#GAME_SERVICE_NGINX_HTTPS_PORT}": 8082, "{#GAME_SERVICE_PORT}": 9002, "{#GM_SERVER_PORT}": 56789, "{#LOGIN_SERVER_PORT}": 3101 } ] }
zabbix界面创建模板时使用方式:直接使用它的key即可
中央服GAME_ANALYS_NGINX_HTTPS_PORT进程端口:{#GAME_ANALYS_NGINX_HTTPS_PORT} net.tcp.listen[{#GAME_ANALYS_NGINX_HTTPS_PORT}]
2.数据类型2:zabbix_agent执行脚本提交数值
UserParameter=mysql.status[*],/usr/local/zabbix/share/script/mysql_check.sh $1
mysql_master_port
mysql.status[mysql_master_port]
3.常用命名
监控项命名: 游戏目录:{#SERVER_NAME},server_id:{#SERVER_ID},DBS_PORT进程,端口:{#DBS_PORT} 游戏目录:{#SERVER_NAME},server_id:{#SERVER_ID},GG进程,CPU使用率 游戏目录:{#SERVER_NAME},server_id:{#SERVER_ID},GG进程,进程内存占用 监控key: 监控端口:net.tcp.listen[{#DBS_PORT}] 监控cpu:proc.cpu.util[node,,,--server_name=gg --server_dir={#SERVER_NAME}] 监控内存:proc.mem[node,,,--server_name=gg --server_dir={#SERVER_NAME},rss] 触发器命名:游戏目录:{#SERVER_NAME},server_id:{#SERVER_ID},GG进程,CPU使用率 图形原型命名:游戏目录:{#SERVER_NAME},server_id:{#SERVER_ID},游戏状态
一些事情一直在干,说不定以后就结果了呢
本文来自博客园,作者:chenjianwen,转载请注明原文链接:https://www.cnblogs.com/chenjw-note/p/11978322.html