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.
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.3 eventd-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.6 destinationPaths.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.2 log4j.properties
這個檔案定義log4j的屬性。它包括記錄文件大小,更迭(rotation),以及各類別記錄文件的記錄層級。
9.3 magic-users.properties
這個檔案的優先權高於users.xml,它包含了一些特殊使用者的信息。這是刻意用來控制和web UI互動的某些功能之權限。
9.4AvailabilityReports.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
Concurrent management tasks:
 
6.    服務
輪訓Poller daemon - polls managed nodes/services
4.         .運行情況Outage manager daemon - consolidates events
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章