Ad Widget

Collapse

vfs.file.contents item not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kalapka
    Junior Member
    • Feb 2023
    • 1

    #1

    vfs.file.contents item not working

    Hello,
    I'm trying to setup an item which reads content of a file. But getting an error: "Cannot obtain file file.txt" information: stat file.txt: permission denied. I believe that permissions are ok, even if I run command under zabbix user (under which agent is installed) 'zabbix_agent2 -t vfs.file.contents["file.txt"]' i got a correct response, so not sure where the problem is.
    Could anyone advise?
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Did you run the zabbix_agent2 command with the -t option as root user? Check the permissions of the file and the permissions of each directory leading up to that file.​

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Originally posted by Atsushi
      Did you run the zabbix_agent2 command with the -t option as root user? ​
      I think its user zabbix they use...
      Originally posted by kalapka
      even if I run command under zabbix user (under which agent is installed) 'zabbix_agent2 -t vfs.file.contents["file.txt"]' i got a correct response
      Just in case... any selinux messages on that node? I think I have had a case, when logged in user managed to get file contents but zabbix did not (even when all the dirs etc where with very open permissions) and we needed some selinux updates..

      Comment

      Working...