3

I am using an item vfs.fs.size[/bakcrypt,free] (generated by autodiscovery) to monitor diskspace on an encrypted file system (and of course others). The encrypted filesystem in not auto mounted immediately at system startup because a passphrase has to be entered manually.

The problem is, that while my /bakcrypt is not (yet) mounted vfs.fs.size[/bakcrypt,free] gives the size of the "parent" filesystem (/) which is wrong. This leads to wrong triggers/alarms and jumps in the disk space graph.

Is there any way to prevent vfs.fs.size from giving a result if the named filesystem is not currently mounted?

Or is there a means of "conitional expression"? Something like whenmounted(/bakcrypt,vfs.fs.size[/bakcrypt,free]).

1 Answer 1

1

You should add a check, something like

vfs.file.regmatch[/proc/mounts,^\S+ /bakcrypt .*] 

and then customize your original trigger alert for the disk space with a condition, if the regmatch = 1 and diskspace is low, then alert.

6
  • It won't solve your grah issue tho.. I'll make another answer if I find something out to resolve this, I need to get at the office to make some tests, I'm in the subway atm. Commented Feb 13, 2017 at 9:30
  • Thank you very much, looks good, nice idea - I'll try this and give feedback. As you also noticed - this won't solve the graph-jumps-problem. I'd be happy to get a solution for this, too. Commented Feb 13, 2017 at 11:12
  • I've just tried this idea and the trigger works as expected using this expression: {martiniesrv:vfs.fs.size[/bakcrypt,free].last(0)}<20G and {martiniesrv:vfs.file.regmatch[/proc/mounts,^\S+ /bakcrypt .*].last(0)}>0. In addition to this I've added a trigger to just check if /bakcrypt is mounted: {martiniesrv:vfs.file.regmatch[/proc/mounts,^\S+ /bakcrypt .*].last(0)}=0. Thank you again for this help. I'd appreciate getting any idea for the graphing problem. Commented Feb 18, 2017 at 6:10
  • I still experienced a problem with my diskspace trigger: The 2 items in the trigger expression are not updated at the same time. So it can happen that the mount-check still results in "true" but the size-checks already has the low value because /bakcrypt is not mounted. My solution is the following expression: {martiniesrv:vfs.fs.size[/bakcrypt,free].max(#2)}<20G and {martiniesrv:vfs.file.regmatch[/proc/mounts,^\S+ /bakcrypt .*].last()}>0 Commented Feb 21, 2017 at 17:52
  • Glad I was able to help you for one part of your problem. I did some tests on my side, still didn't find a workaround for this graph issue, I'm not sure there's one.. I'll ask on the Zabbix forum to see if someone has an idea for this. Commented Feb 22, 2017 at 10:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.