Last Updated on March 17, 2023 by Thiago Crepaldi
From previous posts, we have deployed Zabbix Server on a Proxmox container. We also hardened the installation through Let’s Encrypt certificates for the web frontend and TLS encryption for the communication between Server and Agents/Proxies, after all, although encrypted Zabbix Server <-> Agent/Proxy communication with PSK or SSL certificates 🙂
In this post I will cover how to monitor a Unifi AP using Zabbix Agent template. Templates are great because they already pack a bunch of monitoring items, actions, triggers, etc that we would have to add one by one otherwise. Using template is smart because when we need to make changes, we just do it in the template and all hosts that use them will see the new settings. On a manual setup, you would have to make the change in each host, one by one…
Configuring SNMPv3 on Unifi Controller
In order to allow the Zabbix Server to monitor your APs, we need to enable SNMPv3 on it.
After logging in into your Unifi Controller, navigate to Settings >> System >> SNMP. Make sure SNMP is configured as follows::
- SNMP
- SNMP Version 1 & 2C: unchecked
- SNMP version 3: checked
- User Name: zabbix
- Password: Pick one password
Click on Apply CHANGES and you are done.
Configuring Zabbix Server through Web UI
The template we are going to use doesn’t come installed in Zabbix Server by default, so we are going to import it first. Visit the community template page and navigate to Network_Devices >> Ubiquiti >> template_unifi_ap_snmpv3 >> 6.0 and click on
template_unifi_ap_snmpv3.yaml file, followed a click on Raw button. Save the file locally.
Go to Configuration >> Templates and click on Import. Click on Choose file in the configuration dialog, select the YAML file previously saved and click on Import. Another dialog will be displayed with the actual content being imported. Click on Import .
Although we don’t need to install a Zabbix Agent on the APs, we still need to create a Host on Zabbix Server to specify the NAS address, etc
Go to Configuration >> Templates and click on Create Host button. When the configuration dialog open, the Host tab should be the default one. Fill in the following fields and leave the rest as-is:
- Host
- Host name: Type the Unifi AP hostname
- Templates: UBQT UNIFI SNMP V3 HN
- Host Groups: Agentless or whatever describes your Agent
- Interfaces:
- Add a new interface
- Type: SNMP
- IP Address: Type the server IP to be ping’ed
- DNS Name: Type the server FQDN to be ping’ed
- Connect to: Select IP or DNS
- Port: 161
- Description: Do your thing here
- Monitored by Proxy: (no proxy)
- SNMP Version: SNMPv3
- Context Name: empty
- Security Name: Type the user set in the Unifi Controller
- Security Level: authPriv
- Authentication Protocol: SHA1
- Authentication Passphrase: Type the password set in the Unifi Controller
- Privacy protocol: AES128
- Privacy passphrase: Type the password set in the Unifi Controller
- Add a new interface
- Macros
- Click on Add
- Macro: {$SNMP_AUTHPASS}
- Value: The “Password” created in the previous section
- Description: be creative or leave empty
- Click on Add
- Macro: {$SNMP_PRIVPASS}
- Value: The SNMP Privacy Password created in the previous section
- Description: do your thing
- Click on Add
- Macro: {$SNMP_USERNAME}
- Value: zabbix (or whatever “Username” was created in the previous section)
- Description: leave empty or not
- Click on Add
Finish the host creation by clicking Update.
That is it, let’s try it. Go to Monitoring >> Latest data. In the filter section, type the name of your Synology NAS server in the Hosts box and finally hit Apply. A list of items should be displayed for it, such as AP Hostname, etc
That is it, have fun!
Don’t you have the wrong port for SNMP ?
Indeed, the port should be 161. Thanks, I have fixed the post!
when trying to import I get an error saying “Import failed > invalid parameter “/i/request_method”:value must be 0″
@andreasD
I am guessing you are running > Zabbix 6.2? If so, comment out (#) the “request_method”s in the yaml.
Unrelated, where in the holy-heck is the passphrase portion of the SNMPv3 settings for the Ubiquiti Unifi. I only see username and password.
Username is zabbix and the password is the Passphrase you have created for the Zabbix Agent
“I’m a bit confused. When I selected SNMPv3 in the Zabbix server section, I typed in the username ‘zabbix’, which is the same username I created on the controller. Now, I have to enter two passwords, SHA1 and AES128. Is the AES128 and SH1 password the same as the one I created on the controller?”
I might be missing something. I’m able to ping the controller from Zabbix, but the Zabbix cannot communicate with the controller through SNMP (I got red SNMP)!!
Facing similar issue for SHA1 & AES128 , but on Unifi Controller when using SNMP V3 it givens only one option of password
Ey Andreas, I tried commenting/removing all “request_method” lines and that worked for me.
This is amazing!
Any chance you can do this for switches?
Good idea. I will try on one of the Unifi switches I have and post it. Stay tuned
The templae is not any good for the Unifi USW switches, returns only basic static info, nothing about ports and traffic. Has someone found a better template that works well with the Unifi USW switches?
which template should i import for the unifi switch , and what are the configuration
followed the guide but there is no alert for the AP’s unavailable through ICMP. How can I add it on triggers? thank you.
Thanks for posting this! I got it working on Zabbix 7.0 using my Unifi APs. Is there a template for network gear as well ? I have a Unifi Security Gateway and two switches I’d like to monitor too.