I want to monitor the slave status of the MySQL ,when the state is normal, the
value is 1, but not in normal state for null, I want to know the value of null,
how can I judge through the script:
The following is my script:
var crit_threshold = 1
var data = stream
|from()
.database('telegraf')
.retentionPolicy('telegraf_01')
.measurement('mysql')
.groupBy('host')
|window()
.period(10s)
.every(10s)
data
|alert()
.id('{{ index .Tags "host"}} | {{ index .Tags "slave_Slave_SQL_Running"}}')
.message('{{ .ID }} is {{ .Level }} value:{{ index .Fields
"slave_Slave_SQL_Running" }}')
.crit(lambda: "slave_Slave_SQL_Running" != 1)
.stateChangesOnly()
.log('/tmp/alert.log')
Please help me.
telegraf+kapacitor+infuxDB
[email protected]
--
Remember to include the InfluxDB version number with all issue reports
---
You received this message because you are subscribed to the Google Groups
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit
https://groups.google.com/d/msgid/influxdb/201609201035106520980%40aliyun.com.
For more options, visit https://groups.google.com/d/optout.