1

I have a file that is written on each of my Zabbix clients with a time inside of it every hour.

I need the Zabbix server(s) to check these files and alert if the time is at least 6 hours old.

I cannot see where or how this trigger might be implemented and the Zabbix documentation does not give me enough detail.

2
  • Could you please describe what time format is used inside the files? Can you change it, if need be?
    – asaveljevs
    Jun 20, 2014 at 8:18
  • Currently the time format inside the file is HHMMSS, but as the file is generated via a Ruby script this could be anything that would help Zabbix read it more easily.
    – kemra102
    Jun 20, 2014 at 8:24

1 Answer 1

2

The easiest solution would be to output Unix timestamp into the file and read that value using vfs.file.contents[] (see item documentation). This has the benefit that you can specify "unixtime" as the unit in item configuration and you will see a pretty value in "Latest data".

A trigger could then be as follows:

{host:vfs.file.contents[/tmp/timestamp.txt].now()} -
    {host:vfs.file.contents[/tmp/timestamp.txt].last()} > 6h

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .