Enter a variable name, in the form #var_name#
, in the space provided. checkVar() evaluates the current values assigned #var_name#
and compares it with the supplied value. The supplied value may also be another variable name in the form of #var_name2#
. If the check is true, IF commands are executed. If the check is false, ELSE steps are executed. See Using Variables. The available tests are:
Exists
: true if the variable exists. Note: If this test is run on a managed variable, this step will fail for all machine groups that don’t have a value specified for the managed variable. An error message will display in the agent procedure log, stating Script Variable Not Found
.
Does Not Exist
: true if the variable does not exist.=
: true if value of the variable equals the test value.Not =
: true if value of the variable does not equal the test value.>
: true if value of the variable is greater than the test value.>=
: true if value of the variable is greater than or equal to the test value.<
: true if value of the variable is less than the test value.<=
: true if value of the variable is less than or equal to the test value.Contains
: true if the test value is a sub string of the variable value.Not Contains
: true if the test value is not a sub string of the variable value.Begins With
: true if the variable value begins with the test value.Ends With
: true if the variable value ends with the test value.For the tests =
, Not =
, >
, >=
, <
, and <=
the variables compared may be a string, a number, a date in the format of yyyy/mm/dd
or yyyy/mm/dd hh:mm
or yyyy/mm/dd hh:mm:ss
, or a version number containing dots or commas such as 1.2.3
or 4,5,6,7
. Values in variables are stored as strings, so compared numbers must be of equal string length. If a date format is specified, it may be offset using + dd:hh:mm:ss
or - dd:hh:mm:ss
. Only dd
days are required; hh
hours, mm
minutes, and ss
seconds may be omitted and are assumed to be zero when absent. CURRENT_TIMESTAMP
may be specified to indicate that the current time be substituted in the comparison at the time the procedure is executed. e.g. CURRENT_TIMESTAMP - 7:12:00:00
will be evaluated as 7 days and 12 hours subtracted from the time that the procedure is executed.
Example - Sample Procedures.Managed Services.Network Tests.Ping IP Address 2
If checkVar("#pingtest#") Does Not Contain "Lost = 0"