安装部署Opennms





安装部署Opennms


安装部署Opennms

Opennms
笔者QQ:381493251
博客地址:www.abcdocker.com
微信公众号:abcdocker
Abcdocker交流群:454666672
如果遇到什么问题可以进群询问,我们是一个乐于帮助的集体!


本文由强哥提供,未经本人同意禁止转载! 谢谢
如有技术问题可以联系原著: qq 296917342

opennms介绍

  Opennms能够帮助IT管理部门持续的监控分布式的异构系统和网络设备的运行状态,它可以支持SNMP网络管理协议确保管理的扩展性,并且提供非常灵活的定制功能从而有利于管理范围的伸缩。
  它内置的故障事件管理以提供故障事件的记录和分析的能力,快速隔离非根源事件并迅速发现故障原因。
  Opennms 良好的设计可以快速部署实施,简单友好的图形界面能够使得用户迅速掌握,从而降低操作的复杂度,提高IT管理效率。

搭建步骤

1.环境准备

  1. [root@opennms ~]# cat /etc/redhat-release
  2. CentOS Linux release 7.2.1511 (Core)
  3. [root@opennms ~]# systemctl stop firewalld
  4. [root@opennms ~]# sestatus
  5. SELinux status: disabled

提示:关闭防火墙selinux,并保证能正常上网

2.添加opennms的yum源

  1. rpm -Uvh http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm
  2. rpm --import http://yum.opennms.org/OPENNMS-GPG-KEY

3.安装软件包和依赖包

  1. The following packages will be automatically installed:
  2. opennms: The platform meta package which handles all dependencies from OpenNMS repository.
  3. jicmp6 and jicmp: Java bridge to allow sending ICMP messages from OpenNMS repository.
  4. opennms-core: OpenNMS core services, e.g. Provisiond, Pollerd and Collectd from OpenNMS repository.
  5. opennms-webapp-jetty: OpenNMS web application from OpenNMS repository
  6. jdk1.8: Oracle Java SE Development Kit 8 environment from OpenNMS respository
  7. postgresql: PostgreSQL database server from distribution repository
  8. postgresql-libs: PostgreSQL database from distribution repository

  我们知道,它依赖jdk1.8,postgresql,opennms-core,opennms-webapp-jetty
  用yum下载太慢了,我都是找到url地址,用迅雷下载,然后直接`上传
  
这里postgresql我是yum安装的

  1. http://yum.opennms.org/stable/common/jdk/x64/jdk-8u60-linux-x64.rpm
  2. http://yum.opennms.org/stable/common/opennms/opennms-core-18.0.2-1.noarch.rpm
  3. http://yum.opennms.org/stable/common/opennms/opennms-webapp-jetty-18.0.2-1.noarch.rpm

下载完成后,上传

  1. [root@opennms ~]# ls
  2. anaconda-ks.cfg opennms-core-18.0.2-1.noarch.rpm
  3. jdk-8u60-linux-x64.rpm opennms-webapp-jetty-18.0.2-1.noarch.rpm

这里我先安装的是postgreSQL

  1. yum install -y postgresql postgresql-server

安装jdk

  1. rpm -ivh jdk-8u60-linux-x64.rpm

安装opennms-core

  1. yum localinstall -y opennms-core-18.0.2-1.noarch.rpm

安装opennms-webapp-jetty-

  1. yum localinstall -y opennms-webapp-jetty-18.0.2-1.noarch.rpm

最后安装opennms

  1. yum -y install opennms

检查安装

  1. [root@opennms ~]# tree -L 1 /opt/opennms/
  2. /opt/opennms/
  3. ├── bin
  4. ├── contrib
  5. ├── data
  6. ├── deploy
  7. ├── etc
  8. ├── jetty-webapps
  9. ├── lib
  10. ├── logs -> /var/log/opennms
  11. ├── share -> /var/opennms
  12. └── system
  13. 10 directories, 0 files

安装已经完成,下面是部署配置

4.配置PostgreSQL

  1. postgresql-setup initdb 初始化
  2. systemctl enable postgresql 开机启动
  3. systemctl start postgresql 启动
  4. su - postgres 切换用户
  5. createuser -P opennms 创建opennms用户,并设置密码,我设置的密码是opennms
  6. createdb -O opennms opennms
  7. psql -c "ALTER USER postgres WITH PASSWORD 'opennms';" 设置超级用户的密码也是opennms
  8. exit 回到root用户

修改pg_hba.conf

  1. vi /var/lib/pgsql/data/pg_hba.conf
  2. 将下面的ident修改为md5
  3. 82 host all all 127.0.0.1/32 ident
  4. 83 # IPv6 local connections:
  5. 84 host all all ::1/128 ident
  6. 修改之后的效果
  7. 82 host all all 127.0.0.1/32 md5
  8. 83 # IPv6 local connections:
  9. 84 host all all ::1/128 md5

然后保存退出,平滑重启postgreSQL

  1. systemctl reload postgresql

5.配置opennms,并启动
  个人文本有限,觉得还是官方文档说的比较好,就直接贴上来了
编辑下面这个配置文件

  1. vi /opt/opennms/etc/opennms-datasources.xml
  2. Configuration for database authentication in OpenNMS
  3. <jdbc-data-source name="opennms"
  4. database-name="opennms"
  5. class-name="org.postgresql.Driver"
  6. url="jdbc:postgresql://localhost:5432/opennms"
  7. user-name="** YOUR-OPENNMS-USERNAME **"
  8. password="** YOUR-OPENNMS-PASSWORD **" />
  9. <jdbc-data-source name="opennms-admin"
  10. database-name="template1"
  11. class-name="org.postgresql.Driver"
  12. url="jdbc:postgresql://localhost:5432/template1"
  13. user-name="postgres"
  14. password="** YOUR-POSTGRES-PASSWORD **" />
  15. Set the user name to access the OpenNMS database table
  16. Set the password to access the OpenNMS database table
  17. Set the postgres user for administrative access to PostgreSQL
  18. Set the password for administrative access to PostgreSQL

修改完成之后的效果

  1. <jdbc-data-source name="opennms"
  2. database-name="opennms"
  3. class-name="org.postgresql.Driver"
  4. url="jdbc:postgresql://localhost:5432/opennms"
  5. user-name="opennms"
  6. password="opennms" />
  7. <jdbc-data-source name="opennms-admin"
  8. database-name="template1"
  9. class-name="org.postgresql.Driver"
  10. url="jdbc:postgresql://localhost:5432/template1"
  11. user-name="postgres"
  12. password="opennms" />
  13. /opt/opennms/bin/runjava -s
  14. /opt/opennms/bin/install -dis

等屏刷完

  1. systemctl enable opennms
  2. systemctl start opennms

6.访问opennms
先看下本机的ip

  1. [root@opennms ~]# hostname -I
  2. 192.168.56.139
  3. 所有我的地址是http://192.168.56.139:8980/opennms

2.png-82.5kB
初始账号密码两个admin
3.png-107.2kB
到此部署安装完成!
  weixin.gif-425.6kB


新闻联播老司机

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: