Would you like to learn how to use Zabbix Json monitoring feature? In this tutorial, we are going to show you all the steps required to use Zabbix JSON feature.
In our example, we are going to monitor the Forex price of the Dolar euro pair.
• Zabbix version: 4.2.6
We are going to use Zabbix to monitor the JSON output of the API from the Website Alphavantage.
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 – Zabbix Create JSON API
Some websites require you to create a JSON API to authenticate your JSN requests.
Access the Alphavantage website and create you free JSON API.
In our example we are going to use the API: 1LVKUPOY5HBM8CG6
Do not use this API, create your own API.
Tutorial Zabbix JSON – Monitoring Dollar Forex Exchange Price
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 Hosts option.
Locate and click on the hostname of your Zabbix server.
In our example, we selected the hostname: Zabbix server.
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: ALPHAVANTAGE.
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: Dollar-Euro
• Type: HTTP AGENT
• Key: zabbix.monitor.dollar.euro
URL: https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=EUR&apikey=1LVKUPOY5HBM8CG6
You need to replace my API with your API key.
Now, you must click on the Parse button.
After clicking on the Parse button, Zabbix will clean the URL and create the required variables.
On the Item creation screen, you still need to configure the following items:
• Request type: GET
• Timeout: 3s
• Request body type: Raw data
• Required status codes: 200
• Follow redirects: Yes
• Retrieve mode: Body
• Convert to JSON: YES
• Type of Information: TEXT
• Update interval: 60s
• Applications: Select ALPHAVANTAGE
• Enabled: Yes
Here is our configuration:
Click on the Add button to finish the Item creation and 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 and click on the Apply button.
In our example, we selected the hostname: Zabbix server and the application ALPHAVANTAGE
You should see a result similar to mine.
Congratulations! You have finished the configuration of the first item.
Tutorial – Zabbix JSON Monitoring Dollar to Euro Price
Now, we need to access the Zabbix server’s Item tab and create a new item.
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: Dollar-Euro Trade Price
• Type: Dependent Item
• Key: zabbix.monitor.dollar.euro.trade
• Master item: Zabbix server: Dollar-Euro
• Type of Information: Numeric float
• Application: ALPHAVANTAGE
Here is our configuration:
Now, you need to access the Preprocessing tab and click on the Add option.
• Name: JSONPath
• Parameter: $.body[“Realtime Currency Exchange Rate”][“5. Exchange Rate”]
Click on the Add option and then on the Add button.
Here is our configuration.
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 and click on the Apply button.
In our example, we selected the hostname: Zabbix server and the application ALPHAVANTAGE.
The item named Dollar-Euro Trade Price will show the Dollar price in Euro.
You should see a result similar to mine.
Here you can see the Dollar price moving on a Zabbix graphic.
Congratulations! You are now able to monitor the Dollar exchange price using Zabbix.