opennms配置文件如何?

opennms配置文件如何?

配置文件介绍
1. 自身管理
1.1service-configuration.xml
这个档案定义opennms本身要启动的服务. 它和VM有关,并且控制哪个服务在哪个VM中开启.
1.2jmx-datacollection-config.xml
2. 发现:
2.1discovery-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>
3. 配置性能采集
3.1snmp-config.xml
定义snmp采集的节点、版本、read-community、超时、重试次数等
The parameters used to connect with SNMP agents are defined in the snmp-config.xml file. Here is an example:
<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>
3.2collectd-configuration.xml
Data collection is handled via the collectd process. collectd listens for NodeGainedService events for the SNMP "service". When this happens, it checks to see if the primary SNMP interface for that node exists in a collection package (which it should by definition). If so, the SNMP collector is instantiated for that IP address.
Unless forced toward one version or another via the snmp-config.xml file, when the collection is initialized it will check to see if SNMPv2 is supported by attempting a GET-BULK on system.sysObjectID. If that fails it will revert to version 1.
This is a change from earlier versions of OpenNMS. capsd is no longer responsible for determining the SNMP version. Whether or not SNMPv2 is supported on a node will no longer show up on the node page.
Let's look at the collectd-configuration.xml file:
<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.
3.3datacollection-config.xml (daemon)
这个档案包含给RRDTool的数据收集信息.
3.4poller-configuration.xml (daemon)
这个档案用来定义轮询组合(packages)以及设定各种服务的轮询器(pollers)。一个轮询组合内含数种项目,例如网络地址范围, ,服务,排修时段(outage calendars),和故障时段模式(down time models).
4. 性能阈值
4.1thresholds.xml
5. RTC
5.1rtc-configuration.xml
这个档案定义RTC (Real Time Console)的属性,例如用来计算故障时段百分比的周期(rolling window),web UI刷新周期,以及多久 RTC将更新送至web接口。
6. 事件告警
6.1eventconf.xml
这个档案定义通用事件识别码(Universal Event Identifiers或UEIs)以及它们的事件屏蔽(masks),描述,记录文件讯息,和严重程度。
6.2trapd-configuration.xml (daemon)
这个档案定义SNMP trap的埠口(port)。
6.3eventd-configuration.xml (daemon)
这个档案定义eventd的运作参数,例如逾时值以及监听器执行绪(listener threads)的数量。
6.4actiond-configuration.xml (daemon)
在事件(events)产生时所呼叫的外部程序称为(actions). 这个设定档控制最多可以同时 执行的action数量, 以及等待action执行完毕回传结果的逾时值。
6.5notifications.xml
这个档案定义哪个事件或UEI发出告警, 以及发出告警的途径.
 <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>

 
6.6destinationPaths.xml
这个档案用来定义告警的目标路径(destination path), 例如告警应该送给谁, 传送方式用传呼, 电邮, 或者电邮-传呼.
6.7notificationCommands.xml
这个档案定义如何达成在destinationPaths.xml中所使用的各种联络方式. 这包括了可执行文件的所在位置, 各种联络方式的别名(aliases), 以及特定传送方式尚需的其它信息.
 <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>
 
7. 服务管理
7.1capsd-configuration.xml (daemon)
这个档案定义, 对于已经发现的节点(包含由discovery daemon或SNMP所发现的), 我们能够侦测出哪些服务. 它还可定义,若发掘了某些网络地址/网络地址区段,则应该受控或排除在外. 对于没有定义到的其它网络地址,它可用一个预设的状态(管理政策)来规范.
 <capsd-configuration rescan-frequency="86400000"
 management-policy="unmanaged">

 
最后,这个档案可以让你设定"rescan-frequency"(重新扫描网络的频率).这个设定决定了时间间隔多久需重新扫描网络上的设备, 并且重新确认其上有哪些服务. 这个数字的单位是毫秒,默认值是86400000,也就是24小时.
7.2outage-configuration.xml
这个档案只是用来定义(服务)中断管理(outage manager)可以有多少个写入执行绪(writer threads)。
8. 数据库
8.1create.sql database-schema.xml
一般来说, 在安装过程中, 指令稿install.pl会去呼叫create.sql, 来建立OpenNMS数据库. create.sql中的批注很易懂. OpenNMS数据库的schema定义在database-schema.xml; 执行筛选时, 系统会参照它来执行数据库查询.
8.2opennms-database.xml
数据库class、url、用户名、密码
这个档案定义了供OpenNMS使用的数据库型态,名称,认证,以及套用的模板。
 
9. 其他
9.1users.xml / groups.xml
这些档案存放使用者的信息,例如他们的联络方式,所属群组和会员资格。这些档案的信息是用来做web UI的身份认证 及告警所需的联络方式。
9.2log4j.properties
这个档案定义log4j的属性。它包括记录文件大小,更迭(rotation),以及各类别记录文件的记录层级。
9.3magic-users.properties
这个档案的优先权高于users.xml,它包含了一些特殊使用者的信息。这是刻意用来控制和web UI互动的某些功能之权限。
9.4AvailabilityReports.xsl SVGAvailReport.xsl PDFAvailReport.xsl
这三个档案的信息是关于如何将可用性报表转换成PDF格式.
9.5viewsdisplay.xml
这个档案定义在web UI中显示时, 各个类别的呈现方式. 这些类别则是 定义在views.xmlcategories.xml.
功能模块
1. 总控/调度
Classloader
2. 发现轮训
.能力检查Capability daemon - capability check on nodes
动态主机配置协议DHCP daemon - DHCP client for OpenNMS
.发现Discovery daemon - initial and ongoing discovery互联网控制消息协议(Internet Control Message Protocol或简写ICMP)
3. 配置采集
数据采集Collection daemon - collects data
jmxMbean:Collectd
extendsServiceDaemon
单例(singleton
采集流程:
1. Initializing collection daemon 初始化日志加载调度
2. Loading collectors"
a) instantiateCollectors
b) createScheduler
c) createEventProcessor
3. start
a) scheduleExistingInterfaces()
i. 从表中取
4. pause
5. resume
6. stop
 
4. 性能采集
5. 事件
.通知Notification daemon - external notification of users
1. .实时控制RTC manager daemon - real time availability information
2. .陷阱SNMP trap daemon – handles SNMP traps
3. .阈值Threshold daemon – monitor for threshold values
Concurrent management tasks:
6. 服务
轮训Poller daemon - polls managed nodes/services
4. .运行情况Outage manager daemon - consolidates events