NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
177 stars 95 forks source link

Passive check only on 'active' node of a cluster. #897

Open solarmon opened 1 year ago

solarmon commented 1 year ago

Hi,

I am using NCPA v 2.4.0 on a two cluster and would like to only get the 'active' node to send the passive check for a plugin script.

Is this possible natively with NCPA passive checks?

If so, how would I define the passive check to do that?

If not, could I get the plugin script to determine whether it is the 'active' node and return something, and if the 'standby' node to just not return an output?

How would the passive check handle the plugin script not returning anything - will it still attempt to send a passive update to the Nagios server?

sawolf commented 1 year ago

Hi @solarmon, thanks for reaching out.

I'm not sure exactly what you're running in a cluster, but is there a way you can run an action when the "active" node changes? If so, I would just have the ncpa_passive service disabled on the standby node until it becomes active.

solarmon commented 1 year ago

@sawolf

We are using corosync/pacemaker for the cluster. I can run a script for when a node becomes 'active'. I'm not sure whether I can get a script to run if a node goes into 'standby' mode.

What will the passive check do if the script returns nothing (or a specific return code). I can get the script to detect if it is not the active not, but I just need to understand what the passive check will do - ideally, it should do nothing.