I'm attempting to create some more intelligent triggers for our Database Clusters in order to track the service desired state.
The service.info key item will let me track the service state as I need it - but I'm running into an issue where I need this to be a bit more "dynamic" in that it needs to know if the cluster node is the desired Primary vs. Secondary node.
I was hoping to do this by creating a templatized User Macro that we can override at the Host level depending on the desired node state (Primary).
Roughly, I'm attempting to do something like:
My current blocker is that final trigger - I can not figure out how I can put in a key item to perform the string comparison. I would like the item "desiredstate" to be set to another macro (as in I want to do a string comparison so that if "PRIMARY" = "PRIMARY" output True) OR do a string comparison directly in the trigger without the need for the key item completely.
The service.info key item will let me track the service state as I need it - but I'm running into an issue where I need this to be a bit more "dynamic" in that it needs to know if the cluster node is the desired Primary vs. Secondary node.
I was hoping to do this by creating a templatized User Macro that we can override at the Host level depending on the desired node state (Primary).
Roughly, I'm attempting to do something like:
Code:
({MSSQL Server Node:service.info[SQLAgent$NAVINET,state].last()}=1 and
{MSSQL Server Node:service.info[SQLAgent$NAVINET,state].last()}<>255) and
{MSSQL Server Node:desiredstate.str(PRIMARY)}<>{$NODESTATUS}
Comment