经典再续!《循序渐进Linux(第2版)

爱维Linux

 找回密码
 加入爱维Linux

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: 活动 交友 discuz
查看: 11413|回复: 6

zabbix 自动添加端口 客户端报错,求大神们解决。

[复制链接]

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
发表于 2016-3-31 14:47:30 | 显示全部楼层 |阅读模式
2263:20160331:135409.789 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:135439.831 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:135509.863 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:135539.885 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:135609.906 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:135639.896 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:135709.900 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:135738.924 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:135808.882 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:135838.930 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:135908.986 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:135939.022 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140009.052 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140039.064 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140109.088 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140139.129 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140209.179 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140239.230 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140309.232 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140339.249 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140409.282 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140439.303 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140509.306 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140539.357 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140609.405 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140639.401 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140709.389 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140739.412 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:140809.451 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:140839.464 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140909.468 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:140939.492 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141009.541 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141039.569 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141109.608 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141139.655 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141209.037 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141239.053 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:141309.070 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141339.167 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141409.212 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141439.229 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:141509.280 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141539.268 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:141609.256 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141639.271 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141709.290 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141739.347 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2264:20160331:141809.449 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2262:20160331:141839.447 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:141909.463 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
  2263:20160331:141939.451 failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "192.168.10.166"
每30秒 报一次错。正好和自动 发现添加端口的数据更新时间一致。

搜索规则配置 如下









zabbix 客户端 配置文件如下

LogFile=/tmp/zabbix_agentd.log
Server=192.168.10.166
ServerActive=192.168.10.166
Hostname=192.168.10.167
UnsafeUserParameters=1
UserParameter=tcpportlisten,/usr/local/zabbix/etc/discovertcpport.sh "$1"





discovertcpport.sh 脚本的文件为

#!/bin/bash
portarray=(`netstat -tnlp|egrep -i "$1"|awk {'print $4'}|awk -F':' '{if ($NF~/^[0-9]*$/) print $NF}'|sort|uniq`)
namearray=(`netstat -tnlp|egrep -i "$1"|awk {'print $7'}|awk -F'/' '{if ($NF != "Address") print $NF}'|uniq`)

