Ideas on how to alert on this graph (photos of graph)


So I’m monitoring the last modified date of an important file (don’t ask), if it hasn’t updated for more than 48 hours then I’d like to get an alert. Or if that can’t be done then alert if there is a change.

I can’t work out how I’d create this. I’ve created many alerts before though.

I’m using Telegraf’s filestat plugin to send to InfluxDB the displaying here.

You can see Axis Y is the modified date and over the past 2 days the file has been modified around 6am (hard to see I know). The Axis X is a bit useless as it’s show a date, but it’s not really related to muh.

r/grafana - Ideas on how to alert on this graph (photos of graph)

This is the table view which I’m using too, but you can’t alert on this:

r/grafana - Ideas on how to alert on this graph (photos of graph)

Any ideas on how I can achieve this?

This is version 10 of Grafana.


I am not sure but maybe you could transform the date stamp into a float counter that tracks hours since modification.

I wonder if you can aggregate the data and do something like (this is not a real query)

SELECT Label_A, Label_B,…, last_modification FROM … WHERE TIME_NOW()-last_modification > 48h

This will give you the duration instead of the timestamp, and you can do alerting on it.

If you can (and are willing to) change from InfluxQL to Flux, this is pretty straightforward:

  1. store the LastModifiedDate as a timestamp
  2. create new column using map() function that calculates the value of CurrentTime - LastModifiedDate, where both of these values are a timestamp in milliseconds (see below)
  3. once the above query is working, paste into Grafana and set alert condition to be when the value in the new column > 172,800,000 Milliseconds

something like this:

currentTime = system.time()
|> map(fn: (r) => ({ r with uint(v: r._currentTime) - uint(LastModifiedDate)}))

Can you explain the change to Flux, I think this is the newer version of InfluxDB? I’m on 1.8.

Can I have this running in parallel so I don’t cause issues with all the other dashboards?

Also have you heard of Victoria Metrics? That looks like a nice upgrade too, but not sure if it would support my need on my question I’ve asked.