Configuration MAI on non Windows servers

Intro

If your SAP Solution Manager does not runs on a Windows server, the configuration for cmWatcher is a little bit other as described in the cmWatcher manual.

Because it is not possible to pass the alerts directly from the SAP system to the cmWatcherMAI2SCOM tool, the alerts must be stored in a shared folder which is accessible from the SAP Solution Manager server and the server where the cmWatcher is installed. Then, the SAP system can save the alerts in the folder and the cmWatcher can take them from there.

Solution

Create a new shared folder and mount it to your SAP Solution Manager server.
In our example, we call the folder cmWatcherShare. The folder contains a subfolder called alerts and a file maiscript.sh with the following content:

#!/usr/bin/sh
 filename=$1
 shift
 echo $@ >> /cmWatcherShare/alerts/$filename

The script has the following function: It takes two parameters. The first is the file name and the second is the content of the file. The script creates in the folder alerts a file with the given file name and the content.

If you have not yet configured the connection to the database for the cmWatcher open its programs folder and execute cmWatcherMAI2SCOM.exe.
The form for providing the database settings will appear. Fill out the form and click Connect.

Log on to Solution Manager using SAPGui, open transaction SM49 (External Operating System Commands) and create a new entry. Set the command name and the path to the maiscript.sh. Option Additional Parameters Allowed must be checked.

MAI_NonWin_CreateExternalCommand

Configure your SAP system as described in guide HOW-TO GUIDE OS Command Adapter.pdf. In section 3.1.1 of this guide set the external command which we have just created.

Section 3.1.2 (OS Command Parameters) describes how to configure the parameters for:

Configuration ID Extra key combination
MAI_OS_CMD_CONFIG CONFIG_TYPE = PARAMETERS ; FILTER_VALUE = OS_CMD_REACT
MAI_OS_CMD_CONFIG CONFIG_TYPE = PARAMETERS ; FILTER_VALUE = OS_CMD_REACT_CLOSE

Download the file CmWatcherMAIConfig_NonWin.xml from this post, open it and scroll down to the bottom. You will find an entry similar to:

<AGS_SISE_GS_S_KEY_VALUE>
  <NAME>01;$$</NAME>
     <VALUE>[MAI:ALERT:ID][MAI:ALERT:DATE][MAI:ALERT:TIME][MAI:ALERT:REASON_FOR_CLOSURE].txt
     [MAI:ALERT:MO_NAME]|[MAI:ALERT:MO_TYPE]|[MAI:ALERT:ID]|[MAI:ALERT:DATE]|[MAI:ALERT:TIME]|
     [MAI:ALERT:NAME]|[MAI:ALERT:TECHNICAL_NAME]|[MAI:ALERT:DESCRIPTION]|[MAI:ALERT:CATEGORY]|
     [MAI:ALERT:RATING]|[MAI:ALERT:SEVERITY]|[MAI:ALERT:STATUS]|[MAI:ALERT:REASON_FOR_CLOSURE]|SID</VALUE>
  <IS_SECURE />
</AGS_SISE_GS_S_KEY_VALUE>

Replace SID with the system ID of your SAP system and save the changes.

Now return to the browser as described in section 3.1.2 and select configuration option:

Configuration ID Extra key combination
MAI_OS_CMD_CONFIG CONFIG_TYPE = PARAMETERS ; FILTER_VALUE = OS_CMD_REACT

Under Configuration details click View as XML to open the upload dialog. Click Browse, select the CmWatcherMAIConfig_1.xml file and click Perform upload. Repeat these steps for configuration option:

Configuration ID Extra key combination
MAI_OS_CMD_CONFIG CONFIG_TYPE = PARAMETERS ; FILTER_VALUE = OS_CMD_REACT_CLOSE

MAI_NonWin_OSCommandConfiguration

 

Configuration of cmWatcher

Open the cmWatcher GUI, go to tab SAP, select the respective entry and choose Modify Entry to open the SAP System Settings dialog. Go to tab SAP MAI and select option Enable MAI.

MAI_NonWin_SAPSystemSettings

Save the changes.

 

Create a scheduled Task for CmWatcherMAI2SCOM.exe:

Once we the Solution Manager creates the alert-files in the shared folder, we have to configure the CmWatcherMAI2SCOM tool to collect and store them into the database. For that we create a scheduled Task which executes our tool each x minutes.

 

Steps to create the scheduled task:

  • Open the Windows Task Scheduler and create a new task.
  • Enter a name for the task. If you selected Windows Authentication for the cmWatcher database connection, the user account with which the task will be executed must have privileges for the database.
    MAI_NonWin_TaskScheduler
  • Change to tab Triggers and create a new one. Set the options similarly tot he picture:
    MAI_NonWin_TSNewTrigger
  • Change tot ab Actions and click on New. Set the Action field to Start a program. For Program/script browse the cmWatcher program directory and choose cmWatcherMAI2SCOM.exe. In the field Add arguments set PATH <Path to alerts folder>. For Example: PATH \cmWatcherSharealerts
    MAI_NonWin_TSNewAction

 

The configuration is now complete.