SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

Trying out ZABBIX Part 4.5

Good evening, this is Cardy.
I might use ZABBIX at work, so I decided to try it out personally and write a blog about ZABBIX for a while.
It is planned to be an 8-part series.

STEP 1 Installing ZABBIX AGENT
STEP 2 Configuring ZABBIX AGENT
STEP 3 Setting up ZABBIX Server with Docker
STEP 4 Server configuration
STEP 4.5 Handling DHCP environments ← This article is here
STEP 5 Monitoring the moment monitoring begins
STEP 6 Defining triggers
STEP 7 Alert settings & notifications
STEP 8 Summary?


It's no good if the IP address changes.

Are there many DHCP environments in companies? When I was in IT systems, I basically used fixed IPs, but I've heard that DHCP is the standard in Windows environments.
At home, it's a DHCP environment! After all, I take my laptop out, so I can't manage without a DHCP environment when I do that.

Now, in the previous four "Trying out ZABBIX" posts, I specified an IP address in all of them.
Of course, I think specifying an IP address is less prone to errors to ensure it works, but in a DHCP environment like at home, the IP address might change every time I turn on the PC, which could make communication impossible.

Therefore, I would like to change the specification method from IP address to host name here.

Agent configuration file

👇 Refer here for how to configure the agent environment

In the article above, the Server value is specified by an IP address as shown below.

Server=127.0.0.1

I will change this to a host name.
This setting allows inquiries only from the specified IP when the server queries the agent. Although I wrote IP, it seems that a host name is also acceptable here.

Therefore, in my environment, it will be as follows.

Server=TOTTENHAM

With this, it is now set to allow inquiries only from the server name "TOTTENHAM". I think it internally performs a reverse lookup of the name and replaces it with an IP address.

By the way, you cannot save changes to the configuration file because the agent has it locked. You need to stop the service once.
Also, even if the service is stopped, it is saved in Program Files (I think!), so you cannot edit it with a normally launched Notepad. I couldn't change it unless I launched it in administrator mode.

Right-click the Notepad icon -> Run as administrator

Zabbix server configuration change

The previous specification was for the agent to specify the server.
This is the setting for when the server finds the agent.

Please refer to 👇 for Zabbix server settings.

Log in to the WebUI and proceed to Data Collection -> Hosts.
Click on the terminal where the agent is installed to open the settings screen.

In the explanation in Part 4, only the IP address was specified when setting the Interface. I will add a DNS name here. Here, I will add "TOTTENHAM.local" and change Connect to to "DNS".
The reason I am using TOTTENHAM.local is because it is a Windows terminal. In Windows 10/11, there are multiple settings for name resolution.

  1. hosts file

  2. DNS Cache

  3. mDNS

  4. LLMNR

  5. NetBIOS

Writing to the hosts file is reliable, but since it's a DHCP environment and I would have to write it on every terminal, management is a hassle, so I rejected it.
DNS cache is just a cache, so it's not something I can manage here, so I rejected it.
mDNS is a feature that comes standard in Windows 10/11 environments, and it automatically performs local name resolution by using hostname.local. It seems it can resolve even without .local, but since adding .local seems to put less burden on the network, I am adding .local.

Check operation on the Dashboard

Like this, if you are retrieving agent information, it means the Zabbix server and the agent are able to communicate.

Up to this point, it is in a "done" state

✅ Was able to change to a DHCP environment.
✅ Was able to change the configuration file settings.
✅ Was able to change agent settings from the WebUI

That's it for this article.
Next time, it will be STEP 5, "Monitoring the moment monitoring begins."

2026/1/11 Update

When I looked at the management console, it was showing an error like this.

It seems TOTTENHAM cannot resolve the DNS name (huh??).
With this setting, I confirmed that changing "Connect to" to the IP address allows it to connect correctly.

Hmm, so does that mean I have to set up DNS in a DHCP environment? I thought so, but apparently, I should use Active Agent settings.

Active Agent?

Currently, the setting is for the server to go and retrieve data from the agent. In that case, it would be fine to go look for the agent by IP address, but when I tried to look for it by hostname, name resolution was not possible (as described above).

By the way, PING returns an IPv6 IP, so I think it would be fine if it returned an IPv4 IP, but writing it in the HOSTS file or something is a hassle and I can't be bothered, so I rejected it.

So, next time I want to configure it to change the direction of data retrieval from the agent to the server!

いいなと思ったら応援しよう!

かーでぃ / KAMADA Makoto 「いいね」以上、「スポンサー」未満の気持ちで、 もしよければ応援してもらえると嬉しいです。 いただいたチップは、次の記事を書くためのコーヒーと時間に変わります☕