安装部署Opennms
安装部署Opennms
Opennms
笔者QQ:381493251
博客地址:www.abcdocker.com
微信公众号:abcdocker
Abcdocker交流群:454666672
如果遇到什么问题可以进群询问,我们是一个乐于帮助的集体!
本文由强哥提供,未经本人同意禁止转载! 谢谢
如有技术问题可以联系原著: qq 296917342
opennms介绍
Opennms
能够帮助IT
管理部门持续的监控分布式的异构系统和网络设备的运行状态,它可以支持SNMP网络管理协议
确保管理的扩展性,并且提供非常灵活的定制功能从而有利于管理范围的伸缩。
它内置的故障事件管理
以提供故障事件的记录和分析的能力,快速隔离非根源事件并迅速发现故障原因。
Opennms
良好的设计可以快速部署实施,简单友好的图形界面能够使得用户迅速掌握,从而降低操作的复杂度,提高IT管理
效率。
搭建步骤
1.环境准备
[root@opennms ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@opennms ~]# systemctl stop firewalld [root@opennms ~]# sestatus SELinux status: disabled
提示:关闭防火墙
和selinux
,并保证能正常上网
2.添加opennms的yum源
rpm -Uvh http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm rpm --import http://yum.opennms.org/OPENNMS-GPG-KEY
3.安装软件包和依赖包
The following packages will be automatically installed: opennms: The platform meta package which handles all dependencies from OpenNMS repository. jicmp6 and jicmp: Java bridge to allow sending ICMP messages from OpenNMS repository. opennms-core: OpenNMS core services, e.g. Provisiond, Pollerd and Collectd from OpenNMS repository. opennms-webapp-jetty: OpenNMS web application from OpenNMS repository jdk1.8: Oracle Java SE Development Kit 8 environment from OpenNMS respository postgresql: PostgreSQL database server from distribution repository postgresql-libs: PostgreSQL database from distribution repository
我们知道,它依赖jdk1.8,postgresql,opennms-core,opennms-webapp-jetty
用yum
下载太慢了,我都是找到url
地址,用迅雷下载
,然后直接`上传
这里postgresql
我是yum
安装的
http://yum.opennms.org/stable/common/jdk/x64/jdk-8u60-linux-x64.rpm http://yum.opennms.org/stable/common/opennms/opennms-core-18.0.2-1.noarch.rpm http://yum.opennms.org/stable/common/opennms/opennms-webapp-jetty-18.0.2-1.noarch.rpm
下载完成后,上传
[root@opennms ~]# ls anaconda-ks.cfg opennms-core-18.0.2-1.noarch.rpm jdk-8u60-linux-x64.rpm opennms-webapp-jetty-18.0.2-1.noarch.rpm
这里我先安装的是postgreSQL
yum install -y postgresql postgresql-server
安装jdk
rpm -ivh jdk-8u60-linux-x64.rpm
安装opennms-core
yum localinstall -y opennms-core-18.0.2-1.noarch.rpm
安装opennms-webapp-jetty-
yum localinstall -y opennms-webapp-jetty-18.0.2-1.noarch.rpm
最后安装opennms
yum -y install opennms
检查安装
[root@opennms ~]# tree -L 1 /opt/opennms/ /opt/opennms/ ├── bin ├── contrib ├── data ├── deploy ├── etc ├── jetty-webapps ├── lib ├── logs -> /var/log/opennms ├── share -> /var/opennms └── system 10 directories, 0 files
安装已经完成,下面是部署配置
4.配置PostgreSQL
postgresql-setup initdb 初始化 systemctl enable postgresql 开机启动 systemctl start postgresql 启动 su - postgres 切换用户 createuser -P opennms 创建opennms用户,并设置密码,我设置的密码是opennms createdb -O opennms opennms psql -c "ALTER USER postgres WITH PASSWORD 'opennms';" 设置超级用户的密码也是opennms exit 回到root用户
修改pg_hba.conf
vi /var/lib/pgsql/data/pg_hba.conf 将下面的ident修改为md5 82 host all all 127.0.0.1/32 ident 83 # IPv6 local connections: 84 host all all ::1/128 ident 修改之后的效果 82 host all all 127.0.0.1/32 md5 83 # IPv6 local connections: 84 host all all ::1/128 md5
然后保存退出,平滑重启postgreSQL
systemctl reload postgresql
5.配置opennms
,并启动
个人文本有限,觉得还是官方
文档说的比较好,就直接贴上来了
编辑下面这个配置文件
vi /opt/opennms/etc/opennms-datasources.xml Configuration for database authentication in OpenNMS <jdbc-data-source name="opennms" database-name="opennms" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/opennms" user-name="** YOUR-OPENNMS-USERNAME **" password="** YOUR-OPENNMS-PASSWORD **" /> <jdbc-data-source name="opennms-admin" database-name="template1" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/template1" user-name="postgres" password="** YOUR-POSTGRES-PASSWORD **" /> Set the user name to access the OpenNMS database table Set the password to access the OpenNMS database table Set the postgres user for administrative access to PostgreSQL Set the password for administrative access to PostgreSQL
修改完成之后的效果
<jdbc-data-source name="opennms" database-name="opennms" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/opennms" user-name="opennms" password="opennms" /> <jdbc-data-source name="opennms-admin" database-name="template1" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/template1" user-name="postgres" password="opennms" /> /opt/opennms/bin/runjava -s /opt/opennms/bin/install -dis
等屏刷完
systemctl enable opennms systemctl start opennms
6.访问opennms
先看下本机的ip
[root@opennms ~]# hostname -I 192.168.56.139 所有我的地址是http://192.168.56.139:8980/opennms
初始账号密码两个admin
到此部署安装完成!