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