Macro Variables date and time

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
sabine
Posts: 25
Joined: Wed Mar 07, 2007 6:22 am
Location: Austria

Macro Variables date and time

Post by sabine »

Hi,

1.) is it possible to use date & time macro variables for comparison with results from the ODBC/SQL Query?

2.) can I use wildcards (asterisks and so on) in a File Availability Check? File is named like this: fgh%yyyy%%mm%%dd%*.txt (the asterisk means hour, minute and second)

best regards,

sabine
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: Macro Variables date and time

Post by KS-Soft Europe »

sabine wrote:1.) is it possible to use date & time macro variables for comparison with results from the ODBC/SQL Query?
I am afraid, you cannot use date & time macro varivables in that way. However, you may use date & time variables within SQL query. I think, you may adjust the SQL query to use macro variables, e.g. you may use query:

Code: Select all

select count(*) where SomeDateTimeField = convert(datetime,'%mm%/%dd%/%yyyy%') 
(or something like that according to your SQL Server rules) and compare result with 0.
sabine wrote:2.) can I use wildcards (asterisks and so on) in a File Availability Check? File is named like this: fgh%yyyy%%mm%%dd%*.txt (the asterisk means hour, minute and second)
Yes, you may use wildcards within filename for a "Folder/File Availability" test. Please note, you have specified date & time macro variables within filename, you should enable "Translate Macros" option. http://www.ks-soft.net/hostmon.eng/mfra ... #fileexsts

Regards,
Max
sabine
Posts: 25
Joined: Wed Mar 07, 2007 6:22 am
Location: Austria

Post by sabine »

Hi Max,

the result from the sql query is a string (filename) formated like StringYearMonthDayHourMinuteSecond. Hour, Minute and Second are not current so I can't use them for comparison. Is there any other possibility to compare the current date with the first half of the query result?

Best regards

sabine
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

sabine wrote:the result from the sql query is a string (filename) formated like StringYearMonthDayHourMinuteSecond. Hour, Minute and Second are not current so I can't use them for comparison. Is there any other possibility to compare the current date with the first half of the query result?
In such case you do not need to use date and time macro variables at all. You should use Date and Time functions of the SQL Server instead. For instance, for MS SQL Server you may use query like the folowing:

Code: Select all

SELECT count(*)  from SomeTable WHERE SomeFileNameField LIKE 'String'+Convert(varchar,GetDate(),112)+'%'
Instead of 'String' you should specify real part of the filename. Convert(varchar,GetDate(),112) function returns you current date in yyyymmdd format. Please do not remove trailing '%'.

So, you may specify that query into "SQL query" input box and compare result it with 0.

Regards,
Max
sabine
Posts: 25
Joined: Wed Mar 07, 2007 6:22 am
Location: Austria

Post by sabine »

Hi Max,

i've got another problem, my Linux RMA seemed to be not able to handle asterisks in filenames. I want to perform a TextLog-Check on a Red Hat System and use daytime macro variables and wildcards in the filename. What's wrong?

Best regards

sabine
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

RMA for UNIX does not support wildcards for TextLog test method.
I have added new task into "to do" list. Medium priority

Regards
Alex
sabine
Posts: 25
Joined: Wed Mar 07, 2007 6:22 am
Location: Austria

Post by sabine »

Hi Alex,

does File Availability Check with Unix RMA support wildcards and daytime macros in filename?

Best regards
sabine
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is RMA for Linux version 1.24 at www.ks-soft.net/download/rma124_lini32.tgz
It supports wildcards for Folder/File Availability and Text Log test methods

PS Please use different topics for different questions.

Regards
Alex
sabine
Posts: 25
Joined: Wed Mar 07, 2007 6:22 am
Location: Austria

Post by sabine »

Hi al2gether,

thanks for helping me, now my system is nearly perfect configurated.

Best regards
sabine
Post Reply