[ZBXNEXT-4204] Zabbix should be capable to watch filesystem events Created: 2017 Oct 31  Updated: 2021 Jan 03

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G)
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Major
Reporter: Marc Schoechlin Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux



 Description   

It would be good to have a new variant of active items:

Instead of cyclic updates, zabbix-agent should be capable to watch inotify events on directories or files. If a inotify event appears the item(s) should be fetched and delivered.
For some types of items this eases reviews of values/certain situations, allows to write easy nodata triggers and saves lots of space in the database.

Example:
The puppet state file /var/lib/puppet/state/last_run_summary.yaml is written after every puppetrun. If the zabbix detects the change and send only values if the event appear it would be easy to get the exact execution time and the resulting value of puppetruns.

Probably it would be a good idea to have a more general solution:
External checks which are allowed to block forever until values are delivered.

#!/bin/bash

inotifywait -e modify /var/lib/puppet/state/last_run_summary.yaml

  1. converted from yaml file
    echo < EOF
    Linux DB1" db.ping 1
    "Linux DB3" db.ping 0
    "Zabbix server" db.status 0
    "Zabbix server" db.error "Linux DB3 down"
    EOF

https://openquery.com.au/blog/tool-day-inotify



 Comments   
Comment by Marc Schoechlin [ 2017 Oct 31 ]

hmm, sorry unable to change the formatting/text of a already submitted issue

Comment by Rostislav Palivoda (Inactive) [ 2017 Nov 02 ]

Post new text in comment and I'll update description.

Comment by Marc Schoechlin [ 2021 Jan 03 ]

Next text:

It would be good to have a new variant of active items:

Instead of cyclic updates, zabbix-agent should be capable to watch inotify events on directories or files. If a defined inotify event appears the item(s) should be fetched and delivered.
For some types of items this eases reviews of values/certain situations, allows to write easy nodata triggers and saves lots of space in the database.

Example:
The puppet state file /var/lib/puppet/state/last_run_summary.yaml is written after every puppetrun.
If the zabbix detects the change and send only values if the event appear it would be easy to get the exact execution time and the resulting value of puppetruns.

The usage behavior could be:

  • define a (active) zabbix item
  • change a newly created toggle from "update based" to "file system event" and configure details (see: man 7 inotify)
  • file system pattern
  • inotify event type(s)
  • define a userparameter item which calls a script which reads the yaml file an converts it to json (suitable for a json path item preprocessing)

https://openquery.com.au/blog/tool-day-inotify

Generated at Fri Jul 04 08:00:55 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.