Zabbixサーバとエージェントの通信が取れない
クライアントはCentOS5でファイアウォールもSELinuxも無効になっています。
にも関わらず以下のメッセージが出てZabbixサーバとクライアントの通信が取れておらず、Zabbixサーバのエージェントの状態はZマークが赤く点灯している状態です。
Get value from agent failed: cannot connect to [[192.168.1.11]:10050]: [111] Connection refused
Zabbixサーバからクライアントに向けてtelnetを行うと以下の通りです。
# telnet 192.168.1.11 10050
Trying 192.168.1.11...
telnet: connect to address 192.168.1.11: Connection refused
原因が分からず困っております。
よろしくお願い致します。
TNK - 投稿数: 4769
CentOS 5であるならば、iptablesとか動いていませんか?
iptablesを利用されているのであれば、Zabbixサーバからポート番号
10050で接続できるように許可を与えてください。
それでも接続できないようであれば、
・Zabbixエージェントが動いているか
・Zabbixサーバから接続できるIPとポート番号でLISTENしているか
もご確認ください。
KAZ - 投稿数: 1085
Ryo Sugisaki さん
Zabbixサーバから監視対象(192.168.1.11)にping通りますか?
Ryo Sugisaki - 投稿数: 139
>・Zabbixエージェントが動いているか
以下の通り、動いております。
# service zabbix-agent status
zabbix_agentd (pid 3189 3188 3187 3186 3185 3183) を実行中...
>・Zabbixサーバから接続できるIPとポート番号でLISTENしているか
これはzabbix_agent.confにListenの指定をしないといけないということでしょうか?
参考までに、/etc/zabbix/zabbix_agent.conf の内容を載せます。
----------------------------- ここから -----------------------------
# This is a config file for Zabbix internet service daemon agent
# To get more information about Zabbix visit http://www.zabbix.com
### Option: Server
# IP address of Zabbix server
# Connections from other hosts will be denied
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: yes
# Default:
# Server=
Server=192.168.1.197(サーバIP)
Hostname=hogehoge(クライアントPC名)
############ ADVANCED PARAMETERS #################
### Option: Alias
#
# Mandatory: no
# Range:
# Default:
### Option: Timeout
# Spend no more than Timeout seconds on processing
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3
# This is a config file for Zabbix internet service daemon agent
# To get more information about Zabbix visit http://www.zabbix.com
### Option: Server
# IP address of Zabbix server
# Connections from other hosts will be denied
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: yes
# Default:
# Server=
Server=192.168.1.197
Hostname=PHPMotion
############ ADVANCED PARAMETERS #################
### Option: Alias
#
# Mandatory: no
# Range:
# Default:
### Option: Timeout
# Spend no more than Timeout seconds on processing
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3
### Option: Include
# You may include individual files or all files in a directory in the configuration file.
#
# Mandatory: no
# Default:
# Include=
# Include=/etc/zabbix/zabbix_agentd.userparams.conf
# Include=/etc/zabbix/zabbix_agentd/
####### USER-DEFINED MONITORED PARAMETERS #######
### Option: UnsafeUserParameters
# Allow all characters to be passed in arguments to user-defined parameters.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Default:
# UnsafeUserParameters=0
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=,
# Note that shell command must not return empty string or EOL only.
# Example: UserParameter=system.test,who|wc -l
#UserParameter=system.test,who|wc -l
### Set of parameters for monitoring MySQL server (v3.23.42 and later)
### Change -u and add -p if required
#UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
#UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
#UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
#UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
#UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
#UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
#UserParameter=mysql.version,mysql -V
----------------------------- ここまで -----------------------------
>Zabbixサーバから監視対象(192.168.1.11)にping通りますか?
pingは通ります。
# ping 192.168.1.11
PING 192.168.1.11 (192.168.1.11) 56(84) bytes of data.
64 bytes from 192.168.1.11: icmp_seq=1 ttl=64 time=0.391 ms
64 bytes from 192.168.1.11: icmp_seq=2 ttl=64 time=0.019 ms
64 bytes from 192.168.1.11: icmp_seq=3 ttl=64 time=0.179 ms
TNK - 投稿数: 4769
いいえ違います。
netstatコマンドを利用して、外部から接続できるIPアドレスを利用
してポート番号10050の状態がLISTENであればよいということです。
添付していただいたconfファイルは、重要な箇所が記載頂けていな
いのですが、zabbix_agentd.conf内のListenIPの設定をコメントア
ウトするか、外部からアクセスできるIPアドレスを指定してくださ
い。
恐らく今回の環境であれば、コメントアウトするか、
ListenIP=192.168.1.11
というような設定にすればよいでしょう。
パッケージを利用されているのであれば、Zabbixエージェントの設定
は、zabbix_agent.confではなくzabbix_agentd.confだと思われます
ので、こちらにもご注意ください。
あと、iptablesの確認はされましたか?
Ryo Sugisaki - 投稿数: 139
>パッケージを利用されているのであれば、Zabbixエージェントの設定は、zabbix_agent.confではなくzabbix_agentd.confだと思われますので、こちらにもご注意ください。
zabbix_agentd.conf に設定したところ、Zマークが緑になりました。
zabbix_agent.conf に記述していたのが原因でした。
ありがとうございました。