Hi, i have a variable in one of my Grafana’s dashboards and i have a row of panels that repeat itself with all the panel inside for every value of the dashboard variable. In every of these rows i have a panel that show the number of seconds passed from the last ping made by an agent installed in the client machine to my application. The problem is that the SQL code to retrive this information is made like that:
SELECT
now() AS time,
EXTRACT(EPOCH FROM now() - lastsuccessfullogin AT TIME ZONE 'Europe/Rome') AS value
FROM ${tenant:raw}.cpusers
WHERE name LIKE '%agent%'
AND lastsuccessfullogin IS NOT NULL
ORDER BY lastsuccessfullogin DESC
LIMIT 1;
I really want to put an alert for these panels that if the agent don’t ping since 1 day i fire the alert, but i don’t think is possible because the information of the last ping is contained inside the ${tenant:raw}.cpusers schema, so i have for every value of the variable i have a specific table dependent by the var name where i can find that information.