createalert 関数はカスタムアラートを作成し、postalert 関数はアラートを送信します。createalert 関数は、スクリプトまたはワークフローから呼び出すことができます。postalert 関数は、ワークフローから呼び出す必要があります。ワークフロー内からのカスタムアラートの作成および送信を参照してください。
createalert([{'handler': 'syslog', 'args': {}}], {description: 'Writes to syslog'});
戻り値は、アラートを送信するために必要です。postalert 呼び出しがこのスクリプトに表示されていますが、postalert はワークフローで発生するイベントに対する応答として、ワークフロー内から呼び出される必要があります。
script
("." to run)> var actions = [{
("." to run)> handler: 'email',
("." to run)> args: {
("." to run)> address: 'admin@example.com',
("." to run)> subject: 'Custom Alert Response'
("." to run)> }
("." to run)> }];
("." to run)> var params = {
("." to run)> severity: 'Minor',
("." to run)> description: 'Custom alert description',
("." to run)> response: 'What the alert action does',
("." to run)> impact: 'What happened to the appliance',
("." to run)> recommended_action: 'What the administrator should do'
("." to run)> };
("." to run)> var cuuid = createalert(actions, params);
("." to run)> print(cuuid);
("." to run)> var puuid = postalert(cuuid);
("." to run)> .
54c24732-b9c5-4b57-9aee-aeaf195afdae