New Macro Variable

General chat about HostMonitor (all messages posted before March 07, 2003 available here).
Locked
genasea
Posts: 28
Joined: Wed Sep 25, 2002 6:00 pm

Post by genasea »

I have a need that allows me to look at the duration of outages from historical outage data generated by my advanced log database.

With the current set of macro variables, each time an entry is made into the database (using logs set to fire only upon status changes) the %StatusChangedTime% is the same time as the %DateTime% variable. This is since the current test timestamp is also the last time the status changed, so it is the same time.

So there is no timestamp associated with the previous statuschange (i.e. outage).

I would like to have an entry that looks like:

TestName - current date/time - last status date/time

based upon a single SQL Insert statement using the advanced logs option.

Would it be possible to have another macro variable that holds the timestamp associated with the %lastStatus%?

Thank you,

Scott
User avatar
Marcus
Posts: 367
Joined: Mon Nov 18, 2002 6:00 pm

Post by Marcus »

So there is no timestamp associated with the previous statuschange (i.e. outage).
This would be the previous entry in your database for the same test.

So retrieve the last test and the previous one and you know how long the test was bad (or good, depending on the current status of the test)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think we can add 2 new variables:
- %PreviousStatusDuration% - represent time interval in "[xx days] hh:mm:ss" format (e.g. "2 days 05:20:47")
- %PreviousStatusDuration_Sec% - display number of seconds (e.g. "7200")
What do you think?

Regards
Alex
Locked