/*
	This is the main configuration file; it defines module behavior such as which policy-statments to
	apply to the module and other module specific parameters.

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

#include "@resolved_sysconfdir@/policy-statements.conf"
#include "@resolved_sysconfdir@/policy.d"

discovery {
	icmp {
		source		10.0.0.1;
		interface	eth0;

		transmit		3;				/* The number of ICMP echo request packets to transmit to each host (default: 3). */
		require		1;				/* The number of ICMP echo replies to require from a host to qualify that host as existant (default: 1). */
		timeout		5000;			/* The minimum amout of time (ms) to wait for the reciept of an ICMP echo reply from each host (default: 5000). */

		/*
			This is a list of networks to scan via ICMP for network discovery; this seeds the SNMP discovery module.
			Default: no hosts are queried via ICMP.
			NOTE: You *must* change this section! Insert your loopback prefixes.
		*/
		prefix {
			10.0.0.0/8;
			192.168.0.0/16;
		}
	}
	snmp {
		source			10.0.0.1;
		interface		eth0;

		threads			32;				/* The number of threads to use for SNMP polling of devices (default 32). */
		commit-count	300;

		community		[ public ];	   /* Attempt to poll each device with each community listed here (default: public). */
		timeout 			1000;				/* The minimum amount of time (ms) to wait for each SNMP get response (default: 1000). */
		retry 			3;					/* The maximum number of times to retry each get request if a response is not recieved (default: 3). */

		/*
			This is a list of networks to scan via SNMP that were not detected by an ICMP scan.

			Default: no prefixes are defined; addresses which responded to the ICMP module are queried.

			NOTE: Use this section only if ICMP is disabled for some devices on your network.
		*/
		prefix {
--			10.1.250.0/24;
		}

		/*
			This is a list of SNMP OID tables to attempt to walk on each device.

			Default: this is a required setting, an error is generated if missing.
		*/
		oid {
			system;
			interfaces.ifTable.ifEntry.ifIndex;
			interfaces.ifTable.ifEntry.ifDescr;
			interfaces.ifTable.ifEntry.ifMtu;
			interfaces.ifTable.ifEntry.ifAdminStatus;
			interfaces.ifTable.ifEntry.ifOperStatus;
			interfaces.ifTable.ifEntry.ifType;
			interfaces.ifTable.ifEntry.ifSpeed;
			ip.ipAddrTable.ipAddrEntry.ipAdEntAddr;
			ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex;
			ip.ipAddrTable.ipAddrEntry.ipAdEntNetMask;
			ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias;
		}
	}
	topology {
		policy {
			/*
				Run all discovered IP addresses through this list of policies to determine which addresses should be used
				for topology correlation.
	
				Default: no policies are applied, and all discovered IP addresses are used in the correlation process.
			*/
			input	[ IGNORE_LOOPBACK ]; /* IGNORE_RFC_1918 */
		}
		merge-percent 95;			/* Perc of IPs to match between element in database and new discovery to merge (if hostnames do not match). (default: 95) */
		duplicate-percent 90;	/* Perc of IPs to match between newly discovered elements, to descide to discard as duplicate. (default: 90) */
		maximum-element-delete	1000;
	}
}
monitor {
	icmp {
		source		localhost;										/* The source address to use in ICMP packets (default: system default address). */
		interface	eth0;

		interval 	60;	/* The amount of time between polling intervals; packets are evenly distributed over this timeframe (default: 60). */
		interval-adjustment	5;
		payload		"All your packet are belong to us!";	/* The ICMP packet payload (default: 'SellaNMS - ICMP Monitor'). */
		max-rtt		5000;												/* The maxiumum round trip time (rtt) in ms to wait for an ICMP echo reply (default: 5000). */
		transmit		3;													/* The number of packets to send to each host being monitored (default: 3). */
		ttl			64;												/* The number of hops a packet will cross before giving up (default: 64). */

		tos			0;													/* The ToS bits (packet priority) of the generated packages (default: 0). */
		dscp			0;
		precedence	0;

		queue-depth	250;

		policy-queue-depth			250;

		calc-interval					30;
		calc-interval-adjustment	5;
		calc-queue-depth				2000;

		supression {
			packet-loss 5;
			latency 200;
			jitter 200;
			normalized-latency 200;
		}

		policy {
			/*
				Run the set of IP addresses to be monitored through this list of policies to alter the set.

				Default: no policies are applied; all IP addresses are polled.
			*/
			input		[ IGNORE_LOOPBACK ]; /* IGNORE_RFC_1918 */
			/*
				Run the results of each polled address through this list of policies to determine the action to take.

				Default: this is a required setting, an error is generated if missing.
			*/
			output	[ PACKET_LOSS ];
		}
	}
	snmptrap {
		source		localhost;										/* The source address to use in ICMP packets (default: system default address). */
		interface	eth0;
		port			162;

		proxy {
			convert	v2;
		}
		queue-depth	250;		/* The incoming snmptrap queue-depth (default: 250) */
		exit-after	0;

		policy {
			/*
				Run the each SNMP trap through this list of policies to alter the set of input.

				Default: no policies are applied; all snmptrap entries are accepted.
			*/
			input		[ IGNORE_AUTHENTICATION_FAILURE_TRAP ];
			/*
				Run the each SNMP trap through this list of policies to determine the action to take.

				Default: this is a required setting, an error is generated if missing.
			*/
			output	[ OSPF_TRAP BGP_TRAP JUNIPER_MPLS_TRAP JUNIPER_CHASSIS_TRAP NETSNMP_TRAP LINK_TRAP TRANSLATE_BGP_ERROR ];
		}
	}
	syslog {
		source		localhost;	/* The source address to use in ICMP packets (default: system default address). */
		interface	eth0;

		duplicate-history-max	25;
		duplicate-history-age	5;
		duplicate-fuzz-factor	25;

		queue-depth	250;		/* The incoming syslog queue-depth (default: 250) */
		exit-after	0;

		policy {
			/*
				Run the each syslog message through this list of policies to alter the set of input.

				Default: no policies are applied; all syslog entries are accepted.
			*/
			input		[ IGNORE_GENERIC_SYSLOG IGNORE_GENERIC_JUNIPER_SYSLOG IGNORE_GENERIC_CISCO_SYSLOG IGNORE_GENERIC_EXTREME_SYSLOG IGNORE_GENERIC_NETSCREEN_SYSLOG ];
			/*
				Run the each syslog message through this list of policies to determine the action to take.

				Default: this is a required setting, an error is generated if missing.
			*/
			output	[ JUNIPER_HEALTH_SYSLOG JUNIPER_BGP_SYSLOG JUNIPER_VPN_SYSLOG CISCO_GENERIC_SYSLOG CISCO_BGP_SYSLOG CISCO_7500_HEALTH_SYSLOG CISCO_7200_HEALTH_SYSLOG ];
		}
	}
	bgp {
		interface eth0:0;
--		source 10.0.0.4;
		local-as 65500;
		peer-as 65512;
		hold-time 180;
		multihop ttl 255;
		graceful-restart restart-time 600;
		family [ any inet inet6 inet-vpn inet6-vpn ];
		authentication-key "secret-key";
		damping;

		policy {
--			input [ NO_ROUTES ];
--			output [ NO_ROUTES ];
		}

		allow [ 0.0.0.0/0 ];

		neighbor 10.5.5.15 {
			description "Edge City";
			peer-as 65512;

			local-as 65500;
			hold-time 180;
			multihop ttl 255;
			graceful-restart restart-time 600;
			family [ any inet inet6 inet-vpn inet6-vpn ];
			authentication-key "secret-key";
			damping;

			policy {
--				input [ NO_ROUTES ];
--				output [ NO_ROUTES ];
			}
		}
	}
	state {
		interval	15;

		policy {
			output	 [ DETERMINE_STATE ];
		}
	}
}
output {
	gui {
		interval 				15;
		expire-interval		120;
		max-expire-delete		250;

		policy {
			/*
				Run all GUI input (event and history) though this set of policies. 

				Default: no policies are applied and all events are accepted.
			*/
			output	[ UPDATE_GUI_EVENT EXPIRE_GUI_STORAGE ];
		}
	}
	email {
		interval					15;
		queue-depth				250;

		default {
			server 	localhost;	/* Replace with your SMTP server. */
			from		"sellanms@your-domain.com";
			to			"support@your-domain.com";	/* Replace with your address. */
			cc			"boss@your-domain.com";		/* Replace with your address. */
			bcc		"secret@your-domain.com";	/* Replace with your address. */
		}

		alias {
			james {
				to		"james@your-domain.com";
			}
			william {
				to		"william@your-domain.com";
			}
		}

		policy {
			/*
				Run all email output events through this list of policies to alter the values used for the email.

				Default: this is a required setting, an error is generated if missing.
			*/
			input		[ IGNORE_ALL ]; /* Remove IGNORE_ALL to recieve email. */
			output	[ EMAIL_NOTIFICATION ];
		}
	}
	syslog {
		interval				15;
	}
}
internal {
	tidy {
		interval					45;
		output-age				300;
	}
}

