Zabbix 模板
2022-08-03 09:57:03
243
{{single.collect_count}}

**## Zabbix 模板

1、官方的 share 分享网站

https://share.zabbix.com/zabbix-tools-and-utilities

  • 例如:我们要实现监控Nginx ,我们查找一个模板

在这里插入图片描述

  • 就以这个模板为例

在这里插入图片描述

2、在node1 上使用此模板

1、安装配置 nginx

[root@node1 ~]# yum -y install nginx[root@node1 ~]# vim /etc/nginx/nginx.conf# 按照网页的操作指示location /stub_status {stub_status on;access_log off;#allow 127.0.0.1; #为了操作方便,我取消的访问控制#deny all;}

在这里插入图片描述

2、启动服务
[root@node1 ~]# systemctl restart nginx

2、下载模板所依赖的脚本

在这里插入图片描述

[root@node1 ~]# mkdir -p /srv/zabbix/libexec/[root@node1 ~]# cd /srv/zabbix/libexec/[root@node1 ~]# wget https://raw.githubusercontent.com/oscm/zabbix/master/nginx/nginx.sh # 从网页上获取脚本[root@node1 ~]# chmod +x nginx.sh # 加执行权限

3、配置 agent 的用户参数 UserParameter

[root@node1 ~]# cd /etc/zabbix/zabbix_agentd.d/[root@node1 ~]# wget https://raw.githubusercontent.com/oscm/zabbix/master/nginx/userparameter_nginx.conf # 很短自己写也行

在这里插入图片描述

4、在 windows 上下载模板并导入server 的模板中

[root@node1 ~]# wget https://raw.githubusercontent.com/oscm/zabbix/master/nginx/zbx_export_templates.xml

可以现在linux上下载,再sz 导出到 windows 上

在这里插入图片描述

1、导入下载的模板

在这里插入图片描述

2、主机 node1 链接这个模板

在这里插入图片描述

3、模板生效

在这里插入图片描述

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}