length=${#portarray[@]}
printf "{\n"
printf  '\t'"\"data\":["

for ((i=0;i<$length;i++))
  do
     printf '\n\t\t{'
     printf "\"{#TCP_PORT}\":\"${portarray[$i]}\"}"
    #printf "\"{#TCP_NAME}\":\"${namearray[$i]}\"}"
     if [ $i -lt $[$length-1] ];then
                printf ','
     fi
  done
printf  "\n\t]\n"
printf "}\n"




如把这个自动加端口的。自动规则去除,错误日志也就没有了。 现在断定是这个自动规则引起的,但一直查不到原因所以下这里请教大神们。大家有谁知道问题的请回贴 ,谢谢。



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?加入爱维Linux

x
回复

使用道具 举报

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
 楼主| 发表于 2016-3-31 14:49:27 | 显示全部楼层
host.allow  我也加过。ip 127.0.0.1或all:all  都不成功。。一直在报错。。。
回复 支持 反对

使用道具 举报

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
 楼主| 发表于 2016-3-31 15:14:26 | 显示全部楼层
tomcat 也会报错



Mar 30, 2016 2:06:48 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
Mar 30, 2016 2:07:18 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
Mar 30, 2016 2:07:48 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
Mar 30, 2016 2:08:18 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
Mar 30, 2016 2:08:48 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
回复 支持 反对

使用道具 举报

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
 楼主| 发表于 2016-3-31 15:15:06 | 显示全部楼层
回复 支持 反对

使用道具 举报

167

主题

236

帖子

1

精华

爱维版主

Rank: 7Rank: 7Rank: 7

积分
996
发表于 2016-3-31 17:05:20 | 显示全部楼层
回复 支持 反对

使用道具 举报

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
 楼主| 发表于 2016-3-31 17:13:00 | 显示全部楼层
我自已找到了解决方法。把客户端加了一个

ListenPort=10050
ListenIP=192.168.10.167

这样是不会报错了。但是 tomcat 的报错 还是会有。

回复 支持 反对

使用道具 举报

1

主题

6

帖子

0

精华

爱维小学生

Rank: 1

积分
21
 楼主| 发表于 2016-3-31 17:50:25 | 显示全部楼层
不知什么原因。tomcat 还是会 30S报一次  我现在发现  一个问题了。用netstat -antp
有很多的这样的连接。
[root@iZ23fwlcggwZ logs]# netstat -antp |grep 127.0.0.1
tcp        0      0 127.0.0.1:9108              0.0.0.0:*                   LISTEN      9875/java           
tcp        0      0 127.0.0.1:40055             0.0.0.0:*                   LISTEN      13085/java         
tcp        0      0 127.0.0.1:40056             0.0.0.0:*                   LISTEN      13654/java         
tcp        0      0 127.0.0.1:15770             0.0.0.0:*                   LISTEN      13547/aegis_quartz  
tcp        0      0 127.0.0.1:53830             127.0.0.1:40055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46045             127.0.0.1:9108              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:52844             127.0.0.1:9008              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46695             127.0.0.1:40897             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:45591             127.0.0.1:41055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:38041             127.0.0.1:9208              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:37987             127.0.0.1:9208              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:40710             127.0.0.1:42055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:48680             127.0.0.1:18883             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:53885             127.0.0.1:40055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:40769             127.0.0.1:42055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46099             127.0.0.1:9108              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:50511             127.0.0.1:30897             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:48959             127.0.0.1:18888             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:45648             127.0.0.1:41055             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:50567             127.0.0.1:30897             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:38422             127.0.0.1:88                TIME_WAIT   -                  
tcp        0      0 127.0.0.1:58996             127.0.0.1:80                TIME_WAIT   -                  
tcp        0      0 127.0.0.1:49436             127.0.0.1:41056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:38227             127.0.0.1:9009              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46640             127.0.0.1:40897             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46240             127.0.0.1:42056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:48936             127.0.0.1:40056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:45393             127.0.0.1:15770             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:49495             127.0.0.1:41056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:48902             127.0.0.1:18888             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:48991             127.0.0.1:40056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:38481             127.0.0.1:88                TIME_WAIT   -                  
tcp        0      0 127.0.0.1:38170             127.0.0.1:9009              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:52786             127.0.0.1:9008              TIME_WAIT   -                  
tcp        0      0 127.0.0.1:46299             127.0.0.1:42056             TIME_WAIT   -                  
tcp        0      0 127.0.0.1:58937             127.0.0.1:80                TIME_WAIT   -   



正好和我的DUBBO 日志的信息里的。一致  。。。。。

[DUBBO] disconected from /127.0.0.1:47006,url:dubbo://10.162.54.124:30897/com.sendinfo.weiBiz.facade.WeiOrderRefundFacade?anyh
ost=true&application=weixin&channel.readonly.sent=true&codec=dubbo&default.group=weixin&default.version=1.0&dubbo=2.5.3&executes=1000&heartbeat=60000&interface=com.sendinfo.weiBiz.facade.WeiOrderRefundFacade&methods=doOrderOrderRefund,doGoodsOrderRefund&monitor=dubbo%3A%2F%2F10.160.12.184%3A2181%2Fcom.alibaba.dubbo.registry.RegistryService%3Fapplication%3Dweixin%26backup%3D10.160.12.184%3A2182%2C10.160.12.184%3A2183%26dubbo%3D2.5.3%26file%3D%2Fusr%2Fhome%2Ftomcat-weixin%2Fbin%2Fdubbo-registry.cache%26organization%3Dzhiyoubao%26owner%3Dlexianjie%26pid%3D13085%26protocol%3Dregistry%26refer%3Ddubbo%253D2.5.3%2526interface%253Dcom.alibaba.dubbo.monitor.MonitorService%2526pid%253D13085%2526timestamp%253D1458717407161%26registry%3Dzookeeper%26timestamp%3D1458717407147&organization=zhiyoubao&owner=lexianjie&pid=13085&revision=2.0&side=provider&timestamp=1458717407147, dubbo version: 2.5.3, current host: 10.162.54.124

     
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入爱维Linux

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|Archiver|手机版|小黑屋|爱维教育 ( 14004819

GMT+8, 2019-9-18 05:10 , Processed in 0.061177 second(s), 31 queries .

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表