OSX version of check_nfs_mounts?
OSX version of check_nfs_mounts?
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.
Does anyone have any tips on how to accomplish this with OSX 10.9 (or 10.8)?
Thank you.
Re: OSX version of check_nfs_mounts?
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.
"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.
Re: OSX version of check_nfs_mounts?
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?
Have you tried manually editing the plugin to fit your mount points??
Re: OSX version of check_nfs_mounts?
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.
Re: OSX version of check_nfs_mounts?
I am not a mac guy either. One way I check mounts in gentoo is:
Or:
Does this work in ifruit land?
Code: Select all
mount -vCode: Select all
mount -v|grep nfsFormer 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.
"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.
Re: OSX version of check_nfs_mounts?
The person that set up the mounts has them in autofs, so the output looks like:
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.
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)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?
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.
Re: OSX version of check_nfs_mounts?
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.
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.
Re: OSX version of check_nfs_mounts?
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!