openNMS配置文件介绍(转)
配置文件介绍
1.自身管理
1.1 service-configuration.xml
这个档案定义opennms本身要启动的服务. 它和VM有关,并且控制哪个服务在哪个VM中开启.
1.2 jmx-datacollection-config.xml
2.发现:
2.1 discovery-configuration.xml (daemon)
这个档案定义要发掘的网络地址范围,(ping sweep)以及逾时,重试次数,以及用来做发掘的执行绪(thread)数目。这个档案也提供 初次发掘间隔时间(initial-sleep-time)和重新发 掘间隔时间(restart-sleep-time)。这些数值以毫秒(miliseconds)为单位,用来决定 OpenNMS执行后,间隔多久要开始针对网络地址清单作发掘;以及每次发掘之间的间隔时间。
Let's look at that file:
<discovery-configuration threads="1" packets-per-second="1"initial-sleep-time="300000"restart-sleep-time="86400000" retries="3" timeout="800"> <include-range retries="2" timeout="3000"> <begin>192.168.0.1</begin> <end>192.168.0.254</end> </include-range> <include-url>file:/opt/OpenNMS/etc/include</include-url> </discovery-configuration>
<snmp-config retry="3" timeout="800" read-community="public" write-community="private"> <definition version="v2c"> <specific>192.168.0.5</specific> </definition> <definition retry="4" timeout="2000"> <range begin="192.168.1.1" end="192.168.1.254"/> <range begin="192.168.3.1" end="192.168.3.254"/> </definition> <definition read-community="bubba" write-community="zeke"> <range begin="192.168.2.1" end="192.168.2.254"/> </definition> <definition port="1161"> <specific>192.168.5.50</specific> </definition> </snmp-config>
<collectd-configuration threads="5"> <package name="example1"> <filter>IPADDR IPLIKE *.*.*.*</filter> <specific>0.0.0.0</specific> <include-range begin="192.168.0.1" end="192.168.0.254"/> <include-url>file:/opt/OpenNMS/etc/include</include-url> <service name="SNMP" interval="300000" user-defined="false" status="on"> <parameter key="collection" value="default"/> <parameter key="port" value="161"/> <parameter key="retry" value="3"/> <parameter key="timeout" value="3000"/> </service> <outage-calendar>zzz from poll-outages.xml zzz</outage-calendar> </package> <collector service="SNMP" class-name="org.opennms.netmgt.collectd.SnmpCollector"/></collectd-configuration>
If you are familiar with the poller configuration file, you can probably figure out what this file does. The threads attribute limits the number of threads that will be used by the data collection process. You can increase or decrease this value based upon your network and the size of your server. Just like pollers have poller packages, collectors have collection packages. Each package determines how often the device will be polled for SNMP data, and through the collection key, what will be polled and how it will be stored. The example1 package is the default included out of the box. [edit] What Interfaces are Included in a Package? The package name is followed by a list of tags that define what interfaces will be included in the package. There are five types of these tags: filter Specify a filter that matches the interfaces to be included in the package. <filter>IPADDR IPLIKE *.*.*.*</filter> Each package must have a filter tag that performs the initial test to see if an interface should be included in a package. Filters operate on interfaces (not nodes) and will be discussed in depth in another How-To. Only one filter statement can exist per package. specific Specify a specific IP address to include in the package. <specific>192.168.1.59</specific> include-range This specifies a particular range of IP addresses to include in a package. <include-range begin="192.168.0.1" end="192.168.0.254"/> exclude-range This specifies a particular range of IP addresses to exclude in a package. This will override an include-range tag. <exclude-range begin="192.168.0.100" end="192.168.0.104"/> include-url Specify a file that contains a list of IP addresses to include. <include-url>file:/opt/OpenNMS/etc/include</include-url> This tag will point to a file that consists of a list of IP addresses, one to a line, that will be included in the package. Comments can be imbedded in this file. Any line that begins with a "#" character will be ignored, as will the remainder of any line that includes a space followed by "#". All of the above tags, except for filter, are optional and unbounded.
<notification name="nodeAdded"><uei><![CDATA[http://uei.opennms.org/products/bluebird/nodes/nodeAdded]]></uei> <rule><![CDATA[IPADDR IPLIKE *.*.*.*]]></rule> <destinationPath>Email-Network/Systems</destinationPath> <text-message>OpenNMS has discovered a new node named %parm[nodelabel]%. Please be advised.</text-message> <subject>%parm[nodelabel]% discovered.</subject> </notification>
<command type="email"> <name>/bin/mail</name> <lookup>email</lookup> <lookup>mail</lookup> <comment>for sending email notifications</comment> <argument streamed="false"> <substitution>-s</substitution> <switch>-subject</switch> </argument> <argument streamed="false"> <switch>-email</switch> </argument> <argument streamed="true"> <switch>-tm</switch> </argument> </command>
1. Initializing collection daemon 初始化日志加载调度2. Loading collectors"a) instantiateCollectorsb) createSchedulerc) createEventProcessor3. starta) scheduleExistingInterfaces()i.从表中取4. pause5. resume6. stop
1.实时控制RTC manager daemon - real time availability information2.陷阱SNMP trap daemon – handles SNMP traps3.阈值Threshold daemon – monitor for threshold values4.运行情况Outage manager daemon - consolidates events