Item scheduling

Earlier, we discussed what introduces delay before a new item is checked—the Zabbix server configuration cache was mentioned. For passive items, there is another factor involved as well, and it is the way Zabbix schedules items to be polled. Each item is scheduled to be polled at a certain time, and the time between two polls is always constant. Even more, a specific item is always scheduled the same way, no matter when the Zabbix server was started. For example, if an item has a 60-second interval, it could be configured to be polled at second 13 of every minute. If the Zabbix server is restarted, this item will still be polled at second 13 of every minute. This scheduling is based on an internal item ID; hence, a specific item will not get this timing changed during its lifetime unless it is deleted and recreated or the item interval is changed.

This logic is similar for all polled item types and will be relevant when we configure SNMP and other item types.

Active items get their polling started upon agent startup; hence, the specific time when values arrive will change based on when the agent was started. Additionally, active items are processed in a serial fashion; hence, one slow item can delay the values for other items from the same agent.

To summarize, after we add a new passive item, it is saved in the database, the Zabbix server does not know about it yet. This item is then loaded into the configuration cache. The configuration cache is refreshed every 60 seconds by default. After the server finds out about the new item, it schedules the item to be polled for the first time at some point between that moment and the item interval.

This means that, with the default interval of 30 seconds, it may take from 30 to 90 seconds before the first value arrives for the item. If the item has a very long interval, such as a serial number or agent version configured earlier, it may take a very long time until the first value appears automatically. There is no way to speed up item polling except by adding it with a short interval at first and then increasing the interval when the item has been verified to work as expected.

After a new active item is added, it is saved in the database again and the Zabbix server does not know about it yet. The active Zabbix agent periodically connects to the server to gather information about items it is supposed to monitor but, as it is not in the configuration cache yet, the server does not tell the agent about the item. This item is then loaded into the configuration cache. The configuration cache is refreshed every 60 seconds by default. After the server finds out about the new item, the item is available to the agent, but the agent connects to the server every two minutes by default. Once the agent finds out about the new item, it immediately attempts to collect the first value for it.

Refer to Chapter 20, Zabbix Maintenance, for details on how to tune these intervals.

In both cases, if an item is set to delta, we have to obtain two values before we can compute the final value that will be stored in the database and displayed in the frontend, we can't compute the difference from just one value.

However, with Zabbix 4.0 a feature was introduced that was the most voted feature for years that allows us to speed up things but only for passive checks at the moment. Also, we still have to wait till the configuration cache has picked up the changes before we can use this feature. By going to a passive item, we have at the bottom of the page a Check now button that allows us to retrieve the latest value of this item. Hopefully, this feature will be improved in the future so that it will work for active and passive items:

To be able to use the Check now button, the item config must be present in configuration cache in order to get executed. So it is not possible to check for a new value for an item/rule that has been created just now. Unless we wait till the configuration cache has picked up the information. We can however do a force reload of the configuration cache. Something that we will see in our Chapter 17, Using Proxies to Monitor Remote Locations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset