配置檔案介紹
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>
3.配置性能采集
3.1 snmp-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.2 collectd-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.3 datacollection-config.xml (daemon)
這個檔案包含給RRDTool的資料收集資訊.
3.4 poller-configuration.xml (daemon)
這個檔案用來定義輪詢組合(packages)以及設定各種服務的輪詢器(pollers)。一個輪詢組合内含數種項目,例如網絡位址範圍, ,服務,排修時段(outage calendars),和故障時段模式(down time models).
4. 性能門檻值
4.1 thresholds.xml
用來設定閥值,當到達閥值時,會根據設定觸發event和notification,詳情見另一篇博文。
5. RTC
5.1 rtc-configuration.xml
這個檔案定義RTC (Real Time Console)的屬性,例如用來計算故障時段百分比的周期(rolling window),web UI重新整理周期,以及多久 RTC将更新送至web接口。
6. 事件告警
6.1 eventconf.xml
這個檔案定義通用事件識别碼(Universal Event Identifiers或UEIs)以及它們的事件屏蔽(masks),描述,記錄檔案訊息,和嚴重程度。
6.2 trapd-configuration.xml (daemon)
這個檔案定義SNMP trap的埠口(port)。
6.3 eventd-configuration.xml (daemon)
這個檔案定義eventd的運作參數,例如逾時值以及監聽器執行緒(listener threads)的數量。
6.4 actiond-configuration.xml (daemon)
在事件(events)産生時所呼叫的外部程式稱為(actions). 這個設定檔控制最多可以同時 執行的action數量, 以及等待action執行完畢回傳結果的逾時值。
6.5 notifications.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.6 destinationPaths.xml
這個檔案用來定義告警的目标路徑(destination path), 例如告警應該送給誰,傳送方式用傳呼, 電郵, 或者電郵-傳呼.
6.7 notificationCommands.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.1 capsd-configuration.xml (daemon)
這個檔案定義, 對于已經發現的節點(包含由discovery daemon或SNMP所發現的),我們能夠偵測出哪些服務.它還可定義,若發掘了某些網絡位址/網絡位址區段,則應該受控或排除在外. 對于沒有定義到的其它網絡位址,它可用一個預設的狀态(管理政策)來規範.
<capsd-configuration rescan-frequency="86400000"
management-policy="unmanaged"> 最後,這個檔案可以讓你設定"rescan-frequency"(重新掃描網絡的頻率).這個設定決定了時間間隔多久需重新掃描網絡上的裝置, 并且重新确認其上有哪些服務.這個數字的機關是毫秒,預設值是86400000,也就是24小時.
7.2 outage-configuration.xml
這個檔案隻是用來定義(服務)中斷管理(outage manager)可以有多少個寫入執行緒(writer threads)。
8. 資料庫
8.1 create.sql database-schema.xml
一般來說, 在安裝過程中, 指令稿install.pl會去呼叫create.sql, 來建立OpenNMS資料庫. create.sql中的批注很易懂. OpenNMS資料庫的schema定義在database-schema.xml; 執行篩選時, 系統會參照它來執行資料庫查詢.
8.2 opennms-database.xml
資料庫class、url、使用者名、密碼
這個檔案定義了供OpenNMS使用的資料庫型态,名稱,認證,以及套用的模闆。
9. 其他
9.1 users.xml / groups.xml 這些檔案存放使用者的資訊,例如他們的聯絡方式,所屬群組和會員資格。這些檔案的資訊是用來做web UI的身份認證 及告警所需的聯絡方式。
9.2 log4j.properties 這個檔案定義log4j的屬性。它包括記錄檔案大小,更疊(rotation),以及各類别記錄檔案的記錄層級。
9.3 magic-users.properties 這個檔案的優先權高于users.xml,它包含了一些特殊使用者的資訊。這是刻意用來控制和web UI互動的某些功能之權限。
9.4 AvailabilityReports.xsl SVGAvailReport.xsl PDFAvailReport.xsl
這三個檔案的資訊是關于如何将可用性報表轉換成PDF格式.
9.5 viewsdisplay.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
4.運作情況Outage manager daemon - consolidates events
6. 服務
輪訓Poller daemon - polls managed nodes/services