/*
	This portion of the configuration defines variables related to the daemon and
	dynamic library modules that are to be loaded by the daemon.  It also defines
	scheduling information.  This section should remain fairly static on a system
	after initial configuration.
*/

system {
	storage {
		primary {
			driver 	mysql;
			server 	@sella_nms_server@;
			port		@sella_nms_port@;
			database @sella_nms_database@;
			username @sella_nms_username@;
			password @sella_nms_password@;
		}
	}
	snmp-mib {
		@resolved_datadir@/mibs;
		@resolved_datadir@/mibs/rfc;
		@resolved_datadir@/mibs/juniper;
		@resolved_datadir@/mibs/cisco;
		@resolved_datadir@/mibs/extreme;
		@resolved_datadir@/mibs/netscreen;
		@resolved_datadir@/mibs/arbor;
	}
	library {
		@resolved_libexecdir@/libcommon.so;
		@resolved_libexecdir@/libstorage.so;
		@resolved_libexecdir@/libpolicy.so;
		@resolved_libexecdir@/libstate.so;
	}
	module {
		default {
			nice 5;
			restart;
			user nobody;
			config "@resolved_sysconfdir@/sella_nms.conf";
			directory "@resolved_sbindir@";
			facility	local0;
		}
		discovery {
			nice 15;
			no-restart;
			schedule {
				startup;
				hour 4;
				minute 0;
				second 0;
			}
			icmp {
				executable "discovery/icmpd";
				description "icmpd <dsc>";
				order 10;
			}
			snmp {
				executable "discovery/snmpd";
				description "snmpd <dsc>";
				order 20;
			}
			topology {
				executable "discovery/topologyd";
				description "topologyd <dsc>";
				order 100;
			}
		}
		monitor {
			icmp {
				executable "monitor/icmpd";
				description "icmpd <mon>";
			}
			snmptrap {
				executable "monitor/snmptrapd";
				description "snmptrapd <mon>";
			}
			syslog {
				executable "monitor/syslogd";
				description "syslogd <mon>";
			}
			bgp {
				executable "monitor/bgpd";
				description "bgpd <mon>";
			}
			state {
				executable "monitor/stated";
				description "stated <mon>";
			}
		}
		output {
			gui {
				executable "output/guid";
				description "guid <out>";
			}
			email {
				executable "output/emaild";
				description "emaild <out>";
			}
			syslog {
				executable "output/syslogd";
				description "syslogd <out>";
			}
		}
		internal {
			tidy {
				executable "output/tidyd";
				description "tidyd <out>";
			}
		}
	}
}

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