Hejsan Mads, On Fri, Mar 27, 2015 at 12:35:24PM +0000, Mads Boye wrote: > Hi. > Is no one else experiencing this problem?
No, but I asked my colleague about it and we thought about it together since we use Icinga and do monitor NFS shares. This problem hadn't occurred to us, but now that you present it, there is at least a workaround that is fairly simple. Monitor a directory that is guaranteed to exist on the share instead of the share itself. Say, nfs-server:/a is mounted on your client as /mnt/a. You know that /mnt/a is a specific type of filesystem and always has a directory /b within it. So, you make your monitoring look for /mnt/a/b. If the mount is dropped, you get a DISK CRITICAL - /mnt/a/b is not accessible: No such file or directory Obviously this doesn't work if you can't guarantee anything about the contents of /mnt/a. Cheers, > BR. > > Mads. > > On tor, 2015-03-26 at 11:00 +0000, Mads Boye wrote: > > Hi Icinga-users. > > I am currently configuring Icinga to monitor my cluster. > > My problem is now that the nodes mount a bunch of NFS shares, which i of > > cause will like to check is properly mounted. > > So what I have done is make a custom service as follows: > > apply Service "nfs" { > > import "generic-service" > > check_command = "disk" > > vars.disk_partitions = [ "/pack" , "/scripts" , "/user" , > > "/projects" , "/tools" ] > > vars.disk_wfree = "20%" > > vars.disk_cfree = "10%" > > vars.disk_units = "GB" > > command_endpoint = host.vars.remote_client > > assign where host.vars.remote_client > > } > > > > This produce the following ouput in icinga-web > > DISK OK - free space: /pack 980 GB (97% inode=98%): /scripts 466 GB (99% > > inode=99%): /user 4567 GB (94% inode=99%): /projects 3335 GB (70% > > inode=99%): /tools 0 GB (99% inode=99%): > > > > My will like to check that the nfs shares are accesible and mounted, > > therefore i tried to unmount on of the shares, which did not produce a > > warning in icinga2, the share simply disappeared from the output, e.g. > > birdnes:~$sudo umount /tools > > produce this plugin output > > DISK OK - free space: /pack 980 GB (97% inode=98%): /scripts 466 GB (99% > > inode=99%): /user 4567 GB (94% inode=99%): /projects 3335 GB (70% > > inode=99%): / 213 GB (95% inode=97%): > > > > if I unmount all the nfs shares, the check simply defaults to check the > > root partition /, and it therefore still appears to be okay. > > > > What is the propper way to test if NFS shares is mounted and accessible? > > > > I tried the above with a physical disk, which caused the service to > > change to unknown status. > > > > > > -- > > De bedste hilsner / Best regards, > > > > Mads Boye > > > > HPC Administrator | AAU ITS > > Phone: (+45) 9940 3453 | Email: m...@its.aau.dk | Web: > > http://www.its.aau.dk/ > > Aalborg University | Selma Lagerlöfs Vej 300 – 3.1.14 | Aalborg East > > > > > > > > _______________________________________________ > > icinga-users mailing list > > icinga-users@lists.icinga.org > > https://lists.icinga.org/mailman/listinfo/icinga-users > > -- > De bedste hilsner / Best regards, > > Mads Boye > > HPC Administrator | AAU ITS > Phone: (+45) 9940 3453 | Email: m...@its.aau.dk | Web: > http://www.its.aau.dk/ > Aalborg University | Selma Lagerlöfs Vej 300 – 3.1.14 | Aalborg East > > > _______________________________________________ > icinga-users mailing list > icinga-users@lists.icinga.org > https://lists.icinga.org/mailman/listinfo/icinga-users -- Atro Tossavainen, Chairman of the Board Infinite Mho Oy, Helsinki, Finland tel. +358-44-5000 600, http://www.infinitemho.fi/ _______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users