User Tools

Site Tools


software:zabbix:client_install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:zabbix:client_install [2023/10/07 19:57] – created rodolicosoftware:zabbix:client_install [2023/12/13 01:41] (current) rodolico
Line 1: Line 1:
 ====== Zabbix Client Install ====== ====== Zabbix Client Install ======
  
-We generally use the LTS (Long Term Service) version of Zabbix, meaning while we are not always on the latest and greatest version, we are on stable system that requires only minor upgrades. As of this writing (2023-10-07), that version is 6.0 LTS.+Zabbix agent is in many Linux and Unix repositoriesbut they are generally fairly old. Additionally, I like to tie my systems to a particular version, generally Long Term Support (LTS). As of this article (2023), Zabbix 6.0 LTS is current. You don't have all the latest and greatest abilities, but you have a stable system which will give you consistent, reliable results.
  
-For many common platformsZabbix has a configuration tool that allows you to use their repository to install the most recent version of their agent (and server, if you want). You can view this at https://www.zabbix.com/download+As suchI tend to download and install from the Linux repositories maintained by Zabbix. Instructions and downloads are located at 
 +https://www.zabbix.com/download
  
-Choose your configuration in step 1then follow the instructions belowReally nice tool.+Precompiled agents for Windows/macOS/BSDetc... are under Zabbix Agents on that page. For Linux, I prefer taking the instructions from the Zabbix Packages tabThis will set up your system to add new repository, then install the Zabbix agent from that, where they can then be updated during normal operations.
  
-Once the software is installed, you need a basic configurationZabbix comes with a heavily commented sample configuration file (in Debian and derivatives, in /etc/zabbix/zabbix_agentd.conf), but all you really need for a basic configuration is the Server IP address and the hostname.+The installation process is fairly straight forward; install the software and edit the configThe zabbix agent configuration file that comes with the installation is very large, but that is mainly because they include most of the default values as comments. I generally rename this file for a reference, then create a new file with values which are necessary.
  
-Find and change them to the correct values +Actually, there is only one value that is required, and that is the IP address of the Zabbix Server which will be communicating with this machine: 
-<code> + 
-Server=127.0.0.+<code conf
-Hostname=Zabbix server+Server=ip.address.of.server
 </code> </code>
  
-NOTE: simply undefining the Hostname (setting it to blankor commenting outwill tell the Zabbix agent to generate it from the hostname of the machine itself.+A much better configuration would be to explicitly define the hostname, as this is the name which the server matches on. For example, if your config file has the line 
 +<code conf>Hostname=myserver.example.org</code> 
 +your Zabbix server will use //myserver.example.org// as the identifier for its entry (which is why you can change the display name). 
 + 
 +===== Linux ===== 
 + 
 +On Debian based machines, I also include the pid and log file locations, and an Include directive. The following config is the minimum I use on these. 
 +<code conf> 
 +PidFile=/run/zabbix/zabbix_agentd.pid 
 +LogFile=/var/log/zabbix/zabbix_agentd.log 
 +LogFileSize=0 
 +Server=ip.of.zabbix.server 
 +Hostname=Name of Host 
 +Include=/etc/zabbix/zabbix_agentd.d/*.conf 
 +</code> 
 + 
 +Following is a quick script that will generate a config file. It first saves the current config (if it is not already saved), then creates it. You define the Zabbix Server IP address in line 4. 
 +<code bash configZabbix> 
 +#! /usr/bin/env bash 
 + 
 +# you must change this to the IP of your current Zabbix server 
 +ZABBIXSERVER=ip.of.zabbix.server 
 + 
 +# if we have not already saved the agent confthen do so 
 +if [ ! -f /etc/zabbix/zabbix_agentd.conf.save ] ; then mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.save ; fi 
 +# write the new configuration 
 +# These first two lines are Debian specific 
 +echo 'PidFile=/run/zabbix/zabbix_agentd.pid' > /etc/zabbix/zabbix_agentd.conf 
 +echo 'LogFile=/var/log/zabbix/zabbix_agentd.log' >> /etc/zabbix/zabbix_agentd.conf 
 +echo 'LogFileSize=0' >> /etc/zabbix/zabbix_agentd.conf 
 +# allow traffic from ZABBIXSERVER 
 +echo 'Server=$ZABBIXSERVER' >> /etc/zabbix/zabbix_agentd.conf 
 +# grab our hostname and specifically use it 
 +echo Hostname=`hostname -f` >> /etc/zabbix/zabbix_agentd.conf 
 +# include anything in the includes directory 
 +echo 'Include=/etc/zabbix/zabbix_agentd.d/*.conf' >> /etc/zabbix/zabbix_agentd.conf 
 +# restart agent 
 +service zabbix-agent restart 
 +</code> 
 + 
 +Note: I have never used Active Checks (though they sound pretty cool), so I always set that IP to null (the default). 
 + 
 +===== Windows ===== 
 + 
 +For Windows machines, grab the zip file from https://www.zabbix.com/download (pre-compiled Binaries in the section //Zabbix Agents//). then follow the instructions at 
 +https://www.zabbix.com/documentation/6.0/en/manual/appendix/install/windows_agent. Following is a quick summary, assuming you downloaded the Archive package. 
 + 
 +  - Unzip the downloaded archive 
 +  - Create c:\zabbix 
 +    - Move the zabbix agent binary (zabbix_agentd.exe) and config file (zabbix_agentd.conf) into c:\zabbix 
 +    - Edit zabbix_agentd.conf, being sure to set hostname and servername 
 +  - Open an elevated command shell (cmd with Administrative privileges) and run the command <code>c:\zabbix\zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -i</code> 
 +  - Open service manager and start the Zabbix Agent 
 +  - Open your firewall and allow port 10050 through from the Zabbix Server 
 + 
 +NOTE: There is a cool script at https://github.com/vetasen/ZabbixWinAgentDeploy that supposedly can be run on any Windows machine (powershell) that will automagically set up the Zabbix agent on that machine. Haven't tested it yet, but I intend to do so Real Soon Now. 
  
-Restart the daemon. Assuming you have discovery turned on, just wait about an hour and it should show up on your server. 
software/zabbix/client_install.1696726659.txt.gz · Last modified: 2023/10/07 19:57 by rodolico