OSX version of check_nfs_mounts?

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.
forrie
Posts: 25
Joined: Tue Nov 22, 2011 6:50 pm

OSX version of check_nfs_mounts?

Post by forrie »

We have a few OSX systems for which I must monitor for active NFS mounts, similar to check_nfs_mounts.sh on regular linux systems. OSX does things different, so it doesn't have /proc or /etc/mtab. OSX is admittedly not my area of specialty -- and I'm trying to find a way to monitor the NFS mounts so that Nagios can work properly.

Does anyone have any tips on how to accomplish this with OSX 10.9 (or 10.8)?


Thank you.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: OSX version of check_nfs_mounts?

Post by abrist »

How about:

Code: Select all

 /etc/fstab

?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
forrie
Posts: 25
Joined: Tue Nov 22, 2011 6:50 pm

Re: OSX version of check_nfs_mounts?

Post by forrie »

No, to check that they are actively mounted and operational. Not just configured.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: OSX version of check_nfs_mounts?

Post by slansing »

Have you tried manually editing the plugin to fit your mount points??
forrie
Posts: 25
Joined: Tue Nov 22, 2011 6:50 pm

Re: OSX version of check_nfs_mounts?

Post by forrie »

Look at the plugin code. It calls to /proc and /etc/mtab -- as I explained above, these are not present in the OSX system. At least, I'm not aware of it stores this same information elsewhere.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: OSX version of check_nfs_mounts?

Post by abrist »

I am not a mac guy either. One way I check mounts in gentoo is:

Code: Select all

mount -v
Or:

Code: Select all

mount -v|grep nfs
Does this work in ifruit land?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
forrie
Posts: 25
Joined: Tue Nov 22, 2011 6:50 pm

Re: OSX version of check_nfs_mounts?

Post by forrie »

The person that set up the mounts has them in autofs, so the output looks like:

Code: Select all

/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
map -static on /Network/prod/mezz (autofs, automounted, nobrowse)
map -static on /Network/test/mezz (autofs, automounted, nobrowse)
map -static on /Network/mezz (autofs, automounted, nobrowse)
map -static on /Network/dev/mezz (autofs, automounted, nobrowse)
/dev/disk1 on /Volumes/CF92 (msdos, local, nodev, nosuid, noowners)
/dev/disk2 on /Volumes/CF77 (msdos, local, nodev, nosuid, noowners)
In Linux, at least, you can check the active filesystems and their type in /proc and /etc/mtab

Since OSX is sorta BSD-ish (maybe less so these days) I figure there must be some facility in there -- that the microkernel refers to.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: OSX version of check_nfs_mounts?

Post by sreinhardt »

Not quite as clean, but have you tried using df -h or something similar and grepping for the specific mount point? Would this fit your needs of making sure its mounted and available?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
forrie
Posts: 25
Joined: Tue Nov 22, 2011 6:50 pm

Re: OSX version of check_nfs_mounts?

Post by forrie »

df -h does not indicate the mount point type (ie: nfs).

I was hoping to discover some equivalent in OSX that stores this data, similar to mtab or /proc. That would be more accurate. But it's looking like Apple really changed things so much that nobody seems to know.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: OSX version of check_nfs_mounts?

Post by lmiltchev »

Did you create the mount point using the Disk Utility or you mounted it manually as root? If you did the latter, you *should* see something like: "192.x.x.x:/xxx/xxx on /xxx/xxx/xxx (nfs)", when you run the mount command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked