Monitor NFS Share Cluster via virtual IP alias


I would like to ask, if there is a way to monitor directories of shares where the share is clustered to a redundant cluster over an alias or virtual IP address.

I have 2 fileshare hosts wich provide nfs shares over a DRBD service.
The DRBD service does a automatic failover to the passive host, when the active host has a problem.

Now I want to monitor some directories with the check_file_ages_in_dirs command, but in my case thats only possible on the active host. The check on the passive host will not be able to access the directories because the mount of the share is on the active host. So it will output an error message.

My idea was to check the alias of the cluster (virtual IP) but I don’t know if this is possible because there is no “physical” host where I can run the check.

I hope I could explain it well. Thank you so far.

icinga2 version: 2.10.7-1
Platform: CentOS Linux
Enabled features: api checker command ido-mysql mainlog notification

You could use check_file_ages_in_dirs on both nodes but disable the notifications and use a third/meta service with some Icinga2 DSL magic to ensure that you have exactly one check_file_ages_in_dirs on one node that is OK.

Have a look at: Calculating a state over multiple services - #4 by moreamazingnick

Or use the Icingaweb2 Business Process Module to make sure only on is OK and use the icingacli as check for the third/meta service.

Can’t you simply create a host object for that cluster address/ip?
Or, if you don’t want active checks againts the cluster address, create a host object with the command dummy as check_command. Then the host will always be “up” and you can apply your service to it.

That is what I do and attach the services using DSL/“Business Process” checks onto this host.

Thank you for your replies, first i have to look, what this DSL Business Process is :slight_smile:

@log1c the IP adress is just virtual, a host for this IP does not exist, it is just an adress for the two active/passive hosts. When they swap you don’t need to change host address .

I understand that no “physical” host exists.
But you could still create a host object using that vIP in icinga and then apply checks to it.

The DSL and the “Business Process module” are 2 things.

  • Domain Specific Language refers to code in your Icinga2 configuration.
  • “Business Process module” allows you to implement logic in Icingaweb2.

I also create hosts in Icinga2 for non existing servers to model virtual IPs.

For some I just use the one Host and use checks that go over the virtual IP - for example: HTTP checks.
If the Icinga2 Agent is installed on the hosts behind the virtual IP I utilize my DSL and/or “Business Process” services on the host with the virtual IP to correlate the checks running on the real servers.