Zabbixをインストールしてみる・より続き

昨日/var/log/zabbix/zabbix-server.logを見たら(そして今日も出てる)

5059:20170629:172917.334 cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored

っていうエラーが出てたけど、/var/log/zabbix/zabbix_agentd.logも見てみたら、こんなログが出ていた。

1576:20170630:095029.298 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored

どこかでサーバのアドレスを設定しないといけないんだろうか。
/etc/zabbix/zabbix_agentd.confの中を覗いてみる。

84 ##### Passive checks related
85
86 ### Option: Server
87 # List of comma delimited IP addresses (or hostnames) of Zabbix servers.
88 # Incoming connections will be accepted only from the hosts listed here.
89 # If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
90 #
91 # Mandatory: no
92 # Default:
93 # Server=
94
95 Server=127.0.0.1
<中略>
122 ##### Active checks related
123
124 ### Option: ServerActive
125 # List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.
126 # If port is not specified, default port is used.
127 # IPv6 addresses must be enclosed in square brackets if port for that host is specified.
128 # If port is not specified, square brackets for IPv6 addresses are optional.
129 # If this parameter is not specified, active checks are disabled.
130 # Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
131 #
132 # Mandatory: no
133 # Default:
134 # ServerActive=
135
136 ServerActive=127.0.0.1
137
138 ### Option: Hostname
139 # Unique, case sensitive hostname.
140 # Required for active checks and must match hostname as configured on the server.
141 # Value is acquired from HostnameItem if undefined.
142 #
143 # Mandatory: no
144 # Default:
145 # Hostname=
146
147 Hostname=Zabbix server

この辺りか。Zabbix serverなんてホスト名はこれまでの過程で全く設定してないし。

# hostname
localhost.localdomain
# hostname -i
127.0.0.1 127.0.0.1

hostnameはlocalhostIPアドレス127.0.0.1に設定してるってことなのか(これも何か違う気がするけど)
試しにServer、ServerActive、Hostnameを書き換えてみたけど、やはりWebでアクセスするとタイムアウトする。
そんな時にこちらの情報を発見→http://d.hatena.ne.jp/t_num/20110101/1293906242

Apacheを起動して、権限を調整し
# vi /etc/apache2/conf/httpd.conf
で280行目DocumentRootを公開したいディレクトリに指定するだけ

というわけで、こっちの環境のhttpd.confをチェック。280行目ではなかったが。

288 # DocumentRoot: The directory out of which you will serve your
289 # documents. By default, all requests are taken from this directory, but
290 # symbolic links and aliases may be used to point to other locations.
291 #
292 DocumentRoot "/var/www/html"

/var/www/htmlの中身を見てみると、その中にさらにzabbixディレクトリが存在する。あれ?じゃあDocumentRootを公開したいディレクトリ=/var/www/html/zabbixにしなきゃいけないんじゃない?
というわけでhttpd.confを書き換え、プロセスを再起動し、再度アクセス。

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.15 (CentOS) Server at 192.168.0.131 Port 80

500エラーになった。今まではリクエスタイムアウトで接続できなかったのに。
そしてapacheのログを見ると、

[crit] [client 192.168.0.133] configuration error: couldn't perform authentication. AuthType not set!: /zabbix

このエラーは今回初めて見る。
ちなみに、httpd.confにはこういう行もあって、

315 # This should be changed to whatever you set DocumentRoot to.
316 #
317

ここもZabbixディレクトリに変えてみたんだけど変化はなかった。
タイムアウトで)サーバにアクセスできないという事象が、サーバにアクセスはできるが表示ができない、という事象に変わった感じだろうか。
来週も研修になったので続く。