More then a minute without recording

We record some data once a minute. I need to set up an alert that will go out when data is not recorded for more then a minute.

Example:

Look at time stamp of last record if more then 2 minutes ago send alert.

Can I use script or code here to subtract 2 minutes from current time stamp to verify?

You can create an Expression SQLTag or Expression Item in a group that is a SQL query looking for that lapse and alert on it. What database are you using so I can post an example?

If you are using a transaction group, you could create a DateTime DB tag, then add it as a read-only item to the group (read-only in this case only means it doesn’t get inserted into the database; they can be written to). Next, add a DateTime expression item (triggered if the group itself is triggered) with an expression of “now()” that writes to the read-only db tag item (under the expression items general properties, under Target Type, select other tag). The tag will then always hold the DateTime of the last group run. You can check that and alarm off of it using a DateDiff expression (might need another tag, I’m not sure off the top of my head if you can alarm on an expression itself).

Hope this helps,

Dan

Travis,

We are using MySQL.

Ok, so your SQL query will look something likeSELECT TIMESTAMPDIFF(MINUTE, t_stamp, CURRENT_TIMESTAMP) >= 2 FROM HistoryTable ORDER BY t_stamp DESC LIMIT 1When this value goes to 1 you can alert on it. Hope this helps.

Travis,

Thanks, I will get to playing with that more in the next couple days.

Jim