PDA

View Full Version : VFS monitoring of files with unusual characters


rts
14-04-2009, 16:21
Hi,

I need to monitor the modification time of a file which contains [] (square brackets) in its name. This seems not to work, nor do I appear able to use wild cards in the filename definition in a call such as:

[root@servera /]# zabbix_agentd -t "vfs.file.time[/tmp/sample[file].txt]"
vfs.file.time[/tmp/sample[file] [m|ZBX_NOTSUPPORTED]
[root@servera /]# zabbix_agentd -t "vfs.file.time[/tmp/sample?file?.txt]"
vfs.file.time[/tmp/sample?file?.txt] [m|ZBX_NOTSUPPORTED]
[root@servera /]# zabbix_agentd -t "vfs.file.time[/tmp/sample*file*.txt]"
vfs.file.time[/tmp/sample*file*.txt] [m|ZBX_NOTSUPPORTED]
[root@servera /]# zabbix_agentd -t vfs.file.time[/tmp/sample*file*.txt]
vfs.file.time[/tmp/sample*file*.txt] [m|ZBX_NOTSUPPORTED]
[root@servera /]# zabbix_agentd -t vfs.file.time[/tmp/sample?file?.txt]
vfs.file.time[/tmp/sample?file?.txt] [m|ZBX_NOTSUPPORTED]
[root@servera /]# zabbix_agentd -t vfs.file.time[/tmp/sample[file].txt]
vfs.file.time[/tmp/sample[file] [m|ZBX_NOTSUPPORTED]
[root@servera /]# ls -al /tmp/sample?file?.txt
-rw-r--r-- 1 root root 0 2009-04-14 15:20 /tmp/sample[file].txt
[root@servera /]#


Has anyone any suggestions? I can easily use a UserParameter to monitor this file, but it seems a bit silly when the functionality is almost present in the code.

rts

dotneft
14-04-2009, 17:15
*** ~ # touch /tmp/sample[file].txt
*** ~ # zabbix_agentd -t "vfs.file.time[/tmp/sample[file].txt]"
vfs.file.time[/tmp/sample[file].txt] [u|1239722059]
*** ~ # zabbix_agentd -t vfs.file.time[/tmp/sample[file].txt]
vfs.file.time[/tmp/sample[file].txt] [u|1239722059]
*** ~ # zabbix_agentd -V
ZABBIX Agent (daemon) v1.6.2 (16 January 2009)
Compilation time: Mar 21 2009 09:54:26


hmmmm...try use "\" : zabbix_agentd -t vfs.file.time[/tmp/sample\[file\].txt]

rts
14-04-2009, 18:36
Ah. Sorry about that. I have dug around, and it appears we're running v1.4 not v1.6 of the agentd. It all works fine on v1.6.

The reason we're not using v1.6 is because of http://www.zabbix.com/forum/showthread.php?t=11560

dotneft
14-04-2009, 19:21
*** ~ # cat /etc/zabbix/zabbix_agentd.conf | grep num
UserParameter=usern.num,/usr/bin/\w\h\o | wc -l
*** ~ # zabbix_get -s localhost -p 10050 -k usern.num
3

but thise

*** ~ # zabbix_agentd -t usern.num
usern.num [m|ZBX_NOTSUPPORTED]


not working, why? o0

dotneft
14-04-2009, 19:24
Ah. Sorry about that. I have dug around, and it appears we're running v1.4 not v1.6 of the agentd. It all works fine on v1.6.

The reason we're not using v1.6 is because of http://www.zabbix.com/forum/showthread.php?t=11560

.try use "\" : zabbix_agentd -t vfs.file.time[/tmp/sample\[file\].txt]
not working?

rts
14-04-2009, 19:34
The backslashes didn't work with 1.4