예: 정규식을 사용하여 이벤트 정책 제어
다음 정책은 두 트랩(SNMP_TRAP_LINK_DOWN
및)의 interface-name
속성이 서로 일치하고 SNMP_TRAP_LINK_UP
트랩의 속성 SNMP_TRAP_LINK_DOWN
이 interface-name
문자t로 시작하는 경우에만 실행됩니다. 즉, 정책은 T1(t1-) 및 T3(t3-) 인터페이스에 대해서만 실행됩니다. 프로세스가 다른 인터페이스로부터 트랩을 수신할 eventd
때 정책이 실행되지 않습니다.
참고:
시스템 로그 파일에서 메시지 태그는 모든 대문자로 나타납니다. 명령줄 인터페이스(CLI)에서 메시지 태그는 모든 소문자 문자에 나타납니다.
[edit event-options] policy pol6 { events snmp_trap_link_down; within 120 events snmp_trap_link_up; attributes-match { snmp_trap_link_up.interface-name equals snmp_trap_link_down.interface-name; snmp_trap_link_down.interface-name matches "^t"; } then { execute-commands { commands { "show interfaces {$$.interface-name}"; "show configuration interfaces {$$.interface-name}"; } output-filename config.txt; destination bsd2; output-format text; } } }