We covered data retrieval on the Zabbix server. But what if we have a remote site, a Zabbix proxy, a powerful proxy machine, and a slow link? In situations like this, we might be tempted to extract proxy data to reuse it. However, the proxy stores data in a different way than the Zabbix server.
Just like in the previous chapter, run the following command:
$ sqlite3 /tmp/zabbix_proxy.db
This opens the specified database. We can look at which tables are present by using the .tables command:
sqlite> .tables
Notice how there're still all of the history* tables, although we already know that the proxy doesn't use them, opting for proxy_history instead. The database schema is the same on the server and proxy, even though the proxy doesn't use most of those tables at all. Let's look at the fields of the proxy_history table.
The following table illustrates the item fields and their usage:
Field |
Usage |
id |
The record ID, used to determine which records have been synchronized back to the server |
itemid |
The item ID as it appears on the Zabbix server |
clock |
The Unix time of the record, using proxy host time |
timestamp |
Relevant for time, parsed through the log file time format field, or for Windows event log monitoring—the timestamp as it appears on the monitored machine |
source |
Relevant for Windows event log monitoring only—event log source |
severity |
Relevant for Windows event log monitoring only—event log severity |
value |
The actual value of the monitored item |
logeventid |
Relevant for Windows event log monitoring only—event ID |
ns |
Nanoseconds for this entry |
state |
Whether this item is working normally or it's in the unsupported state |
lastlogsize |
The size of the log file that's been parsed already |
mtime |
The modification time of rotated log files that have been parsed already |
meta |
If set to 1, it indicates that this entry contains no actual log data, only lastlogsize and mtime |
As can be seen, several fields will be used for log file monitoring and some others only for Windows event log monitoring.