29.7. 클러스터 경고 구성 명령 예
다음 순차적 예제에서는 경고를 만들고 수신자를 추가하고 구성된 경고를 표시하는 데 사용할 형식을 표시하는 몇 가지 기본 경고 구성 명령을 보여줍니다.
클러스터의 각 노드에 경고 에이전트를 설치해야 하는 동안 pcs 명령을 한 번만 실행해야 합니다.
다음 명령은 간단한 경고를 만들고, 경고에 두 개의 수신자를 추가하고 구성된 값을 표시합니다.
-
경고 ID 값이 지정되지 않았으므로 시스템은 경고의
경고ID 값을 생성합니다. -
첫 번째 수신자 생성 명령은
rec_value의 수신자를 지정합니다. 이 명령은 수신자 ID를 지정하지 않으므로alert-recipient값은 수신자 ID로 사용됩니다. -
두 번째 수신자 생성 명령은
rec_value2의 수신자를 지정합니다. 이 명령은 수신자에 대한my-recipient의 수신자 ID를 지정합니다.
# pcs alert create path=/my/path
# pcs alert recipient add alert value=rec_value
# pcs alert recipient add alert value=rec_value2 id=my-recipient
# pcs alert config
Alerts:
Alert: alert (path=/my/path)
Recipients:
Recipient: alert-recipient (value=rec_value)
Recipient: my-recipient (value=rec_value2)
다음 명령은 해당 경고에 대한 두 번째 경고 및 수신자를 추가합니다. 두 번째 경고의 경고 ID는 my-alert 이고 수신자 값은 my-other-recipient 입니다. 수신자 ID가 지정되지 않았으므로 시스템은 my-alert-recipient 의 수신자 ID를 제공합니다.
# pcs alert create id=my-alert path=/path/to/script description=alert_description options option1=value1 opt=val meta timeout=50s timestamp-format="%H%B%S"
# pcs alert recipient add my-alert value=my-other-recipient
# pcs alert
Alerts:
Alert: alert (path=/my/path)
Recipients:
Recipient: alert-recipient (value=rec_value)
Recipient: my-recipient (value=rec_value2)
Alert: my-alert (path=/path/to/script)
Description: alert_description
Options: opt=val option1=value1
Meta options: timestamp-format=%H%B%S timeout=50s
Recipients:
Recipient: my-alert-recipient (value=my-other-recipient)
다음 명령은 my-alert 경고 및 수신자 에 대한 경고 값을 수정합니다.
my-alert -recipient
# pcs alert update my-alert options option1=newvalue1 meta timestamp-format="%H%M%S"
# pcs alert recipient update my-alert-recipient options option1=new meta timeout=60s
# pcs alert
Alerts:
Alert: alert (path=/my/path)
Recipients:
Recipient: alert-recipient (value=rec_value)
Recipient: my-recipient (value=rec_value2)
Alert: my-alert (path=/path/to/script)
Description: alert_description
Options: opt=val option1=newvalue1
Meta options: timestamp-format=%H%M%S timeout=50s
Recipients:
Recipient: my-alert-recipient (value=my-other-recipient)
Options: option1=new
Meta options: timeout=60s
다음 명령은 경고 에서 my-alert-recipient 수신자를 제거합니다.
# pcs alert recipient remove my-recipient
# pcs alert
Alerts:
Alert: alert (path=/my/path)
Recipients:
Recipient: alert-recipient (value=rec_value)
Alert: my-alert (path=/path/to/script)
Description: alert_description
Options: opt=val option1=newvalue1
Meta options: timestamp-format="%M%B%S" timeout=50s
Recipients:
Recipient: my-alert-recipient (value=my-other-recipient)
Options: option1=new
Meta options: timeout=60s
다음 명령은 구성에서 myalert 를 제거합니다.
# pcs alert remove myalert
# pcs alert
Alerts:
Alert: alert (path=/my/path)
Recipients:
Recipient: alert-recipient (value=rec_value)