Hi Team,
I am new to write the .tick scripts and stuck at certain point.
Create a influxdb database with 4 fields.
Files, Bytes, Duration, Target and by default time. Everyday there is
backup happening and this data will be filed everyday.
Scenario1: Need tick script. If there is no data for the past 3 days it
should trigger an alert in slack. Have write the basic script and seems its
not working.
var period = 2s
var every = 2s
var errors = batch
|query('select count(bytes) from "asgbackup"."autogen"."drive_info" where
time > now() - 7d')
.period(period)
.every(every)
|eval(lambda: "errors.count" < 80)
.as ('value')
|alert()
.id('{{ index .Tags "target" }},{{ index .Tags "bytes" }}')
.message('{{ .ID }} is {{ .Level}} value: {{ index .Fields "fields" }}
Values is zero')
.slack()
.crit(lambda:TRUE)
.log('/var/tmp/kapacitor/points.log')
1. How do I evaluate the count field in the eval().
2. Crit condition to satisfy that field.
3. from the influxdb how to print the "time" field.
Please suggest a solution and correct me in writing a tick scripts.
- Regards
Praveen Kumar G
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups
"InfluxData" 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/302e54be-0a2e-4e46-9069-87dccafed16f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.