Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having problems with vfs.file.exists on Zabbix 2.0.6 on a 64-bit Fedora 19 box. 2.0.6 is the latest version available from the Fedora yum repository, at the time of writing.

I want to check for the existence of the file /tmp/test:

[root@localhost ~]# ls -l /tmp/test
-rw-r--r-- 1 root root 14 Sep 16 10:30 /tmp/test

If I run I check directly with zabbix_agentd, it correctly determines that the file exists:

[root@localhost ~]# zabbix_agentd -t "vfs.file.exists[/tmp/test]"
vfs.file.exists[/tmp/test][/tmp/test]         [u|1]

However, if I use zabbix_get, it always returns 0, whether the file exists, or not:

[root@localhost log]# zabbix_get -s 127.0.0.1 -k "vfs.file.exists[/tmp/test]"
0

It's strange, because the same test works perfectly when connecting from the same server to a remote machine (also Fedora) running an older version of the Zabbix agent (1.8.13):

[root@localhost log]# zabbix_get -s remote.example.com -k "vfs.file.exists[/tmp/test]"
1

Some things will work:

[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "system.uname"
Linux host.example.com 3.9.5-301.fc19.x86_64 #1 SMP Tue Jun 11 19:39:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "system.uptime"
237830
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "system.run[whoami]"
zabbix

AFAICT, though, all the vfs.file.* keys do not work:

[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "vfs.file.cksum[/tmp/test]"
ZBX_NOTSUPPORTED
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "vfs.file.contents[/tmp/test]"
ZBX_NOTSUPPORTED
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "vfs.file.md5sum[/tmp/test]"
ZBX_NOTSUPPORTED
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "vfs.file.size[/tmp/test]"
ZBX_NOTSUPPORTED
[root@localhost ~]# zabbix_get -s 127.0.0.1 -k "vfs.file.time[/tmp/test]"
ZBX_NOTSUPPORTED

I have checked that the zabbix user can access that file, so its not a permissions issue:

[root@localhost ~]# sudo su -s /bin/bash zabbix
bash-4.2$ whoami
zabbix
bash-4.2$ ls -l /tmp/test
-rw-r--r-- 1 root root 14 Sep 16 10:30 /tmp/test

SELinux is also disabled.

Am I doing something wrong, or is this a bug in that particular version/distribution of Zabbix?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

On current versions of Fedora, the Zabbix agent, like many other system services, has a private namespaced /tmp and cannot see files in /tmp which are created by other processes. Since you're testing, try checking for the existence of a file in another directory.

share|improve this answer
    
That seems to have fixed it - thanks! –  G Mawr Sep 18 '13 at 14:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.