How to use "+1 hour" in using %hh% and %nn% syntax

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
grantqa
Posts: 7
Joined: Mon Aug 04, 2008 12:03 pm
Location: London

How to use "+1 hour" in using %hh% and %nn% syntax

Post by grantqa »

Hello,
I am wondering why my personal logic is not working extending the concept

filename_%yyyymmdd[-1d]%_name.txt

for a filename such as

filename_20080804_name.txt when the current date is 5th August 2008

for a filename that uses time, such as

filename_%hh[+1h]nn%_name.txt

where filename_1030_name.txt is a file generated at 09H30 with 1 hour added to make the file of a name for a different timezone
1 hour ahead of local time

Am I misunderstanding by using %hh[+1h]nn% please?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Quote from the manual
to subtract a number of days from current date, use expression like [-NNd] (e.g. %dd[-1d]%)
to add a number of days to current date, use expression like [+NNd] (e.g. %ddd[+22d]%)
to subtract a number of months from current date, use expression like [-NNm] (e.g. %dm[-24m]%)
to add a number of month to current date, use expression like [+NNm] (e.g. %ddmm[+1m]%)
to subtract a number of years from current date, use expression like [-NNy] (e.g. %dmyy[-2y]%)
to add a number of years to current date, use expression like [+NNy] (e.g. %ddmmyyyy[+10y]%)
Sorry, there is no option for hours. May be we can implement such option in future versions...
Probably you can use wildcards? What test method do you use?

Regards
Alex
grantqa
Posts: 7
Joined: Mon Aug 04, 2008 12:03 pm
Location: London

Post by grantqa »

I am using "File Availability" method.
Perhaps I can test using filename_*_name.txt with test every 8 minutes to check that the file is not older than 5 minutes (the file is generated every 5 minutes). What do you think?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If there are other files in the folder, such method will not work because HostMonitor will check 1st file that matches the filter.
You should use Count Files test method instead. It offers "Count files newer than N minutes" option

Regards
Alex
ironcurtain
Posts: 34
Joined: Mon Apr 28, 2008 10:15 am

Post by ironcurtain »

Thank you Alex for the very prompt and helpful advice!

I think I have this right, but just to be sure I have included the test here:

Method = CountFiles
;--- Common properties ---
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 300
Alerts =
ReverseAlert= Yes
UnknownIsBad= Yes
WarningIsBad= Yes

;--- Test specific properties ---
Folder = \\directory\path\
Mask = *_filename.xml
UseMacros = No
CountMode = NewerThan
CountValue = 6
FilesLimit = 0

The test logic I am after is:
Every 5 minutes count the number of files newer than 6 minutes and alert if none exist.

Have I got this right, please?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, settings look fine

Regards
Alex
Post Reply