加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

icinga2+postgresql

发布时间:2020-12-13 16:46:04 所属栏目:百科 来源:网络整理
导读:icinga2+postgresql postgresql10下载网址: http://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-6-x86_64/ 需先下载postgresql10-10.0、postgresql10-server、postgres10-contrib、postgresql10-libs、icinga2-ido-pgsql 安装rpm -i 略

icinga2+postgresql


postgresql10下载网址:

http://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-6-x86_64/



需先下载postgresql10-10.0、postgresql10-server、postgres10-contrib、postgresql10-libs、icinga2-ido-pgsql


安装rpm -i 略(提示有依赖可以--nodeps),redhat postgresql的安装路径为/var/lib/pgsql/10/data


# rsync -av /usr/pgsql-10/bin/* /usr/bin/


创建账号和数据库:


# /etc/init.d/postgresql-10 initdb

# /etc/init.d/postgresql-10 start

# su - postgres

$ psql

# create user "icinga2" with password 'xxxxx';

# create database "icinga2" with owner='icinga2''

#q

$ exit


# vi /var/lib/pgsql/10/data/pg_hba.conf (设置postgres对所有数据库为peer认证方式,icinga2账号对icinga2数据库为md5认证方式)


local all postgres peer

local all icinga2 md5

host all icinga2 md5

:wq

# /etc/init.d/postgresql-10 restart


导入icinga2的sql结构:

# psql -U icinga2 -d icinga2 < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql


启用ido-pgsql.conf


# vi /etc/icinga2/features-enabled/ido-pgsql.conf


library "db_ido_pgsql"


object IdoPgsqlConnection "ido-pgsql" {

user = "icinga2"

password = "xxxxxx"

host = "localhost"

database = "icinga2"

}


:wq

# icinga2 feature enable ido-pgsql


最后重启icinga2即可

# service icinga2 restart

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读