Configure and run the Command Line Interface (CLI) Utility
The PuzzleLogic Command Line Interface (CLI) Utility is accessed through the sendplmsg.py script that is packaged in the PuzzleLogic Agent archive file agent-XXXXXX.tar.gz.
IMPORTANT: The CLI Utility requires Python 2.6.x or 2.7.x and the Python "requests" module. You can use the command
sudo pip install requests to install the Python module.
Configure the PuzzleLogic CLI Utility
- Navigate to the directory where you extracted the PuzzleLogic Agent archive file; for example ~< PL_Agent_directory >/plviewer-agent-XXXXXX.
- Open the application.properties file (located in the /bin subdirectory) in a text editor and modify the severity mappings located in the Severity to Priority Mappings section of the file. For each data source, the severity values must be mapped to one of the valid values used by Service Advisor: Low, Medium, High, or Critical.In the example below, the values (warning, minor, major and critical) listed on the left side of the equal sign are values from a data source; those on the right side (Low, Medium, High or Critical) are the values used by PuzzleLogic Service Advisor. Note that the severity values used by PuzzleLogic Service Advisor must be capitalized.
If the data source has severity values of informational, success, warning, error, and failure, the mapping might look like the following. Note that you can map multiple values to the same PuzzleLogic value, if needed.
- (Optional) Modify the port that the Agent will use to listen on, if needed. By default, the Agent uses port 8083. If you wish to use a different port, add the following line to the application.properties file:
server.port= <port number>
- Re-start the PuzzleLogic Agent.
$ ./agent.sh start
Run the PuzzleLogic CLI Utility
IMPORTANT: Make sure the PuzzleLogic Server and PuzzleLogic Agent have been be properly installed and configured before you run the CLI Utility.
To import a message with the CLI Utility, run the sendplmsg.py script with the parameters listed in the table below:
NOTE: Use the --help (-h) option to display help for using the CLI Utility. Always use proper quoting per shell convention to enclose parameter values.
$ sendplmsg.py --source=“IBM Tivoli Netcool” --type=“event” --summary=“This is a test event from Netcool.” --severity=“WARNING” --attributes=“region='CA', hostip='10.10.10.10'” --status=“open” --timestamp="1416529249000"
$ sendplmsg.py -s “IBM Tivoli Netcool” -t “event” -m “This is a test event from Netcool.” -v “WARNING” -a “region='CA', hostip='10.10.10.10'” –u “open” -c "1416529249000"
|--source (-s)||System or tool that the event is generated from.||String||Y|
|-- type (-t)||Type of message.
Valid values: Event, Log, Incident, Problem, or Change
|--summary (-m)||Summary of the event that occurred.||String||Y|
|--objectname (-n)||Name of the CI or service the event is associated with.
In order for the event to be associated with the CI, the name of the CI must match what is on record in PuzzleLogic Service Advisor.
|--id (-i)||Unique identifier of the event from the data source.||String||N|
|--details (-d)||Detailed description of the event that occurred.||String||N|
|--severity (-v)||Level of severity. The severity values from each data source needs to be mapped to the appropriate PuzzleLogic Service Advisor values (Low, Medium, High or Critical) in the application.properties file.||String||N|
|--status (-u)||Event status.
Valid values: Open, Completed, Cancelled or Closed.
|--timestamp (-c)||Timestamp of when the event occurred. Measured in milliseconds from 1/1/1970 00:00:00.||Integer||N|
|--attributes (-a)||String composed of key/value pairs separated by commas.
Attributes appear in the Details field of the message.