Page 1 of 1

check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 11:24 am
by simonl
Hello,
Need a plugin that will make sure the root user can write to "/" and /usr.
We have situations where these filesystems go into read-only mode due to a vmware issue on the storage.

If I install that plugin will or can it be run as root to do the test I'm looking for which is touch /testfile touch /usr/testfile.

Thank you

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 12:22 pm
by rkennedy
Did you look at our Exchange ( https://exchange.nagios.org/ ) to see if any of those plugins would work for you?

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 1:33 pm
by simonl
should have been more specific.
the check_disk_write.pl reads like it will do what we want functionally.

My question is once I get check_disk_write.pl installed can it be run as root since only root can write to "/" and "/usr".
Is it as simple as have the script be owned as root with a suid permissions?

I'm asking this since I've haven't had the oppty. yet to download a plugin and have it installed in our nagios environment. I've been using cann'ed plugins from the red hat and epel repos.

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 2:27 pm
by rkennedy
Ah - I understand now. Yes, this should work fine.

You will need to tweak your /etc/sudoers file accordingly though, to make sure that the user can run the script for one, and with NOPASSWD for two.

Here's an example, before and after editing the sudoers -

Code: Select all

[nagios@suse11 nagios-plugins]$ sudo ./check_disk_write.pl -d /
[sudo] password for nagios:
Sorry, user nagios is not allowed to execute './check_disk_write.pl -d /' as root on suse11.nagios.local.

Code: Select all

[nagios@suse11 nagios-plugins]$ sudo ./check_disk_write.pl -d /
OK: canary file I/O written => read back 51 bytes successfully in /, unique contents verified
Also, this is a broad example of what I added to my sudoers file -

Code: Select all

nagios  ALL=(ALL)       NOPASSWD: ALL

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 3:01 pm
by simonl
moving fwd. The script is looking for libraries that I do not have:
./check_disk_write.pl -d /usr -v
Can't locate HariSekhonUtils.pm in @INC (@INC contains: ./lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at ./check_disk_write.pl line 23.



do you know is there a way to yum install these libraries?

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 3:05 pm
by rkennedy
These plugins use a custom library - seperate from Nagios, see https://github.com/harisekhon/nagios-plugins for instructions under the 'Quick Start' text for what you'll need to run.

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 3:14 pm
by simonl
next problem:
git clone https://github.com/harisekhon/nagios-plugins
Cloning into 'nagios-plugins'...
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/harisekhon/nagios-pl ... pload-pack
fatal: HTTP request failed

Re: check_disk_write.pl plugin

Posted: Mon Dec 21, 2015 3:16 pm
by rkennedy
To disable the git SSL check use this following command -

Code: Select all

git config --global http.sslVerify false