I thought I had posted this yesterday, but I can't find it.
I have a macro in Outlook that monitors a "heartbeat" from a reporting system and alerts IT maintenance people in an escalating fashion when the system has been down for 30, 60 and 120 minutes.
The way it works is that the reporting system sends an email to a common mailbox every 15 minutes with the key word, "Heartbeat" in the subject. A filter rule shuttles this to a specific folder that is monitored by this macro. The macro opens the mailbox periodically. If there is no mail, it goes back to sleep. If there is mail, it gets the dates sent and writes them to a log file (an Excel spreadsheet). The Excel spreadsheet computes the difference between NOW() and the latest sent time in minutes.
The macro reads this figure and triggers an alert if over 30 minutes and no "level 1" alerts have already been issued. It writes "1" to a cell in the Excel Logbook. So when it wakes up again 5 minutes later, it doesn't send another level 1 alert. At 60 minutes a similar process happesn and the logged alert level is now set to to 2 and the same thing happens at level 3 at 120 minutes.
If anywhere along the line, the system is fixed then a new message comes in with a recent date stamp, the alert level is set back to zero and the heartbeat monitor is reset.
I have this working as a prototype using Excel to launch the macro. I anticipate that I can port it to Outlook without issue.
I am wondering if there is a way to do away with the Excel Log file and somehow store the latest send date and alert level in Outlook.
Attached is my Excel prototype. Email addresses were changed to protect the innocent.![]()
Bookmarks