We have a custom template supported by a couple of client UserParameters for monitoring status of filesystems defined in /etc/fstab on Linux clients. The one for checking individual filesystems looks like this:
The "stat" command is wrapped in a "timeout" command so that if an NFS server is offline it doesn't hang indefinitely. This only works if I set the duration on the timeout command to 1s for one second, if I set it to a more sensible duration like 10s the item becomes unsupported with the following error in the Zabbix server log:
The duration value given to "timeout" isn't how long it runs for, it's the maximum time for the child command to be allowed to run before killing it so I can't figure out why setting it to any more than 1s causes Zabbix to think it's timing out. I've tried setting the Timeout value in the client settings to a longer duration than that which we give to the "timeout" command but that didn't help. Any ideas gratefully received...
Code:
UserParameter=filesystem.mounted[*],timeout 10s sudo stat -f $1 >/dev/null 2>&1 ; echo $?
item "<hostname>:filesystem.mounted[/]" became not supported: Timeout while executing a shell script.
Comment