Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been using check_disk without problems until yesterday to check the free space in some partitions. Now we just added a NAS service from our hosting and I could mount it without problems, and, since we have a fixed amount of space, I would like to check the free space with Nagios for not being overcharged.

The problem is sometimes when check_disk goes to check then I get "unknown" status since of course autofs don't maintain the partition mounted 100% of the time. *(Nagios-users) check_disk and autofs* recommends making a wrapper for the plugin, but I don't feel comfortable with that.

Any idea about a better solution?

Edit:

Well, I found a solution for this:

  1. I've compiled and installed the check_file plugin.
  2. Created a file on the NAS root: .nagioscheck.
  3. Configured Nagios to check often if this file exists, rather than check the space.

So I can check if the NAS is mounted and the free space.

SERVICE STATUS: OK file or directory /mnt/backup/.nagioscheck exists

share|improve this question

2 Answers 2

Why not make a static entry in fstab instead using automount so it is always mounted?

In the GNU df manual:

This version of df cannot show the space available on unmounted file systems, because on most kinds of systems doing so requires very nonportable intimate knowledge of file system structures.

So I would guess if GNU df is not going to show the free space of a partition that is not mounted, a Nagios plugin probably won't either. But I could be wrong :-)

Maybe if you are using ext2/3 , by parsing out free blocks, block count, and block size out of tune2f you might be able to quickly write a plugin that will accomplish this:

sudo tune2fs -l /dev/sdb1
share|improve this answer

Is there any way for the nagios server to query the NAS directly? That would be the most direct course of action.

share|improve this answer
    
Good point I think, a good NAS should have SNMP support. –  Kyle Brandt Jun 18 '09 at 15:33
    
Exactly. The disk usage should be monitored on the file server, not the clients. –  Kamil Kisiel Jul 22 '09 at 23:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.