微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

icinga2+postgresql

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

原文地址:https://www.jb51.cc/postgresql/193450.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