Hello All,
I’ve asked a few questions about this topic on IRC but think this may be a better approach. I’m trying to determine the best way to address the following scenario:
VirtualNodes1-5 should not generate events because their PhysicalNode is down.
Of course, there may be other real-world common sense work flows such as various relationships between local or distributed services but I’m trying to keep it simple now by focusing on scenario above.
From IRC discussions and reading the wiki, I’m wondering how sane this approach might be:
-
A virtual client is configured with a custom attribute representing the parent node’s hostname
node_parent = foo
-
The sensu server is configured with a mutator which behaves as follows:
- Inspect the incoming event for a custom ‘node_parent’ attribute
- If found, query the API for a “host down” event related to the hostname found in ‘node_parent’
- Mute the event if found, otherwise let it pass
The above ‘mutator’ approach probably only scratches the surface of an intelligent work flow so I’m anxious to hear thoughts and opinions.
Best,
Adam
Have you looked at the sensu-plugin library? The Handler class provides a simple filter for check dependencies, but only in the scope of the client.
https://github.com/sensu/sensu-plugin/blob/master/lib/sensu-handler.rb#L108
Adding a filter method to your handler to check for a event[‘client’][‘physical_node’] event matching “keepalive” (as an example) could work. You could probably use api_request(). Using a mutator to filter events/notifications would work, but be aware that the Sensu server will potentially spawn more processes as a result.
Sean.
···
On Friday, 22 March 2013 07:41:25 UTC-7, window...@gmail.com wrote:
Hello All,
I’ve asked a few questions about this topic on IRC but think this may be a better approach. I’m trying to determine the best way to address the following scenario:
VirtualNodes1-5 should not generate events because their PhysicalNode is down.
Of course, there may be other real-world common sense work flows such as various relationships between local or distributed services but I’m trying to keep it simple now by focusing on scenario above.
From IRC discussions and reading the wiki, I’m wondering how sane this approach might be:
-
A virtual client is configured with a custom attribute representing the parent node’s hostname
node_parent = foo
-
The sensu server is configured with a mutator which behaves as follows:
- Inspect the incoming event for a custom ‘node_parent’ attribute
- If found, query the API for a “host down” event related to the hostname found in ‘node_parent’
- Mute the event if found, otherwise let it pass
The above ‘mutator’ approach probably only scratches the surface of an intelligent work flow so I’m anxious to hear thoughts and opinions.
Best,
Adam
Thanks Sean,
I saw the handler methods about 10 minutes ago but would really benefit from seeing an example of how to use them along with the default handler.
FYI, this gets even more confusing when considering the role of stashes