check_disk permission denied as warning instead of cirtical

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
DooMRunneR
Posts: 1
Joined: Fri Dec 14, 2018 8:20 am

check_disk permission denied as warning instead of cirtical

Post by DooMRunneR »

Hello,

i don't run the check_disk binary (2.2.1) as root/sudo and i don't want to, i exclude "permission denied" deivce paths or filesystems for the affected systems.

But something that bothers me is the fact that a "permission denied" always runs into a critical error. Nagios automatically calls our 24/7 support on the phone on Critical errors but something like a "permission denied" was always a bind mount, overlay fs or something similar.

Is it somehow possible to change this to a warning instead of a critical error, warnings are errors we fix on the next business day and not in the middle of the night.

Kind Regards
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: check_disk permission denied as warning instead of cirti

Post by npolovenko »

Hello, @DooMRunneR. The logic on when to return a Critical state is hardcoded in the plugin itself. The only way to change the condition for this particular plugin is to modify the source code and then recompile it.
https://github.com/nagios-plugins/nagio ... eck_disk.c

We do have a check_negate plugin that can revert all critical states of this plugin into warnings.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
But I'm guessing you still want to see a critical output when a disk is running out of space?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk permission denied as warning instead of cirti

Post by mcapra »

Shy of rebuilding check_disk, you could probably write a wrapper script in Bash pretty easily to translate stdout matching "permission denied" and a return code of "CRITICAL" to "UNKNOWN" or some other output more convenient for your use case. I'd be happy to give pointers on such an implementation.

Alternatively, you could request such native functionality for check_disk by filing an issue on GitHub:
https://github.com/nagios-plugins/nagios-plugins/issues
Former Nagios employee
https://www.mcapra.com/
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: check_disk permission denied as warning instead of cirti

Post by npolovenko »

Shy of rebuilding check_disk, you could probably write a wrapper script in Bash pretty easily to translate stdout matching "permission denied" and a return code of "CRITICAL" to "UNKNOWN" or some other output more convenient for your use case. I'd be happy to give pointers on such an implementation.
Good idea.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked