RemotelyAnywhere Monitoring Script Reference
Conditions
- DiskFreeSpaceUnder(<drive>, <amount>)
- Becomes true if there’s less than <amount> number of bytes free on <drive>.
- ProcUsageAboveFor(<usage>, <time>)
- Becomes true if the processor usage has been above <usage> for the time period specified in <time>.
- MemUsageAboveFor(<usage>, <time>)
- True if the memory usage is above the specified amount for the specified time.
- NetInUsageAboveFor(<net interface>, <usage>, <time>)
- True if the network input on the specified network interface has taken up more than the specified percentage of the available bandwidth of said interface for the amount of time specified.
- NetOutUsageAboveFor(<net interface>, <usage>, <time>)
- True if the network output on the specified network interface has taken up more than the specified percentage of the available bandwidth of said interface for the amount of time specified.
- CheckAnswer(<server:port>, <request>, <reply>, <time>)
- Connects to the server and port specified, sends a request, and waits for a reply. True if the connection is unsuccessful, there is no data received for the amount of time specified, or the response received from the server does not match the reply specified above.
- Small(<script name>)
-
Executes the Small script specified in the <script name> parameter. Becomes TRUE if the script returns a non-zero value, and becomes FALSE if the script returns with zero. The script must meet the following requirements:
- It has to be compiled and available in the RemotelyAnywhere installation directory.
- It must have a main function, and that function should return an integer value.
Parameters
- <drive>
- A drive specification, for example, “C:\\”
- <amount>
- Amount of memory or HD space. For example: 1,000,000 (bytes) or 128M (megabytes).
- <usage>
- A percentage of, for example, processor usage. E.g.: 90%
- <time>
- An amount of time. For example: 10s (10 seconds), 20m (20 minutes), 24h (24 hours).
- <net interface>
- A number identifying a network interface. You can see the list of network interfaces installed in the computer by going to . The first adapter in this list is adapter 1, the second is adapter 2, etc.
- <server:port>
- When querying a TCP/IP service, you must specify the server and the port to connect to. This can be in the form of a DNS name and a port number (such as “www.company.com:80”) or an IP address and a port number (such as “192.168.0.3:8888”).
- <request>
- When you query a TCP/IP service, you specify here what you want to send to the server. For example: “HEAD / HTTP/1.0”.
- <reply>
- When you query a TCP/IP service, you expect a reply to your request. RemotelyAnywhere will match the first few bytes of the response from the server against the reply you specify here.
- <string>
- An arbitrary string of characters enclosed by double quotes (“).
- <script name>
- The name of a compiled Small script, without the extension. Must be enclosed in double quotes. The script must have a main function.
Actions
- Log(<string>)
- Places the parameter in the RemotelyAnywhere.log file.
- SendMail(<string>, <string>, <string>)
- Sends an email to the recipient specified in the first parameter, with the subject specified in the second parameter. The contents of the email message are in the third parameter.
- SendMail(<string>, <string>, <string>, <string>)
- Sends an email to the recipient specified in the second parameter, with the subject specified in the third parameter. The contents of the email message are in the fourth parameter. The sender of the email is identified in the first parameter.
- SendMessage(<string>, <string>)
- Sends an administrative message to the user or computer specified in the first parameter. The contents of the message are specified in the second parameter.
- Execute(<string>)
- Executes a program or a batch file. The full path name of the program to be executed and any parameters (including optional output redirection) are specified in the sole parameter.
- Small(<script name>)
- Executes a Small script. The script must be compiled and must have a main function.
String Substitutions
When sending emails or administrative messages, it is necessary to include detailed information on the events that have caused the alert to be sent out. The following items, if placed in a string parameter, will be substituted with their associated value.
- [MACHINE]
- The name of the computer.
- [FREE_MBYTES]
- Free megabytes on a disk drive. Only has a value if the action follows a DiskFreeSpaceUnder condition.
- [TOTAL_MBYTES]
- Total megabytes on a disk drive. Only has a value if the action follows a DiskFreeSpaceUnder condition.
- [FREE_PERCENT]
- Percentage of free space on a disk drive. Only has a value if the action follows a DiskFreeSpaceUnder condition.
- [AVG_USAGE]
- Average usage.
- [MIN_USAGE]
- Minimum usage.
- [MAX_USAGE]
- Maximum usage. This, and the above two strings only have a value when the action follows one of these conditions: ProcUsageAboveFor, MemUsageAboveFor, NetInUsageAboveFor or NetOutUsageAboveFor.
- [ANSWER]
- The response received from the checked server in a CheckAnswer condition.
- [FILE <filename>]
- The contents of the specified file. For example, [FILE C:\\TEMP\\output.txt] will place the contents of the file C:\TEMP\output.txt in the string.
- [SMALL_RES]
- The return value from a Small script’s main function. It is of integer type. Only valid after a Small condition or a Small action.