PostgeSQLのデータベース監視について
PostgeSQLについて、データベース監視(ODBCを利用した)を実施。
以下のエラーが表示され、取得不可となった。
『設定』→『アイテム』のエラー項目
failed connection [[unixODBC]Missing server name, port, or database name in call to CC_connect.] (201)
設定した条件としては以下の通りです。
?
【odbc.ini】
[postgres_i]
Description = Postgres Database
Driver = PostgreSQL
Database = postgres
Server = 127.0.0.1
Port = 5432
?
【odbcinst.ini】
# Included in the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1
?
『ユーザーpostgresでデータベースpostgres
へログイン可能』
-bash-3.2$ psql -U postgres -d postgres
Welcome to psql 8.1.18, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#
?
『設定』→『アイテム』の設定項目は以下のとおりです。
タイプ
データベースモニタ
キー
db.odbc.select[postgresql_session]
追加パラメータ
DSN=postgres_i
user=postgres
password=postgres
sql=SELECT count(*) FROM pg_stat_activity
? OSは
Asianux Server 3 ==MIRACLE LINUX V5
? zabbixサーバーのバージョンは1.6.4です。
TNK - 投稿数: 4671
odbc.iniの内容を以下のようにしてみて下さい。
<code>
[postgres_i]
Description = Postgres Database
Driver = PostgreSQL
Database = postgres
Servername = 127.0.0.1
Port = 5432
</code>
そして、
<code>
isql postgres_i ユーザ名 パスワード
</code>
で接続できるか確認してみてください。
takega - 投稿数: 20
odbc.iniのServernameを以下のようにしたら、取得できました。
Servername = localhost
ありがとうございました。