# Configure Zabbix Docker

### Configure Zabbix Server to point to zabbix-agent container

- Navigate to **Monitoring --&gt; Hosts --&gt;Zabbix Server --&gt; Configuration** (**Figure 1**)

**Figure 1**

<div data-src="/core/preview?fileId=391528&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=391528" data-v-2ac49a8a="" id="bkmrk-"><div data-v-2ac49a8a="">[![607-370-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/607-370-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/607-370-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Clear **127.0.0.1** from IP address field
- Enter **zabbix-agent** in the **DNS name** field
- Set **Connect to** field to **DNS**
- Click the **Update** button (**Figure 2**)

**Figure 2**

<div data-src="/core/preview?fileId=391576&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=391576" data-v-2ac49a8a="" id="bkmrk--0"><div data-v-2ac49a8a="">[![961-558-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/961-558-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/961-558-max.png)  
<div data-v-2ac49a8a=""></div></div></div>### Configure Zabbix Server Timezone

Edit /opt/zabbix-docker/.env\_web uncomment the following line:

```
#PHP_TZ=Europe/Riga


```

Navigate to [http://php.net/manual/en/timezones.php](http://php.net/manual/en/timezones.php "http://php.net/manual/en/timezones.php") locate your local timezone and set PHP\_TZ to it, for example for American Eastern you would set it to the following:

```
PHP_TZ=America/New_York


```

### Configure Zabbix Server Server Name

Edit /opt/zabbix-docker/.env\_web and set the following line:

```
ZBX_SERVER_NAME=Composed installation


```

to a server name that you like (Example: ZBX\_\*SERVER\_\*NAME=Widgets, Inc)

### Configure Zabbix Auto Discover

- Navigate to **Configuration --&gt; Actions --&gt;Actions Drop-down --&gt; Discovery actions** (**Figure 3**)

**Figure 3**

<div data-src="/core/preview?fileId=392306&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=392306" data-v-2ac49a8a="" id="bkmrk--1"><div data-v-2ac49a8a="">[![405-160-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/405-160-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/405-160-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Select **Auto discovery. Linux servers** and click **Enable** (**Figure 4**) to enable Linux hosts auto discovery

**Figure 4**

<div data-src="/core/preview?fileId=392326&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=392326" data-v-2ac49a8a="" id="bkmrk--2"><div data-v-2ac49a8a="">[![548-364-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/548-364-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/548-364-max.png)  
<div data-v-2ac49a8a=""></div></div></div>### Enable Zabbix Notifications

- Navigate to **Configuration --&gt; Actions --&gt;Actions Drop-down --&gt; Trigger actions** (**Figure 5**)

**Figure 5**

<div data-src="/core/preview?fileId=392400&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=392400" data-v-2ac49a8a="" id="bkmrk--3"><div data-v-2ac49a8a="">[![447-175-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/447-175-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/447-175-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Ensure you have already configured notifications under **Administration --&gt; Media types**.
- Click the **Disabled** link under the **Status** column in the R**eport problems to Zabbix administrators** item in order to change the status to **Enabled** (**Figure 6**).

**Figure 6**

<div data-src="/core/preview?fileId=392439&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=392439" data-v-2ac49a8a="" id="bkmrk--4"><div data-v-2ac49a8a="">[![1024-230.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-230.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-230.png)  
<div data-v-2ac49a8a=""></div></div></div>### Enable Zabbix FreeNAS Monitoring

- On FreeNAS server enable **SNMP** by going to **Services --&gt; SNMP** and set it to **Running** and **Start Automatically** and enable **SSH** by going to **Services --&gt; SSH** and set it to **Running** and **Start Automatically** (**Figure 7**).

**Figure 7**

<div data-src="/core/preview?fileId=393000&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393000" data-v-2ac49a8a="" id="bkmrk--5"><div data-v-2ac49a8a="">[![1024-532.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-532.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-532.png)  
<div data-v-2ac49a8a=""></div></div></div>- On FreeNAS server, under **Services**, click on **SSH --&gt; Actions** and ensure **Log in as root with password** and **Allow password authentication** checkboxes are checked and click the **Save** button (**Figure 8**).

**Figure 8**

<div data-src="/core/preview?fileId=393028&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393028" data-v-2ac49a8a="" id="bkmrk--6"><div data-v-2ac49a8a="">[![598-365-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/598-365-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/598-365-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- On FreeNAS server, under **Services**, click on **SNMP --&gt; Actions** and note the **Community** string (default is **public**) or change as required and optionally set the **Log Level** to **Info** if you wish to get more information out of FreeNAS and click the **Save** button (**Figure 9**).

**Figure 9**

<div data-src="/core/preview?fileId=393050&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393050" data-v-2ac49a8a="" id="bkmrk--7"><div data-v-2ac49a8a="">[![680-527-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/680-527-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/680-527-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Using WinSCP or scp download the following file from the FreeNAS server:

```
/usr/local/share/snmp/mibs/FREENAS-MIB.txt


```

- Upload the **FREENAS-MIB.txt** file to the Zabbix Docker server in the following directory:

```
/opt/zabbix-docker/zbx_env/var/lib/zabbix/mibs


```

- Restart the Zabbix docker stack:

```
cd /opt/zabbix-docker && docker-compose down
cd /opt/zabbix-docker && docker-compose up -d


```

- On the Zabbix server navigate to **Administration --&gt; General --&gt; GUI drop-down --&gt; Macros** (**Figure 10**)

**Figure 10**

<div data-src="/core/preview?fileId=393104&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393104" data-v-2ac49a8a="" id="bkmrk--8"><div data-v-2ac49a8a="">[![636-384-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/636-384-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/636-384-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Ensure the **Value** field of the **{$SNMP\_COMMUNITY}** Macro is set to **public** or whatever value you set the FreeNAS Community string from above and click the **Update** button (**Figure 11**).

**Figure 11**

<div data-src="/core/preview?fileId=393124&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393124" data-v-2ac49a8a="" id="bkmrk--9"><div data-v-2ac49a8a="">[![1024-190.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-190.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-190.png)  
<div data-v-2ac49a8a=""></div></div></div>- Using a web browser download the following templates from Zabbix Share:

###### SNMP Intefaces discovery

[https://share.zabbix.com/official-templates/snmp-devices/snmp-interfaces-discovery](https://share.zabbix.com/official-templates/snmp-devices/snmp-interfaces-discovery "https://share.zabbix.com/official-templates/snmp-devices/snmp-interfaces-discovery")

###### SNMP Interfaces discovery

[https://share.zabbix.com/official-templates/snmp-devices/snmp-processors-discovery](https://share.zabbix.com/official-templates/snmp-devices/snmp-processors-discovery "https://share.zabbix.com/official-templates/snmp-devices/snmp-processors-discovery")

###### SNMP Generic

[https://share.zabbix.com/official-templates/snmp-devices/snmp-generic](https://share.zabbix.com/official-templates/snmp-devices/snmp-generic "https://share.zabbix.com/official-templates/snmp-devices/snmp-generic")

###### FreeNAS 11 SNMP

[https://share.zabbix.com/storage-devices/freenas/freenas-11](https://share.zabbix.com/storage-devices/freenas/freenas-11 "https://share.zabbix.com/storage-devices/freenas/freenas-11")

- On the Zabbix server navigate to **Configuration --&gt; Templates --&gt; Import** and import each of the templates you downloaded above ensuring the **Rules** are set like below before each import (**Figure 12**):

**Figure 12**

<div data-src="/core/preview?fileId=393179&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393179" data-v-2ac49a8a="" id="bkmrk--10"><div data-v-2ac49a8a="">[![736-582-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/736-582-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/736-582-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- On the Zabbix server navigate to **Configuration --&gt; Hosts --&gt; Create Host**
- In the **Host** tab, fill out the **Host name**, **groups** and **interfaces** where 1**92.168.xxx.xxx** is the IP of your FreeNAS host (**Figure 13**)

**Figure 13**

<div data-src="/core/preview?fileId=393215&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393215" data-v-2ac49a8a="" id="bkmrk--11"><div data-v-2ac49a8a="">[![982-698-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/982-698-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/982-698-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- In the **Templates** tab, ensure you link the **Template Module ICMP Ping** and the **Template SNMP FREENAS 11** templates and click the **Update** button (**Figure 14**)

**Figure 14**

<div data-src="/core/preview?fileId=393237&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393237" data-v-2ac49a8a="" id="bkmrk--12"><div data-v-2ac49a8a="">[![773-325-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/773-325-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/773-325-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Wait 10-15 minutes before Zabbix starts pulling data from the FreeNAS server. If successful, **Monitoring --&gt; Hosts** should show the FreeNAS server listed with **SNMP** turned green (**Figure 15**)

**Figure 15**

<div data-src="/core/preview?fileId=393259&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393259" data-v-2ac49a8a="" id="bkmrk--13"><div data-v-2ac49a8a="">[![1024-28.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-28.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-28.png)  
<div data-v-2ac49a8a=""></div></div></div>### Enable Zabbix VMware Monitoring

Original Guide URL:

[https://bestmonitoringtools.com/vmware-monitoring-with-zabbix-esxi-vcenter-vm-vsphere/](https://bestmonitoringtools.com/vmware-monitoring-with-zabbix-esxi-vcenter-vm-vsphere/ "https://bestmonitoringtools.com/vmware-monitoring-with-zabbix-esxi-vcenter-vm-vsphere/")

- Enable (Remove the # from front of each line) on the following entries in **/opt/zabbix-docker/.env\_srv** and save the file:

```
ZBX_STARTVMWARECOLLECTORS=3
ZBX_VMWAREFREQUENCY=60
ZBX_VMWAREPERFFREQUENCY=60
ZBX_VMWARECACHESIZE=128M
ZBX_VMWARETIMEOUT=120


```

Restart the Zabbix docker stack:

```
cd /opt/zabbix-docker && docker-compose down
cd /opt/zabbix-docker && docker-compose up -d


```

- Navigate to **Configuration --&gt; Hosts --&gt; Create Host**
- In the **Host** tab, fill out the **Host name** of your Vcenter/VMware server, and select **groups**. Do not fill out the IP address field, leave it to default **127.0.0.1** (**Figure 16**)

**Figure 16**

<div data-src="/core/preview?fileId=393379&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393379" data-v-2ac49a8a="" id="bkmrk--14"><div data-v-2ac49a8a="">[![981-543-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/981-543-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/981-543-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Click the **Templates** tab and select **Template VM VMware** and **Template Module ICMP Ping** templates (**Figure 17**)

**Figure 17**

<div data-src="/core/preview?fileId=393394&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393394" data-v-2ac49a8a="" id="bkmrk--15"><div data-v-2ac49a8a="">[![782-265-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/782-265-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/782-265-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- Click the **Macros** tab and then click **Inherited and host macro**s button.
- Click the **Change** link next to each of the following fields and fill out the value of each field with the Password, URL (https://vcenter/sdk) and Username of your Vcenter/VMware server and click the **Add** button (**Figure 18**):

```
{$VMWARE.PASSWORD}
{$VMWARE.URL}
{$VMWARE.USERNAME}


```

**Figure 18**

<div data-src="/core/preview?fileId=393403&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=393403" data-v-2ac49a8a="" id="bkmrk--16"><div data-v-2ac49a8a="">[![881-643-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/881-643-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/881-643-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- VMware/Vcenter discovery can take hours to complete.
- Navigate to **Configuration --&gt; Templates.** In the **Name** field enter **Template Vm Vmware** and click the **Apply** button to locate the **Template Vm Vmware** template (**Figure 19**):

**Figure 19**

<div data-src="/core/preview?fileId=397860&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397860" data-v-2ac49a8a="" id="bkmrk--17"><div data-v-2ac49a8a="">[![1024-472.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-472.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-472.png)  
<div data-v-2ac49a8a=""></div></div></div>- On the **Template Vm Vmware** entry click on the **Discovery** link (**Figure 20**):

**Figure 20**

<div data-src="/core/preview?fileId=397878&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397878" data-v-2ac49a8a="" id="bkmrk--18"><div data-v-2ac49a8a="">[![963-84-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/963-84-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/963-84-max.png)  
<div data-v-2ac49a8a=""></div></div></div>- On the **Discovery rules** screen, click on the **Enabled** link on the **Discover Vmware VMs** entry to change the status to **Disabled** (**Figure 21**):

**Figure 21**

<div data-src="/core/preview?fileId=397900&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397900" data-v-2ac49a8a="" id="bkmrk--19"><div data-v-2ac49a8a="">[![1024-435.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-435.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-435.png)  
<div data-v-2ac49a8a=""></div></div></div>- Next, click on the **Trigger prototypes** on the **Discover VMware datastores** entry (**Figure 22**):

**Figure 22**

<div data-src="/core/preview?fileId=397928&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397928" data-v-2ac49a8a="" id="bkmrk--20"><div data-v-2ac49a8a="">[![1024-504.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-504.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-504.png)  
<div data-v-2ac49a8a=""></div></div></div>- On the **Trigger prototypes** screen, click the **Create trigger prototype** button (**Figure 23**):

**Figure 23**

<div data-src="/core/preview?fileId=397945&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397945" data-v-2ac49a8a="" id="bkmrk--21"><div data-v-2ac49a8a="">[![1024-191.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/1024-191.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/1024-191.png)  
<div data-v-2ac49a8a=""></div></div></div>- On the **Trigger prototype** screen, in the **Name** field enter the following:

```
Free space is less than 5% on datastore "{#DATASTORE}"


```

- In the **Severity** field set it to **High**
- In the **Expression** field enter the following:

```
{Template VM VMware:vmware.datastore.size[{$VMWARE.URL},{#DATASTORE},pfree].max(15m)}<5


```

- Click the **Add** button (**Figure 24**):

**Figure 24**

<div data-src="/core/preview?fileId=397980&x=1024&y=1024&a=true#mimetype=image%2Fpng&hasPreview=true&fileId=397980" data-v-2ac49a8a="" id="bkmrk--22"><div data-v-2ac49a8a="">[![783-690-max.png](https://docs.deeztek.com/uploads/images/gallery/2020-11/scaled-1680-/783-690-max.png)](https://docs.deeztek.com/uploads/images/gallery/2020-11/783-690-max.png)  
<div data-v-2ac49a8a=""></div></div></div>