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