今天增加监控的机器,遇到了各种各样的错误的,但多数都是基本问题

windows基本原因:防火墙

linux基本原因:防火墙与Selinux

错误代码:

windows错误代码:

Get value from agent failed: cannot connect to [[192.168.6.8]:10050]: [4] Interrupted system call

[root@localhost ~]# zabbix_get -s 192.168.6.8 -p 10050 -k system.uname
zabbix_get [10567]: Timeout while executing operation

解决方法关闭防火墙,问题解决

linux错误代码:

1.[113] No route to host   #防火墙原因

解决方法:

1.直接关闭iptables服务

2.配置iptables,开启10050端口 x.x.x.x:zabbix的IP地址

vi /etc/sysconfig/iptables #编辑防火墙配置文件

-A INPUT -s x.x.x.x -m state --state NEW -m tcp -p tcp --dport 10050:10051 -j ACCEPT

-A INPUT -s x.x.x.x -m state --state NEW -m udp -p udp --dport 10050:10051 -j ACCEPT

2.zabbix_get -s 127.0.0.1 -p 10050 -k system.uname 无数据   #Selinux原因

我直接关闭了Selinux.等有时间详细研究一下selinux配置

永久关闭方法:

vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing

#修改为disabled

SELINUX=disabled  

# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

需重启机器

临时关闭方法:

[root@localhost selinux]# setenforce
usage:  setenforce [ Enforcing | Permissive | 1 | 0 ] #0关闭 1开启
[root@localhost selinux]#

验证:

[root@localhost selinux]# getenforce
Disabled