DM スクリプトに基づくカスタム アラートを作成できます。 これらのアラートに関連する設定を適用する前のエージェント マシンで、スクリプト ディレクトリ([設定ポリシー]-[DSM]-[ヘルス監視]-[ヘルス監視エージェント]-[ScriptDir]で設定される)にスクリプトを展開します。
次の手順に従ってください:
DM スクリプト アラートの例:
以下の DM スクリプトは、hmAlertOPFormatter を呼び出すことにより、アラート条件があるかないかを HM エージェントにレポートします。 例:
'Do your alert condition checking here.
'...
' At bottom of your DM script, execute hmAlertOPFormatter
' to create the alert XML output.
dim ret as integer
ret = Exec("hmAlertOPFormatter.exe alertconditionexist=1 raisealertnow=1 ""param1=" + argv(1) + ",param2=" + argv(2) + """ additionalinfo=this is some additional text for script with Args", true)
print "hmAlertOPFormatter.exe: " + str(ret)
アラートを監視するために呼び出されたきに HM エージェントが処理する XML ファイルを作成するには、DM スクリプトで以下のコマンドを実行します。
hmAlertOPFormatter 実行可能ファイル
hmAlertOPFormatter.exe alertconditionexist=0|1 [raisealertnow=0|1] [PARAM1=data1,PARAM2=data2,..,PARAMX=datax] [additional info=Additional Info] alertconditionexist=0|1
DM スクリプトがアラート条件を決定していない場合は値 0 を使用します。 DM スクリプトがアラート条件を決定している場合は値 1 を使用します。
raisealertnow=0|1
(オプション)デフォルト値は 0 です。 アラートをすぐに生成する場合は値 1を使用します。
PARAM1=data1,PARAM2=data2 .. PARAMX=datax –
(オプション)これらのキー値のペアは、アラート メッセージ内のパラメータと値を示します。 一連のキー値ペアはカンマ(,)によって区切り、キーと値は等号(=)によって区切ります。
additionalinfo=<Additional Info>
(オプション)このパラメータは、コマンド ラインの最後のパラメータです。 等号(=)より後ろの残りのコマンド ラインはすべてまとめられ、生成されるアラート XML の 1 つのフィールドを形成します。
DM スクリプトに基づくカスタム レメディエーション スクリプトを作成できます。 このレメディエーション スクリプトを使用するアラートを設定する前のエージェント マシンで、スクリプト ディレクトリ([設定ポリシー]-[DSM]-[ヘルス監視]-[ヘルス監視エージェント]-[ScriptDir]で設定される)にスクリプトを展開します。
以下の手順に従います。
DM スクリプト レメディエーションの例:
以下の DM スクリプトは、hmAlertOPFormatter を呼び出すことにより、修復が成功したかどうかを HM エージェントにレポートします。 例:
dim remediationStatus as string
dim validate as string
dim remediationInfo as string
dim ret as integer
dim commandline as string
'Do your remediation here.
'...
'Set the value of remediationStatus to either 0 or 1. 0 は成功したレメディエーションを、1 は失敗したレメディエーションを表します
'Set the value of remediationInfo to any string that you want to displayed in WAC for this remediation. IDS_REM_SUCCESS および IDS_REM_FAILURE はそれぞれ成功および失敗を表すために使用できる標準的な文字列 ID です。
'Set valudate to 1 if alert validation is required post remediation or 0 otherwise
' At bottom of your DM script, execute hmAlertOPFormatter
' to notify HM Agent about the status of remediation.
If left(osstring, 3) = "Win" Then
commandline = "hmAlertOPFormatter.exe"
Else
commandline = "hmAlertOPFormatter"
Endif
commandline = commandline + “ statuscode=” + remediationStatus + “ validate= “ + validate + “ statusmsg=” + remediationInfo
ret = Exec(commandline, TRUE, 0)
レメディエーションのステータスに関してヘルス監視エージェントに通知するには、DM スクリプト内で以下のコマンドを実行します。
hmAlertOPFormatter 実行可能ファイル
hmAlertOPFormatter.exe statuscode=0|1 validate=0|1 statusmsg=”<Any string>” stauscode=0|1
レメディエーションが成功した場合は、値 0 を使用します。 レメディエーションが失敗した場合は、値 1 を使用します。
Validate=0|1
レメディエーションにより実際にその問題が修正されたかどうかを確認するために検証を実行する必要がない場合、値 0 を使用します。 レメディエーションの後でもアラート条件が残っている場合に検証およびレメディエーション失敗メッセージのレポートを実行するようにヘルス監視エージェントに通知するには、1 を使用します。
statusmsg
(オプション)レメディエーションのステータスを表す文字列メッセージ。
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|