Go to main content

Oracle® ZFS Storage Appliance 관리 설명서, 릴리스 OS8.8.x

인쇄 보기 종료

업데이트 날짜: 2021년 8월
 
 

사용자정의 경보 함수 사용

createalert 함수는 사용자정의 경보를 만들며, postalert 함수는 경보를 게시합니다. createalert 함수는 스크립트 또는 워크플로우에서 호출할 수 있습니다. postalert 함수는 워크플로우에서 호출해야 합니다. 워크플로우 내에서 사용자정의 경보 만들기 및 게시를 참조하십시오.

  1. 다음 함수 호출은 최소 사용자정의 경보를 만듭니다.
    createalert([{'handler': 'syslog', 'args': {}}], {description: 'Writes to syslog'});
  2. 다음 스크립트는 추가 매개변수를 지정하고 반환 값을 캡처합니다.

    경보를 게시하려면 반환 값이 필요합니다. 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