Example Notification From a Command Line Program
The following is a simple example of a command line notifier. This notifier does the following:
- Calls a Python script located in the Intermapper Settings\Tools folder.
-
Passes the following script parameters:
- The notification message, using the ${MESSAGE} macro.
- A log file filename.
- The script opens the specified file (also located in the Tools folder) and appends the message text to it.
Log.py Script
Place the following script in the Tools folder in a text file called log.py:
# options are: message logfile
if __name__ == '__main__':
f = open(sys.argv[2], 'a+')
f.write(sys.argv[1]+'\n')
f.close()
Configuring the Command Line Notifier
To configure a new notifier:
- Create a new notifier.
- Set the Type to Command Line.
-
Enter the following text in the Command text box:
${PYTHON} log.py "${MESSAGE}" test.log
- Edit the message and schedule as needed.
- Click Test Notifier Configuration.
- Attach the notifier to one or more devices as described in Attaching_A_Notifier.htm.
When the notifier runs, a file named test.log is created in the Tools folder. Message text is appended to the log file.
Copyright Help/Systems LLC and its group of companies. The content in this document is protected by the Copyright Laws of the United States of America and other countries worldwide. The unauthorized use and/or duplication of this material without express and written permission from HelpSystems is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to HelpSystems with appropriate and specific direction to the original content. HelpSystems and its trademarks are properties of the HelpSystems group of companies. All other marks are property of their respective owners.