Commands
The Commands feature of SysManX is very flexible and powerfull. It allows you to configure a number of SMS commands that can be executed on the server by simply sending SMS messages to SysManX starting with specific keywords. In addition to a predefined set of Commands, you can also create your own scripts or executable and run from SysManX.
The Commands are managed from the Commands menu found under Settings and is accessible by users with the Administrator role only.
The screenshot above shows an example of a set of SMS commands that can be configured.
To add a new Command, click the Add new command button at the bottom. To edit an existing Command, click on Edit for the given command.
For each command you must specify a Keyword which is a single word that the SMS message must start with to execute the command. The Keyword must be unique for each command. You may set up as many Keywords as you like for each command. You may for example set up both "ON" and "IN" as Keywords for the Command On.
Available Commands
- WHO - If command is sent without any parameters it will return a message showing the Numberlists the sender is active in, and which the sender is not active in. If a name of a Numberlist precedes the command keyword, it will return a list of those who are active in the Numberlist with that particular name.
- ON - Will set the sender active in all Numberlists where the sender is registered. If a name of a Numberlist precedes the command keyword, the sender will only be set active in that particular Numberfile.
- OFF - Will set the sender in-active in all Numberlists where the sender is registered. If a name of a Numberlist precedes the command keyword, the sender will only be set in-active in that particular Numberfile.
- SEND - Will send a message to a given Numberlist. The name of the Numberlist can be set as the parameter, or it can precede the command keyword before the message to send. Original sender number/name can be included in forwarded message.
- ECHO - Will reply back the text specified as the parameter.
- MAILFORWARD - Will forward the message preceding the command keyword to an e-mail address given as the parameter.
- MAILFORWARDWITHREPLYPATH - Will forward the message to the e-mail address that most recently sent a message to that number.
- HTTPFORWARD - Will forward the message to a Url given as the parameter. The request is a www-urlform-encoded and the parameters are named "sender", "keyword" and "text".
- ALARM - Will trigger an alarm to receiver or Numberlist given as parameter after a given time has elapsed.
- RUNPROCESS - Will execute the batch file or executable given as parameter, and return the resulting output to the sender. Both the sender number and message text will be provided as command line arguments to the process executed.
- SERVICESTART - Will start a Windows Service on the server. The name of the Windows Service can be set as the parameter, or it can precede the command keyword.
- SERVICESTOP - Will stop a Windows Service on the server. The name of the Windows Service can be set as the parameter, or it can precede the command keyword.
- VCF - Will allow you to set, clear and query voice call forwarding. If no number precedes the keyword, it will clear/remove any voice call forwarding. If a number precedes the keyword, forwarding will be set to that number. To query the current voice call setting, put the word status after the keyword (with a space between the keyword and status).
Some commands may have an additional parameter that can be set, such as a reply text, a Numberlist or a script to be executed.
- STEP - Used to acknowledge an alarm message sent using the Step-by-Step Numberlist feature.
- STORMRESET - Used to reset the Message Storm database. Specify the number to reset after the keyword, or "all" to reset every number. If you send only the keyword, the service will reset the Message Storm databaser for the sender number.
For each command you may set the authorization level required to execute the command. If this is set to Users or Administrators only, then the sender number must match the number of a user with a sufficient role in order to be executed. If the sender is not allowed, the command will not be run and the attempt will be logged.
Default Command execution
If you want to create a command to handle all messages that do not match a specific Keyword (a catch all Command), you can create a Command with a blank (empty) Keyword. This Command will then be executed if no other Keyword matches. A typical usage is to create an ECHO command that returns a text like "We could not find a service matching your keyword."
Running custom processes
The ability to run any batch file or executable from SysManX is very powerfull, but must also be handled with care to avoid potential execution of dangerous commands. We recommend that any such commands are restricted to users with Administrator role only.
Example show_time.bat that returns the current time on the server.
@echo OFF
@echo The time is %time%
Note that the processing of messages will halt while waiting for the custom process to complete. Make sure that your custom process does not take too long time to complete.