OSSEC文档——输出告警到PostgreSQL

前端之家收集整理的这篇文章主要介绍了OSSEC文档——输出告警到PostgreSQL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
翻译:http://ossec-docs.readthedocs.io/en/latest/manual/output/pgsql-database-outout.html

输出告警到Postgresql

数据库设置

在pgsql中创建ossec用户
$ sudo -u postgres createuser -D -A -P ossec_user
Enter password for new role:
Enter it again:
Shall the new role be allowed to create more new roles? (y/n) n
CREATE ROLE
创建数据库
$ sudo -u postgres createdb -O ossec_user ossecdb
CREATE DATABASE
创建必要的表
$ psql -h 127.0.0.1 -U ossec_user -d ossecdb -f postgresql.schema
OSSEC设置

在/var/ossec/etc/ossec.conf添加<database_output>标签
<ossec_config>
    <database_output>
        <hostname>192.168.2.30</hostname>
        <username>ossecuser</username>
        <password>ossecpass</password>
        <database>ossec</database>
        <type>postgresql</type>
    </database_output>
</ossec_config>

启用数据库守护进程,并重新启动ossec,以使更改生效

# /var/ossec/bin/ossec-control enable database
# /var/ossec/bin/ossec-control restart

猜你在找的Postgre SQL相关文章