Ad Widget

Collapse

Monitor file mode, group, owner in Zabbix or create custom item.key?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adam.cormany
    Junior Member
    • Aug 2020
    • 7

    #1

    Monitor file mode, group, owner in Zabbix or create custom item.key?

    Is there a way in Zabbix (using 5.0.5) to monitor a file's mode (i.e. permissions), group and owner in Linux? From what I've read, some of recommended checking vfs.file.time[<file>,change] but that just gives me the last change timestamp as expected. It isn't specific enough for my liking.

    If there isn't a way currently, is there a way for me to create my own item.key like vfs.file.owner, vfs.file.group, vfs.file.mode that parses out the data I'm looking for? If so, can someone point me in the direction of how to create custom item key?

    Thanks,
    Adam
  • adam.cormany
    Junior Member
    • Aug 2020
    • 7

    #2
    Disregard. I see now you can just set up a UserParameter for things like this.

    In the agent config:
    UserParameter=vfs.file.stat[*],stat -c '$2' '$1'

    From the server/proxy:
    $ zabbix_get -s <IP> -p 10050 -k vfs.file.stat[/etc/testfile.atc,%G]
    root

    Comment

    Working...