December 14,2006 14:08

再貼!在CentOS 4環境快速將OpenNMS 1.2.8升級至1.2.9

OpenNMS1.2.9版推出,照慣例我也把升級的過程貼出來,供大家參考。

之前的文章是將OpenNMS從1.2.7升級到1.2.8的紀錄,裡面我有提醒過的注意事項這邊不再贅述(喔,當然我的CentOS已經升級到4.4了)。

這邊唯一要提醒的是,如果妳跟我一樣,不是用root帳號來執行tomcat(我用tomcat4這個帳號),有幾個目錄夾的權限要改,本篇最後一段會提供指令,詳細的理由請看之前我跟網友的討論

[下載,我選的下載點是nchc]
[austin@localhost opennms]$ wget http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-1.2.9-1_centos4.i386.rpm
--14:19:06-- http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-1.2.9-1_centos4.i386.rpm
=> `opennms-1.2.9-1_centos4.i386.rpm'
正在查找主機 nchc.dl.sourceforge.net... 211.79.61.10
正在連接 nchc.dl.sourceforge.net|211.79.61.10|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 17,502,923 (17M) [text/plain]

100%

[========================================================================================================================

========>] 17,502,923 162.81K/s ETA 00:00

14:20:59 (151.85 KB/s) -- 已儲存 ‘opennms-1.2.9-1_centos4.i386.rpm’ [17502923/17502923])

[austin@localhost opennms]$ wget http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-webapp-1.2.9-1_centos4.i386.rpm
--14:21:22-- http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-webapp-1.2.9-1_centos4.i386.rpm
=> `opennms-webapp-1.2.9-1_centos4.i386.rpm'
正在查找主機 nchc.dl.sourceforge.net... 211.79.61.10
正在連接 nchc.dl.sourceforge.net|211.79.61.10|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 10,437,925 (10.0M) [text/plain]

100%

[========================================================================================================================

========>] 10,437,925 152.36K/s ETA 00:00

14:22:30 (151.21 KB/s) -- 已儲存 ‘opennms-webapp-1.2.9-1_centos4.i386.rpm’ [10437925/10437925])

