Linux File System Read Only Check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Linux File System Read Only Check

Post by jkinning »

I need to remotely periodically check if a Linux file system is mounted read only on lots of servers. I found this plugin, http://exchange.nagios.org/directory/Pl ... ts/details, but wondering if there is another way to use nrpe or a plugin already deployed. Trying to avoid deploying a plugin to all these Linux servers.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Linux File System Read Only Check

Post by rkennedy »

I believe the check_disk option is what you'd normally be looking for, but I do not see an option to check if it's a read only file system.

Your best bet is using the plugin you linked already in conjunction with NRPE.
Former Nagios Employee
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Linux File System Read Only Check

Post by jkinning »

That's what I was afraid of. I configured and deployed the file to a test server but when I try to get back results from nagios I am getting this message:
Can't find string terminator '"' anywhere before EOF at ./check_ro_mounts.pl line 56.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Linux File System Read Only Check

Post by mcapra »

What OS is the test server running? I was unable to replicate this issue against CentOS 6 using the unmodified file on the exchange.
Former Nagios employee
https://www.mcapra.com/
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Linux File System Read Only Check

Post by jkinning »

These are SUSE boxes, SLES 11sp4 primarily and a handful of 12sp1.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Linux File System Read Only Check

Post by tgriep »

The error you posted looks like the script may be corrupted in that line.
That line prints out an message that it cannot open the mtab file.
Can you upload the script here so we can view it and also how you ran it on that server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Linux File System Read Only Check

Post by jkinning »

I added the txt extension so I could upload to the board. I tested this on a test Nagios server running CentOS 6.8 and got the same results.

[nagios@nagiosl1t libexec]$ ./check_ro_mounts.pl
Can't find string terminator '"' anywhere before EOF at ./check_ro_mounts.pl line 56.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Linux File System Read Only Check

Post by tgriep »

Ah, it looks like only half of the plugin was downloaded to the server and that is causing the issue.
Go back to that site, download the plugin to your PC, then in the Nagios XI GUI, go to the Admin > Manage Plugins menu, brows to the plugin on your PC and upload it.
That should fix it for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Linux File System Read Only Check

Post by jkinning »

You can close this up.

That fixed the problem. Thanks!
Locked