Using data in a remote site

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.

To check the table definition in SQLite, you can use the .schema proxy_history command.

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

The proxy doesn't have much information on item configuration; you'll need to grab that from the Zabbix server if you're doing remote processing. For example, the proxy has item keys and intervals, but item names aren't available in the proxy database.

As can be seen, several fields will be used for log file monitoring and some others only for Windows event log monitoring.

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

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