If Ping Successful

 

This option first attempts to ping the server designated. If the server responds within the specified time frame, then the result will be true.

 

 

Script Editor > Expand Logic Category > If Ping Successful

 

 

IP Address/Hostname

Insert the IP Address or website to ping. Do not include modifiers such as http:// or ftp://. If pinging our Macro Express web site, insert www.macros.com.

 

 

Seconds to Wait for a Response

Insert the number of seconds to wait before determining if the ping is successful.

 

 

Don't process embedded variables

When using a variable in the address field, this option ignores any % signs found within the variable value and will not attempt to treat the % signs as an embedded variable. It will just expand the % sign as a standard character during macro runtime.

 

 

Example

Assume for example a variable of %T[1]% with a value of www.%DomainName%.com
 

1. With this option selected, the macro will ping the site found at www.%DomainName%.com
 

2. If the option is not selected, then the macro will assume that there is a variable of %DomainName% and look to expand its value.


a. If the variable %DomainName% does not exist, then the macro will generate an error because it could not find the value for this variable.

b. Otherwise it will expand the value of %DomainName% within the main variable.

 

 


 

 

Example

Below is a simple example of how to use this command. The macro is pinging the www.macros.com site to make sure that the server is running.

 

- If the ping is successful a message is logged to the ping.log file with a date and time stamp.

- If the server is down and the ping was not successful, an email is sent for someone to look into the problem.

 

This could be set up as a scheduled macro to run every 30 or 60 minutes.

 

 

Sample Macro

 

If Ping Successful: "www.macros.com"

  Log Message to "ping.log"

Else

  E-Mail Send: Know Recipients, Fixed Text, No Attachments

End If