monitor disk usage only for a specified fs type (NFS)?

Babineau, Mike Mike.Babineau at Pearson.com
Thu May 31 18:36:50 CEST 2007


This is very clever - I had never thought to use an inline for loop to
get the job done.  It works flawlessly in my nrpe.cfg.  Thank you!

-Mike

-----Original Message-----
From: Hari Sekhon [mailto:hpsekhon at googlemail.com] 
Sent: Thursday, May 31, 2007 4:32 AM
To: Babineau, Mike
Cc: Nagios Users mailinglist
Subject: Re: [Nagios-users] monitor disk usage only for a specified fs
type (NFS)?

here is my trick for this:

check_disk -w 4% -c 1% $(for x in $(*grep -e nfs* < /proc/mounts |awk 
'{print $2}'); do echo -n " -p $x "; done)

the bold bit "grep -e nfs" is the bit to pay attention to. Of course 
this only works for linux but I like it and I only like running Linux so

there you go.

It's actually very easy to modify this if you have another OS, just 
change the "< /proc/mounts" bit to feed stdin from another mount listing

from some other coreutil or equivalent.

bash is great.

-h

Hari Sekhon



Babineau, Mike wrote:
>
> Short of using check_disk with a string of -X (--exclude-type) 
> arguments or writing a custom plugin, is there a way to monitor disk 
> usage for mounts of a specified fs type (in this case, NFS)? The NFS 
> mounts in this case are rented, NAS'd-out SAN space, so I can't 
> monitor the source. It seems like it may be possible with -p, but I 
> haven't gotten it to recognize any sort of wildcard. Why does 
> --exact-match exist if -p won't accept partial paths/partitions or 
> wildcards:
>
> -E, --exact-match
>
> For paths or partitions specified with -p, only check for exact paths
>
> (I am using check_disk 1.79 packaged with nagios-plugins 1.4.5)
>
> Any ideas?
>
> Thanks,
>
> ---------------------------
>
> Michael Babineau
>
> Production Services
>
> Pearson Curriculum Group
>
> mike.babineau at pearson.com <mailto:mike.babineau at pearson.com>
>
>
************************************************************************
**** 
>
>
> This email may contain confidential
> material. If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>
>
************************************************************************
*** 
>
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
>
------------------------------------------------------------------------
>
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
**************************************************************************** 
This email may contain material confidential to
Pearson.  If you were not an intended recipient, 
please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list