Would you like to learn how to use Zabbix Userparameter feature? In this tutorial, we are going to show you how to configure Zabbix Userparameter and create a custom script to monitor a computer running Linux.
• Zabbix version: 3.4.12
• Linux: Ubuntu 18.04
The computer running Linux must have the Zabbix agent installed.
Hardware List:
The following section presents the list of equipment used to create this Zabbix tutorial.
Every piece of hardware listed above can be found at Amazon website.
Zabbix Playlist:
On this page, we offer quick access to a list of videos related to Zabbix installation.
Don’t forget to subscribe to our youtube channel named FKIT.
Zabbix Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Zabbix installation.
Tutorial – Configure UserParameter on Zabbix Agent
First, you need to install the Zabbix agent on the computer running Linux.
• Zabbix agent installation on Linux.
Next, we need to find a Linux command that will help us to monitor something that Zabbix agent was not able.
In our example, we want to know the number of accounts created on the Linux computer.
Use the following command to get the number of accounts created on the Linux Computer.
In our example, this command is telling us that our Linux computer has 33 accounts created.
It is time to integrate this command to the Zabbix agent.
Now, you should find the location of the zabbix_agentd.conf file on your system.
You need to edit the zabbix_agentd.conf file.
Here is the original file, before our configuration.
Here is the new file with our configuration.
To finish the configuration, you need to restart the Zabbix Agent running on this computer.
If our Zabbix agent installation tutorial was used, you may restart the Zabbix agent using the following command:
Now, the Zabbix server should be able to contact this computer and request the number of accounts created on the system using the key: computer.linux.usercount
The Zabbix agent installed on the Linux computer will inform the number of accounts created on the system.
To test our configuration, enter the following command on the Zabbix server console:
In our example, the Linux computer running the Zabbix agent is using the IP address: 192.168.0.150.
As you can see, The Zabbix server is able to remotely get this information from the Agent.
Tutorial – Zabbix UserParameter Configuration
Now, we need to access the Zabbix server dashboard and add the Linux computer as a Host.
Open your browser and enter the IP address of your web server plus /zabbix.
In our example, the following URL was entered in the Browser:
• http://35.162.85.57/zabbix
On the login screen, use the default username and default password.
• Default Username: Admin
• Default Password: zabbix
After a successful login, you will be sent to the Zabbix Dashboard.
On the dashboard screen, access the Configuration menu and select the Host option.
On the top right of the screen, click on the Create host button.
On the Host configuration screen, you will have to enter the following information:
• Host Name – Enter a Hostname to monitor.
• Visible Hostname – Repeat the hostname.
• New group – Enter a name to identify a group of similar devices.
• Agent Interface – Enter the IP address of the Hostname.
Here is the original image, before our configuration.
Here is the new image with our configuration.
Click on the Add button to include this host on the Zabbix database.
On the dashboard screen, access the Configuration menu and select the Host option.
Locate and click on the hostname that you created before.
In our example, we selected the hostname: LINUX-SERVER-01
On the Host properties screen, access the Applications tab.
On the top right part of the screen, click on the Create application button.
On the Host applications screen, create a new application named Linux
After finishing the Application creation, access the Items tab.
On the top right part of the screen, click on the Create item button.
On the Item creation screen, you need to configure the following items:
• Name: Enter the key value used on the zabbix_agentd.conf file.
• Type: Zabbix Agent
• Key: Create a custom key to your Userparameter
• Type of Information: Number (unsigned)
• Update interval: 60 Seconds
• Application: Linux
Click on the Add button and finish the Item creation.
Wait 5 minutes.
In order to test your configuration, access the Monitoring menu and click on the Latest data option.
Use the filter configuration to select the desired hostname.
In our example, we selected the hostname LINUX-SERVER-01.
Click on the Apply button.
You should be able to see the results of your Userparameter monitoring using Zabbix.
Congratulations! You have configured the Zabbix Userparameter feature.