参看的文章链接忘了。。。。。。

yum -y install iptstate

1、脚本位置和内容

[root@web1 scripts]# pwd
/etc/zabbix/scripts
[root@web1 scripts]# cat iptables.sh
#!/bin/bash
function tcp {
sudo iptstate --single | grep tcp | wc -l
}
function tcpsyn {
sudo iptstate --single | grep SYN | wc -l
}
function tcptimewait {
sudo iptstate --single | grep TIME_WAIT | wc -l
}
function tcpestablished {
sudo iptstate --single | grep ESTABLISHED | wc -l
}
function tcpclose {
sudo iptstate --single | grep CLOSE | wc -l
}
function udp {
sudo iptstate --single | grep udp | wc -l
}
function icmp {
sudo iptstate --single | grep icmp | wc -l
}
function all {
sudo iptstate --single | wc -l
}
# Run the requested function
$
[root@web1 scripts]#

2、visudo

zabbix  ALL=NOPASSWD: /usr/sbin/iptstate

3、修改zabbix-agent的配置文件

#iptables status
UserParameter=iptstate[*],/etc/zabbix/scripts/iptables.sh $

4、web页面配置

链接:https://pan.baidu.com/s/1Y2X8I3uqun41GD5KyIACHQ 密码:tar2

5、效果

最新文章

  1. ionic tab导航在android 真机测试中 导航在顶部解决办法
  2. JQuery 在循环中设置事件,最后一个覆盖了前面所有的设置
  3. 在代码中使用Autolayout – intrinsicContentSize和Content Hugging Priority
  4. 用xib自定义UITableViewCell
  5. 关于ASP.NET或VS2005 搭建三层架构的理解
  6. vim显示行数
  7. HTML5列表、块和布局
  8. php中的curl】php中curl的详细解说
  9. Java-基础编程(螺旋矩阵&乘法表)
  10. tangible T4 Editor 2.2.3 for VS2010 / VS2012 / VS2013 Preview
  11. Intro to Computer Science Class Online (CS101) - Udacity
  12. jquery 插件 validate 学习
  13. [置顶] Windows Phone后台音乐详解一
  14. 安装Linux_[CentOS]系统
  15. unity3D学习序幕
  16. windows安装程序无法将windows配置为在此计算机的硬件上运行
  17. Python函数篇(4)之迭代器与生成器
  18. 极速搞定1小时不出结果SQL的优化(SQL Tuning)
  19. mysql批量更新数据
  20. 15.selenium_case02

热门文章

  1. 生产环境部署node记录(一)
  2. 高云的jQuery源码分析笔记
  3. [转] PHP读取HTTP接口如何处理超时
  4. [android] 手机卫士自定义吐司
  5. 项目Debug版本与Release版本的区别
  6. CodeForces760B
  7. BZOJ4364: [IOI2014]wall砖墙(线段树)
  8. vue项目中引入bootstrap
  9. JS基础(二)
  10. 格式化字符串漏洞利用实战之 0ctf-easyprintf