[austin@localhost opennms]$ wget http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-docs-1.2.9-1_centos4.i386.rpm
--14:24:21-- http://nchc.dl.sourceforge.net/sourceforge/opennms/opennms-docs-1.2.9-1_centos4.i386.rpm
=> `opennms-docs-1.2.9-1_centos4.i386.rpm'
正在查找主機 nchc.dl.sourceforge.net... 211.79.61.10
正在連接 nchc.dl.sourceforge.net|211.79.61.10|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 3,661,530 (3.5M) [text/plain]

100%

[========================================================================================================================

========>] 3,661,530 153.30K/s ETA 00:00

14:24:44 (156.08 KB/s) -- 已儲存 ‘opennms-docs-1.2.9-1_centos4.i386.rpm’ [3661530/3661530])

[austin@localhost opennms]$

[安裝及設定]
[root@localhost opennms]# rpm -Uvh opennms*1.2.9*
警告:opennms-1.2.9-1_centos4.i386.rpm: V3 DSA 簽章:NOKEY, key ID 4c4cbbd9
準備中... ########################################### [100%]
1:opennms ########################################### [ 33%]
- moving *.sql.rpmnew files (if any)... done
- checking for old update files... done

*** Installation complete. You must still run the installer and
*** make a few other changes before you start OpenNMS. See the
*** install guide and release notes for details.
2:opennms-docs ########################################### [ 67%]
3:opennms-webapp ########################################### [100%]
[root@localhost opennms]# service opennms status
/etc/init.d/opennms: OpenNMS not configured.
/opt/OpenNMS/etc/configured does not exist.
You need to run the installer -- see the install guide for details.
[root@localhost opennms]# $OPENNMS_HOME/bin/install -disU
==============================================================================
OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39:16Z djgregor $
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

- checking database version... 7.4
- Full version string: PostgreSQL 7.4.13 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.5 20051201 (Red Hat

3.4.5-2)
* using 'opennms' as the PostgreSQL user for OpenNMS
* using 'opennms' as the PostgreSQL password for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
- using SQL directory... /opt/OpenNMS/etc
- using create.sql... /opt/OpenNMS/etc/create.sql
- using iplike module... /opt/OpenNMS/lib/iplike.so
- checking database for old backup tables... NONE
- checking for rows that violate constraints... NONE
- creating tables...
- checking table "serverMap"... UPTODATE
- checking table "serviceMap"... UPTODATE
- checking table "distPoller"... UPTODATE
- checking table "node"... UPTODATE
- checking table "ipInterface"... UPTODATE
- checking table "snmpInterface"... UPTODATE
- checking table "service"... UPTODATE
- checking table "ifServices"... UPTODATE
- checking table "events"... UPTODATE
- checking table "outages"... UPTODATE
- checking table "vulnerabilities"... UPTODATE
- checking table "vulnPlugins"... UPTODATE
- checking table "notifications"... UPTODATE
- checking table "usersNotified"... UPTODATE
- checking table "assets"... UPTODATE
- creating tables... DONE
- creating sequences...
- checking "nodeNxtId" minimum value... 31
- removing sequence "nodeNxtId"... REMOVED
- creating sequence "nodeNxtId"... OK
- checking "serviceNxtId" minimum value... 32
- removing sequence "serviceNxtId"... REMOVED
- creating sequence "serviceNxtId"... OK
- checking "eventsNxtId" minimum value... 3202
- removing sequence "eventsNxtId"... REMOVED
- creating sequence "eventsNxtId"... OK
- checking "outageNxtId" minimum value... 1800
- removing sequence "outageNxtId"... REMOVED
- creating sequence "outageNxtId"... OK
- checking "notifyNxtId" minimum value... 1
- removing sequence "notifyNxtId"... REMOVED
- creating sequence "notifyNxtId"... OK
- checking "vulnNxtId" minimum value... 1
- removing sequence "vulnNxtId"... REMOVED
- creating sequence "vulnNxtId"... OK
- creating sequences... DONE
- creating indexes...
- creating index "server_name_idx"... EXISTS
- creating index "servicemap_name_idx"... EXISTS
- creating index "serviceMap_ipaddr_idx"... EXISTS
- creating index "node_id_type_idx"... EXISTS
- creating index "node_label_idx"... EXISTS
- creating index "ipinterface_nodeid_ipaddr_ismanaged_idx"... EXISTS
- creating index "ipinterface_ipaddr_ismanaged_idx"... EXISTS
- creating index "ipinterface_ipaddr_idx"... EXISTS
- creating index "ipinterface_nodeid_ismanaged_idx"... EXISTS
- creating index "ipinterface_nodeid_idx"... EXISTS
- creating index "snmpinterface_nodeid_ifindex_idx"... EXISTS
- creating index "snmpinterface_nodeid_idx"... EXISTS
- creating index "snmpinterface_ipaddr_idx"... EXISTS
- creating index "ifservices_nodeid_ipaddr_status"... EXISTS
- creating index "ifservices_nodeid_status"... EXISTS
- creating index "ifservices_nodeid_idx"... EXISTS
- creating index "ifservices_serviceid_idx"... EXISTS
- creating index "ifservices_nodeid_serviceid_idx"... EXISTS
- creating index "events_uei_idx"... EXISTS
- creating index "events_nodeid_idx"... EXISTS
- creating index "events_ipaddr_idx"... EXISTS
- creating index "events_serviceid_idx"... EXISTS
- creating index "events_time_idx"... EXISTS
- creating index "events_severity_idx"... EXISTS
- creating index "events_log_idx"... EXISTS
- creating index "events_display_idx"... EXISTS
- creating index "events_ackuser_idx"... EXISTS
- creating index "events_acktime_idx"... EXISTS
- creating index "outages_svclostid_idx"... EXISTS
- creating index "outages_svcregainedid_idx"... EXISTS
- creating index "outages_nodeid_idx"... EXISTS
- creating index "outages_ipaddr_idx"... EXISTS
- creating index "outages_serviceid_idx"... EXISTS
- creating index "outages_regainedservice_idx"... EXISTS
- creating index "vulnerabilities_nodeid_idx"... EXISTS
- creating index "vulnerabilities_ipaddr_idx"... EXISTS
- creating index "vulnerabilities_severity_idx"... EXISTS
- creating index "vulnerabilities_port_idx"... EXISTS
- creating index "vulnerabilities_protocol_idx"... EXISTS
- creating index "vulnplugins_plugin_idx"... EXISTS
- creating index "notifications_ipaddr_idx"... EXISTS
- creating index "notifications_serviceid_idx"... EXISTS
- creating index "notifications_eventid_idx"... EXISTS
- creating index "notifications_respondtime_idx"... EXISTS
- creating index "notifications_answeredby_idx"... EXISTS
- creating index "userid_notifyid_idx"... EXISTS
- creating indexes... DONE
- inserting initial table data for "distPoller"... EXISTS
- checking if database "opennms" is unicode... ALREADY UNICODE
- checking for stale iplike references... REMOVED
- checking for stale eventtime.so references... CLEAN
- adding iplike database function... OK
- adding PL/pgSQL call handler... EXISTS
- adding PL/pgSQL language module... EXISTS
- adding stored procedures...
- getManagedOutageForIntfInWindow.sql... EXISTS
- getManagedServiceCountForIntf.sql... EXISTS
- getOutageTimeInWindow.sql... EXISTS
- getManagePercentAvailIntfWindow.sql... EXISTS
- getManagedServiceCountForNode.sql... EXISTS
- getManagedOutageForNodeInWindow.sql... EXISTS
- getPercentAvailabilityInWindow.sql... EXISTS
- getManagePercentAvailNodeWindow.sql... EXISTS

Installer completed successfully!
[root@localhost opennms]# $OPENNMS_HOME/bin/install -y -w $CATALINA_HOME/webapps -W $CATALINA_HOME/server/lib
==============================================================================
OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39:16Z djgregor $
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

* using 'opennms' as the PostgreSQL user for OpenNMS
* using 'opennms' as the PostgreSQL password for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
- using Top-level web application directory... Exception in thread "main" java.io.FileNotFoundException: Top-level web

application directory does not exist at "/webapps". Use the -w option to specify another location.
at org.opennms.install.Installer.verifyFileExists(Installer.java:1356)
at org.opennms.install.Installer.verifyFilesAndDirectories(Installer.java:1329)
at org.opennms.install.Installer.install(Installer.java:202)
at org.opennms.install.Installer.main(Installer.java:2450)
[root@localhost opennms]# $OPENNMS_HOME/bin/install -y -w /var/tomcat4/webapps -W /var/tomcat4/server/lib
==============================================================================
OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39:16Z djgregor $
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

* using 'opennms' as the PostgreSQL user for OpenNMS
* using 'opennms' as the PostgreSQL password for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
- using Top-level web application directory... /var/tomcat4/webapps
- using Tomcat server library directory... /var/tomcat4/server/lib
- using OpenNMS webapps directory... /opt/OpenNMS/webapps
- Checking for old opennms webapp directory in /var/tomcat4/webapps/opennms... OK
- Checking for old opennms context in /var/tomcat4/webapps/../conf/server.xml... OK
- Install OpenNMS webapp...
- /var/tomcat4/webapps/opennms.xml exists, removing... REMOVED
- creating link to /var/tomcat4/webapps/opennms.xml... DONE
- /var/tomcat4/server/lib/log4j.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/log4j.jar... DONE
- /var/tomcat4/server/lib/castor-0.9.3.9.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/castor-0.9.3.9.jar... DONE
- /var/tomcat4/server/lib/castor-0.9.3.9-xml.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/castor-0.9.3.9-xml.jar... DONE
- /var/tomcat4/server/lib/opennms_core.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/opennms_core.jar... DONE
- /var/tomcat4/server/lib/opennms_services.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/opennms_services.jar... DONE
- /var/tomcat4/server/lib/opennms_web.jar exists, removing... REMOVED
- creating link to /var/tomcat4/server/lib/opennms_web.jar... DONE
- Installing OpenNMS webapp... DONE

Installer completed successfully!
[root@localhost opennms]# service opennms status
opennms is running
[root@localhost opennms]#

注意!如果妳跟我一樣,不是用root帳號來執行tomcat(我用tomcat4這個帳號),請執行底下這些指令:

[root@localhost opennms]# echo $OPENNMS_HOME
/opt/OpenNMS
[root@localhost opennms]# ls -ld /opt/OpenNMS/etc
drwxrwxr-x 3 root root 4096 12月 14 14:36 /opt/OpenNMS/etc
[root@localhost opennms]# chgrp -R tomcat4 $OPENNMS_HOME/etc
[root@localhost opennms]# chmod -R g+w $OPENNMS_HOME/etc
[root@localhost opennms]# ls -ld /var/log/opennms
drwxrwxr-x 2 root root 4096 11月 19 15:41 /var/log/opennms
[root@localhost opennms]# chgrp -R tomcat4 /var/log/opennms
[root@localhost opennms]# chmod -R g+w /var/log/opennms
[root@localhost opennms]# ls -ld /opt/OpenNMS/share/reports
drwxrwxr-x 2 root root 4096 11月 19 15:41 /opt/OpenNMS/share/reports
[root@localhost opennms]# chgrp -R tomcat4 /opt/OpenNMS/share/reports
[root@localhost opennms]# chmod -R g+w /opt/OpenNMS/share/reports
[root@localhost opennms]#

  • ystuan 發表於樂多回應(6)引用(0)自由軟體-網路管理編輯本文
    樂多分類:網路/3C │昨日人次:0 │累計人次:161 │標籤:OpenNMS
    Ads by Roodo! 

    引用URL

    http://cgi.blog.roodo.com/trackback/2571134

    回應文章
    反抗君兄,小弟最近在裝OPENNMS,但是安裝過程一直有個問題,不知能否為小弟解惑?我的OS是FC6!訊息如下:

    $OPENNMS_HOME/bin/install -y -w /var/tomcat5/webapps -W /var/tomcat5/server/lib
    ==============================================================================
    OpenNMS Installer Version $Id: Installer.java 4833 2006-10-18 19:07:16Z djgregor $
    ==============================================================================

    Configures PostgreSQL tables, users, and other miscellaneous settings.

    Exception in thread "main" java.lang.Exception: unknown option 'W', use '-h' option for usage
    at org.opennms.install.Installer.parseArguments(Installer.java:401)
    at org.opennms.install.Installer.install(Installer.java:130)
    at org.opennms.install.Installer.main(Installer.java:729)
    | 檢舉 | Posted by 大衛王 at March 22,2007 10:13
    大衛王,

    謝謝你的問題,叫我PowerOp就可以啦。

    你已經告訴我,OS是FC6,不過如果你能說明應用程式(OpenNMS,Tomcat,PostgreSQL等等)的版本,會更有幫助喔。

    嗯,從你貼出來的"4833 2006-10-18 19:07:16Z"這一段來看,你應該是在安裝OpenNMS 1.3.2。在郵件論壇上有人問過一模一樣的問題,已經有答案囉:

    簡單的說,1.3.2的安裝方式有一些變動,你應該要參考另一份手冊
    http://www.opennms.org/documentation/InstallUnStable.html

    其中的Run the Installer to Setup the Web Application提到:

    # $OPENNMS_HOME/bin/install -y -w $CATALINA_HOME/conf/Catalina/localhost

    $CATALINA_HOME is the base directory of your Tomcat installation.

    上面粗體那一行(請貼成一行)就是安裝1.3.X跟1.2.X不一樣的地方之一囉。

    原始討論串請見:[opennms-discuss] 1.3.2 on FC6 - install problem

    ==
    看來我要趕快來翻譯 unstable 1.3.2 的安裝指南,然後自己安裝/升級體驗看看。
    | 檢舉 | Posted by PowerOp at March 22,2007 13:11
    PowerOP兄,感謝你的回答。我想一開始我就犯了錯,第一我到官方網站也看到了官方的文件,因為我想說應該安裝方式差不多,所以就撿了1.2x版的文件來看,當然一些地方就做錯了!目前Opennms已經可以RUN了,但是還有幾個小問題請問,首先$OPENNMS_HOME/etc/discovery-configuration.xml這個檔案是不是在設定允許訪問IP的範圍。第二,http://192.168.10.1:8080/opennms/, 這個連結在tomcat5的目錄下的webapps中並沒有找到,所以網頁打不開,不知這又是在哪個環節發生了錯誤。以上問題,打擾了!
    | 檢舉 | Posted by 大衛王 at March 22,2007 15:06
    大衛王,

    很高興你的安裝有進展囉。

    關於你的兩個問題:

    一:是,細節請參考Installation Guide的Configuring Discovery小節,或者安裝指南的設定發掘(discovery)(這部份1.2.X和1.3.X倒是一樣,所以可以參考)

    二:(你還是沒有告訴我Java,Tomcat,PostgreSQL等等的版本?)(或者多描述一下安裝的步驟)既然你說之前用錯手冊,建議你按照1.3.X的手冊確認一下有沒有哪邊弄錯了。我可以想到的可能的問題例如Java版本、路徑,Tomcat版本、路徑,Tomcat跑起來了嗎,port 8080有沒有被防火牆擋掉等等。

    最近郵件論壇上有一個類似的問題,請參考[opennms-install] rhel4 and tomcat5,討論串提到了很多該確認的項目。
    | 檢舉 | Posted by PowerOp at March 23,2007 12:51
    謝PowerOP兄,我會先去該論壇找解決辦法,萬不得已再麻煩你!
    | 檢舉 | Posted by 大衛王 at March 23,2007 12:58
    大衛王,

    真的啦,我一個還沒裝過1.3.X的臭皮匠,怎敵的過mailing list上面那麼多諸葛亮?(只不過諸葛亮在那裡都說英文 XD)

    ==
    ps:不要說「萬不得已」咩
    pps:叫我PowerOp就可以了,不用 兄 我啦......
    | 檢舉 | Posted by PowerOp at March 26,2007 12:55