Simon icon Simon
Flexible server monitoring

Disk space filter?

Trying to get my head around filters so I created a simple script which outputs the percentage of disk space used:-
df -hl|grep "/"|awk {'print $5'}

The output displayed using Preview is 84%

My filter is:-
Success Number more than 95% input Response Text
Fail if input greater than fixed value of 95

The monitor always shows as failed.

I modified the Filter so that it strips the percentage symbol.

What am I doing wrong?
Thanks
Nic

AttachmentSize
disk space service35.62 KB
Filter38.76 KB
Activity log50.34 KB
David Sinclair's picture

Re: Disk space filter?

Check the Activity log; it shows what the service and each filter outputs. That might show the error.

Though I think I see the issue, if I'm interpreting you correctly — your second filter should also be a Success one, i.e. it should be used when the previous filter is successful.

If that doesn't help, edit your original forum post to attach a screenshot of the Filters page and Activity log. (You can't attach to comments.) Or email me.

Re: Disk space filter?

Hi,
Thanks for the reply. I've added a couple of screen shots (to the original post) which hopefully will help. The Activity screen didn't really help me much. I read the filter as it is successful unless the value returned is greater than the fixed value specified, in which case it's a fail. I'm not sure what I should define as a second filter for this.

Help appreciated.

David Sinclair's picture

Re: Disk space filter?

Ah, the issue is that the service outputs "86%" plus a linefeed. The Number filter requires just numeric digits, so you need another filter before the Number one to strip off the percent and linefeed characters. A simple Block filter with a % in the End text (and Start text blank) would be sufficient.

Alternatively, you can edit the "Number More Than 95%" filter (or a duplicate) to ignore those characters. (I'm not sure why it doesn't already ignore the percent sign; it should.)

Another option would be to alter your service to only output the digits.

Hope this helps.

Re: Disk space filter?

Ah, now I get it! :-)

I had already filtered the percent symbol under the 'greater than' filter which obviously didn't remove the return. I removed this, added in a block filter and this now works.

Many thanks for your help
Nic