Reply value for File not exists test
Reply value for File not exists test
Hi,
I have a slight problem with the "file not exists" test. It never has a reply value. This is problematic for me as it therefore makes charts unreadable.
Would it be possible to get it to reply "1" or "0" when the result is "OK" or "Bad"?
I have a slight problem with the "file not exists" test. It never has a reply value. This is problematic for me as it therefore makes charts unreadable.
Would it be possible to get it to reply "1" or "0" when the result is "OK" or "Bad"?
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
I think, you may utilize the following trick. For the particular "Folder/File Availability" test, you may enable "Tune up Reply value" option with the following expression:
Quote from the manual:
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
====================================
the following variables provide information about the file detected by Folder/File Availability test method
%FileName% Name of the file (variable is useful when you setup the test using wildcards in filename)
%FileSize% Size of the file
%FileTime% Modification time
====================================
Regards,
Max
Code: Select all
[%FileSize% mod (%FileSize%-1)]
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
====================================
the following variables provide information about the file detected by Folder/File Availability test method
%FileName% Name of the file (variable is useful when you setup the test using wildcards in filename)
%FileSize% Size of the file
%FileTime% Modification time
====================================
Regards,
Max
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Max,
I ran a little 'discovery' test of my own, thinking that you could use the %StatusID% variable to accomplish this. But there are two problems:
Are there any 'conversion functions' to convert a string variable to numeric/integer?
I haven't done any charting, but maybe, if this were working, you could chart based on the 'raw' %Status% or %StatusID%, by use of a 'Count' function.
There's also the %FailureIteration% varialble that's available, if that's of any use. Use that in your mod statement and, as long as it's failed more than once, you'll get the same result as using the %FileSize% variable.
And, because I know you're gonna ask, I tested with the v7.72 I'm running in my production environment.
I ran a little 'discovery' test of my own, thinking that you could use the %StatusID% variable to accomplish this. But there are two problems:
- The %StatusID% variable is interpreted as a string, so I can't 'Tune the reply' to give Wabiloo the 0 || 1 numeric reply that he's looking for, and (more troubling)
- I simply dropped the %StatusID% variable into the 'Tune up Reply' entry to see the result, and the value does not change, but remains '00' (not tested) no matter the current status.
Are there any 'conversion functions' to convert a string variable to numeric/integer?
I haven't done any charting, but maybe, if this were working, you could chart based on the 'raw' %Status% or %StatusID%, by use of a 'Count' function.

There's also the %FailureIteration% varialble that's available, if that's of any use. Use that in your mod statement and, as long as it's failed more than once, you'll get the same result as using the %FileSize% variable.
And, because I know you're gonna ask, I tested with the v7.72 I'm running in my production environment.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You are thinking in proper way, but you forgot about one thing. HostMonitor evaluates "Tune up reply" expression before status, reply and statistics counters are set. There are bunch of %SuggestedXXX% (%SuggestedStatus%, %SuggestedSimpleStatus%, etc.) variables that could be used in this case. However, there is no %SuggestedStatusId% variable. Probably, this variable will be added in future versions.greyhat64 wrote:I ran a little 'discovery' test of my own, thinking that you could use the %StatusID% variable to accomplish this. But there are two problems:Is this a bug?
- The %StatusID% variable is interpreted as a string, so I can't 'Tune the reply' to give Wabiloo the 0 || 1 numeric reply that he's looking for, and (more troubling)
- I simply dropped the %StatusID% variable into the 'Tune up Reply' entry to see the result, and the value does not change, but remains '00' (not tested) no matter the current status.
You may enclose variable into quotes, e.g. '900 Kb' is equivalent to 921600 but in this case it will not work because %StatusID% is undefuned.greyhat64 wrote:Are there any 'conversion functions' to convert a string variable to numeric/integer?
It makes sense. But it also will not work when %FailureIteration%== 1.greyhat64 wrote:There's also the %FailureIteration% varialble that's available, if that's of any use. Use that in your mod statement and, as long as it's failed more than once, you'll get the same result as using the %FileSize% variable.
greyhat64 wrote:And, because I know you're gonna ask, I tested with the v7.72 I'm running in my production environment.

Regards,
Max
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
There may be another way to accomplish this, but I'm would like to 'Tune up Reply' using a statement similar to:
(Example below does not apply directly to current thread - simply used to illustrate a point):In this case, both are 'Bad' results, I'm simply interested in tuning the reply, for use in an alert email subject line. This way I can use the same email profile for both situations.
(Example below does not apply directly to current thread - simply used to illustrate a point):
Code: Select all
If ([%SuggestedStatus% = 'Bad']) and [%CurrentStatusDuration_sec% < 14400] Then
[%Reply% ='ALARM!: %SuggestedReply%']
Else
[%Reply% ='PAST DUE ALARM!: %SuggestedReply%']
End If