# Truenas Monitoring with Zabbix

#### Enable SNMP on Truenas Host

- On your Truenas host navigate to **Services**.
- Locate the **SNMP** service and click the [![image-1655139228288.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655139228288.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655139228288.png) icon (**Figure 1**).

**Figure 1**

[![image-1655139299516.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655139299516.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655139299516.png)

- Take note of the **Community** value which by default should be set to **public** (**Figure 2**) and click the CANCEL button to go back to **Services**.

**Figure 2**

[![image-1655139392612.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655139392612.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655139392612.png)

- Back in the **Services** page, on the **SNMP** service, ensure the **Start Automatically** is checked and slide the **Running** slider to the right so that it turns blue to indicate the service is running (**Figure 3**).

**Figure 3**

[![image-1655139531183.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655139531183.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655139531183.png)

#### Download the the FREENAS-MIB Definitions File from your Truenas Host

- On your Truenas host navigate to **Services**.
- Locate the **SSH** service and click the [![image-1655139228288.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655139228288.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655139228288.png) icon (**Figure 4**).

**Figure 4**

[![image-1655146333104.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655146333104.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655146333104.png)

- Place a checkmark on the Log in as **Root with Password** checkbox and click the **SAVE** button (**Figure 5**).

**Figure 5**

[![image-1655146431089.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655146431089.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655146431089.png)

- Back in the **Services** page, on the **SSH** service, ensure the **Start Automatically** is checked and slide the **Running** slider to the left to stop the SSH service and then slide back to the right so that it turns blue to indicate the service is running (this ensures the new SSH settings we set take effect (**Figure 6**).

**Figure 6**

[![image-1655146784737.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655146784737.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655146784737.png)

- Using [Winscp](https://winscp.net) or any tool of your choice, login to your Truenas host using the SCP protocol, navigate to **/usr/local/share/snmp/mibs/** and download **FREENAS-MIB.txt** to your computer.

#### Copy the the FREENAS-MIB Definitions File to your Zabbix Server

- Using [Winscp](https://winscp.net) or any tool of your choice, login to your Zabbix Server host using the SCP protocol and copy the **FREENAS-MIB.txt** file you downloaded from your Truenas host above to the **/var/lib/zabbix/mibs/** directory. If you have deployed Zabbix server on docker, the directory would be **/path-to-zabbix-docker/zbx\_env/var/lib/zabbix/mibs/**.
- Restart your Zabbix server.

#### Import the SNMP Freenas 11 Template into Zabbix Server

- Download the **[template\_freenas\_11\_snmp.xml](https://docs.deeztek.com/attachments/11)** template from this article or download it from the **[Zabbix Community Templates](https://github.com/zabbix/community-templates/tree/main/Storage_Devices/FreeNAS/template_freenas_11_snmp)** Github page.
- On your Zabbix server navigate to **Configuration ---&gt; Templates --&gt; Import.**
- On the **Import** page, click the **Choose File** button and navigate to the location of the downloaded **template\_freenas\_11\_snmp.xml** file and click **Open**.
- Back to the **Import** page, click the **Import** button (**Figure 7**).

**Figure 7**

[![image-1655145250022.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655145250022.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655145250022.png)

#### Add Truenas Host to Zabbix server

- On your Zabbix server navigate to **Configuration ---&gt; Host ---&gt; Create Host.**
- In the **Host name** field enter the name of your Truenas host
- Set the **Groups** field to a an existing group or create a new one.
- In the **Interfaces** section add the IP address of your Truenas host in the **Agent IP address** field
- Click the **Add** link and in the resultant menu select the **SNMP** option (**Figure 8**).

**Figure 8**

[![image-1655144525187.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655144525187.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655144525187.png)

- In the **SNMP** field enter the IP address of your Truenas host again.
- Ensure the **SNMP version** field is set to **SNMPv2.**
- In the **SNMP community** field enter the community value you got from the Truenas SNMP service above (Default: **public**) (**Figure 9**).

**Figure 9**

[![image-1655144810693.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655144810693.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655144810693.png)

- Click the **Templates** link on top of the screen, in the **Link new templates** section, search and select the **SNMP FreeNAS 11** template you imported earlier and then click the **Update** button (**Figure 10**).

**Figure 10**

[![image-1655147921858.png](https://docs.deeztek.com/uploads/images/gallery/2022-06/scaled-1680-/image-1655147921858.png)](https://docs.deeztek.com/uploads/images/gallery/2022-06/image-1655147921858.png)

- Navigate to **Monitoring --&gt; Hosts**, locate the Truenas host you just added and click the **Latest data** link and wait for data to start appearing. It may take a few minutes.