Дописал про Алерты)
Неплохо =)
добавил картинки настроек
немного подкрутил ситуацию:
чтобы были первоначальные значения и последние на графики нужно их добавить через unuion
далее по id общаться не удобно. проще по названию: что получилось:
(SELECT
$unixEpochFrom() as time_sec,
pvalues.property_name as "metric",
(phistory.VALUE+0.0) as value
FROM phistory
JOIN pvalues
ON pvalues.id = phistory.VALUE_ID
WHERE (phistory.ADDED
)<$__timeFrom() and pvalues.PROPERTY_NAME in ('$tname.VALUE')
ORDER BY phistory.ADDED
limit 1)
union
(SELECT
$unixEpochFrom() as time_sec,
pvalues.property_name as "metric",
(phistory.VALUE+0.0) as value
FROM phistory
JOIN pvalues
ON pvalues.id = phistory.VALUE_ID
WHERE (phistory.ADDED
)<$timeFrom() and pvalues.PROPERTY_NAME in ('$tname.currentTargetValue')
ORDER BY phistory.ADDED
limit 1)
union
(SELECT
$time(phistory.ADDED
),
pvalues.property_name as "metric",
(phistory.VALUE+0.0) as value
FROM phistory
JOIN pvalues
ON pvalues.id = phistory.VALUE_ID
WHERE $timeFilter(phistory.ADDED
) and pvalues.PROPERTY_NAME in ('$tname.currentTargetValue','$tname.VALUE')
ORDER BY phistory.ADDED
)
union
(SELECT
$unixEpochTo() as time_sec,
pvalues.property_name as "metric",
(phistory.VALUE+0.0) as value
FROM phistory
JOIN pvalues
ON pvalues.id = phistory.VALUE_ID
WHERE (phistory.ADDED
)<$timeTo() and pvalues.PROPERTY_NAME in ('$tname.VALUE')
ORDER BY phistory.ADDED
DESC limit 1)
union
(SELECT
$__unixEpochTo() as time_sec,
pvalues.property_name as "metric",
(phistory.VALUE+0.0) as value
FROM phistory
JOIN pvalues
ON pvalues.id = phistory.VALUE_ID
WHERE (phistory.ADDED
)<$timeTo() and pvalues.PROPERTY_NAME in ('$tname.currentTargetValue')
ORDER BY phistory.ADDED
DESC limit 1)
Чтобы встроить как домашнюю страницу в МЖД, нужно в конфиге указать
allow_embedding = true
Please login to leave comments. Join us!