Adding alerts to queries

I have an alert on mysql_global_status_wsrep_cluster_size and it works well. I want to add a second query/alert on ‘wsrep_cluster_status’ but 1) I do not know how to associate this query with a different alert. and 2) I am not sure how to compare a literal string i.e. ‘Primary’ using the functions provided (abs, min, max, etc).

1 Like

Hi Mikem,

You should create a new alert rule template and use it in a new alert.

The metric returns number 1 for Primary.

Screenshot 2021-11-17 at 16.59.35

1 Like

I only show tabs for Alert Rules and Notification Channels. How do i add/see Alert Rule Templates?

1 Like

I found it. Thanks for the help.

1 Like

Trying to create an Alert Rule Template but read this on your site -

  • type (required): PMM currently supports the float type. (More will be available in the future, such as string or bool .)

Does this mean I cannot compare a ‘string’ to a status variable, i.e. ‘wsrep_cluster_status’ ??

I want to create an alert that fires when wsrep_cluster_status <> ‘Primary’

1 Like

The metric can have values 1 or 0.

1 Like