/*
	This file contains some sample policy-statements.

	Note to VIM users: this file should have syntax highlighting; enable with (:syntax on).
*/

#include "@resolved_sysconfdir@/format-statements.conf"
#include "@resolved_sysconfdir@/map-statements.conf"

policy-options {
	policy-statement NETSNMP_TRAP {
		term NOTIFY_RESTART {
			from {
				protocol snmptrap;
				event		snmp:nsNotifyRestart;
			}
			then {
				apply-map SOURCE_TO_ELEMENT_DATA_MAP;
				set state information;
				output {
					gui {
						brief		"NET-SNMP daemon restarted";
						detail	"The NET-SNMP daemon on @snmp:sysName.0@ (@source@) is restarting.";
						channel	software;
					}
					syslog {
						detail	"@snmp:sysName.0@: NET-SNMP daemon is restarting";
						channel	software;
					}
				}
				accept;
			}
		}
		term NOTIFY_START {
			from {
				protocol snmptrap;
				event		[ snmp:nsNotifyStart snmp:ucdStart ];
			}
			then {
				apply-map SOURCE_TO_ELEMENT_DATA_MAP;
				set state information;
				output {
					gui {
						brief		"NET SNMP daemon has started.";
						detail	"The NET-SNMP daemon on @snmp:sysName.0@ (@source@) has started.";
						channel	software;
					}
					syslog {
						detail	"@snmp:sysName.0@: NET-SNMP daemon has started";
						channel	software;
					}
				}
				accept;
			}
		}
		term NOTIFY_SHUTDOWN {
			from {
				protocol snmptrap;
				event		[ snmp:nsNotifyShutdown snmp:ucdShutdown ];
			}
			then {
				apply-map SOURCE_TO_ELEMENT_DATA_MAP;
				set state information;
				output {
					gui {
						brief		"NET-SNMP daemon shutdown";
						detail	"The NET-SNMP daemon on @snmp:sysName.0@ (@source@) has shutdown.";
						channel	software;
					}
					syslog {
						detail	"@snmp:sysName.0@: NET-SNMP daemon has shutdown.";
						channel	software;
					}
				}
				accept;
			}
		}
		apply-format SNMPTRAP_FORMAT;
	}
}

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim600: fdm=marker
** vim: noet ts=3 sw=3
** vim: syntax=sella_nms
*/
