Using Zabbix 1.8.5 on Linux servers/agents (Ubuntu/Debian), I'm trying to monitor the age of some log files so that they can be graphed and then triggered on if they are too old. But I cannot manage to get a calculated item using vfs.file.time to work. I get no errors, but nothing appears in latest data for any of the hosts using the template which the item is in.
An example..
I've created an item in a template which is applied to multiple hosts :-
Description: Timestamp of /var/www/afile.txt
Type: Zabbix agent
Key: vfs.file.time[/var/www/afile.txt, modify]
Type: Numeric (unsigned)
Data type: Decimal
and this works correctly - I get valid timestamps like 1343844617 for all hosts and I can graph the item.
I then created an item in the same template
Description: Age of /var/www/afile.txt
Type: Calculated
Key: afile.txt.age
Formula: last(system.localtime)-last(vfs.file.time[/var/www/afile.txt, modify])
Type: Numeric (unsigned)
Data type: Decimal
I get no errors when adding, the item appears in the output from items.php (its enabled and no errors shown on the status), but nothing is logged in "Latest data" for any of the hosts which have this template.
I'm not seeing any errors in the Zabbix UI, in the server logs, or in the agent logs.
Can anyone tell me what I'm doing wrong ? Thanks
An example..
I've created an item in a template which is applied to multiple hosts :-
Description: Timestamp of /var/www/afile.txt
Type: Zabbix agent
Key: vfs.file.time[/var/www/afile.txt, modify]
Type: Numeric (unsigned)
Data type: Decimal
and this works correctly - I get valid timestamps like 1343844617 for all hosts and I can graph the item.
I then created an item in the same template
Description: Age of /var/www/afile.txt
Type: Calculated
Key: afile.txt.age
Formula: last(system.localtime)-last(vfs.file.time[/var/www/afile.txt, modify])
Type: Numeric (unsigned)
Data type: Decimal
I get no errors when adding, the item appears in the output from items.php (its enabled and no errors shown on the status), but nothing is logged in "Latest data" for any of the hosts which have this template.
I'm not seeing any errors in the Zabbix UI, in the server logs, or in the agent logs.
Can anyone tell me what I'm doing wrong ? Thanks