Need help with the Magic option with the check-disk-usage.rb check

Hi,

I am trying to understand the magic(-m) option with check-disk-usage.rb. From the info that I could find online(https://bonsai.sensu.io/assets/jspaleta/sensu-plugins-disk-checks):

Can adjust thresholds for larger filesystems by providing a ‘magic factor’
(-m ). The default, 1.0 , will not adapt threshold percentages for volumes.

So if I need to trigger a disk space free check at 20% on a 1TB drive vs 10% on a 2TB drive is this Magic threshold supposed to be able to do that?

When I test with any number for the -m my results do not change?

Any feedback/help is greatly appreciated.

Regards
P

Hi Pritesh, :wave:

My name is Dishi, and I work on Sensu at Sumo Logic. Thank you for reaching out regarding the -m (magic) option in the sensu-plugins/sensu-plugins-disk-checks plugin used to adjust thresholds based on disk size.

I have replicated the issue in my lab environment and confirmed that the -m option for adjusting thresholds based on disk size is not working as intended.
The challenge is that this plugin is part of the community tier, not a Sensu/Sumo Logic company-owned resource. We directly manage our company-owned resources, while the community manages community resources such as sensu-plugins. Our ability to address it directly is limited. Adding an issue to the repository in GitHub may be a way forward. The community actively contributes to improvements and fixes. Another benefit of this community is that other members may have solved this problem and contributed a solution here.

Another approach you may consider is utilizing two or more checks with subscriptions for each of the class of entities represented by the hardware differences, for example, using the much more recent Go asset:

https://bonsai.sensu.io/assets/sensu/check-disk-usage

  • Check one: Build this check for your large drives and have it alert at 10% disk remaining.
  • Check two: Check smaller drives, for example, 20%.
  • Lastly, subscribe the Agent entities to these checks as appropriate?

I hope that’s helpful. If you have any further questions or need assistance with other aspects of Sensu, please don’t hesitate to continue posting. The community is here to support you and help you navigate any challenges you may encounter. You are not alone in this journey.