Archived community.zenoss.org | full text search
Skip navigation
1434 Views 0 Replies Latest reply: Mar 30, 2012 10:40 AM by Juan Milano RSS
Juan Milano Rank: White Belt 6 posts since
Mar 27, 2012
Currently Being Moderated

Mar 30, 2012 10:40 AM

How to connect correctly to postgresql 8.4

Hello there!

 

Im trying to monitor my postgresql 8.4 db server with the zenpack provided by Egor (docs/DOC-3497) i follow all the recomendations that i have read, and installer the dependencies in correct order, furthermore i guided somethings form this post (http://gregswallow.blogspot.com/2011/04/my-attempt-at-zenoss-postgresql-how-to.html) im using zenoss-core

ZenossZenoss 3.2.1
OSLinux (x86_64) 2.6.32 (Linux xxxxxxxx 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64)
ZopeZope 2.12.1
PythonPython 2.6.2

 

------------------------

My ZenPack installed for postgresql

ZenPacks.community.PgSQLMon_ODBCcommunityEgor Puzanov2.2Yes
ZenPacks.community.RDBMScommunityEgor Puzanov2.2Yes
ZenPacks.community.SQLDataSourcecommunityEgor Puzanov1.6Yes
ZenPacks.community.ZenODBCcommunityEgor Puzanov3.2Yes
ZenPacks.community.deviceAdvDetailcommunityEgor Puzanov2.7Yes

------------------------

Mypostgresql Version:

*** 8.4.9-0squeeze1+b1 0 ---

"PostgreSQL 8.4.9 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit"

 

I have installed the unixodbc odbc-postgresql

 

My config Files, odbc.ini

# Driver from the MyODBC package

# Setup from the unixODBC package

#[MySQL]

#Description = ODBC for MySQL

#Driver = /usr/lib/libmyodbc.so

#Setup = /usr/lib/libodbcmyS.so

#FileUsage = 1

 

 

[DBQA]

Description = PostgreSQL

Driver = PostgreSQL ANSI

Trace = No

TraceFile = /var/log/psqlodbc-qa.log

Database = pg_query

Servername = xxxxxxxxxxxx

UserName = pg_query

Password = pg_query

Port = 5432

ReadOnly = no

RowVersioning = No

ShowSystemTables = Yes

ShowOidColumn = No

FakeOidIndex = No

ConnSettings =

SSLmode = require

UsageCount = 1

 

-----------------

Odbcinst.ini

/etc/odbcinst.ini

[PostgreSQL ANSI]

Description                    = PostgreSQL ODBC driver (ANSI version)

Driver                    = /usr/lib/odbc/psqlodbca.so

Setup                    = /usr/lib/odbc/libodbcpsqlS.so

Debug                    = 0

CommLog                    = 1

UsageCount                    = 1

 

 

[PostgreSQL Unicode]

Description                    = PostgreSQL ODBC driver (Unicode version)

Driver                    = /usr/lib/odbc/psqlodbcw.so

Setup                    = /usr/lib/odbc/libodbcpsqlS.so

Debug                    = 0

CommLog                    = 1

UsageCount                    = 1

 

#########################################3

Isql query output and connection from the zenoss server

 

zenoss@xxxxxx:/home/xxxxx$ isql DBQA pg_query pg_query

+---------------------------------------+

| Connected!                            |

|                                       |

| sql-statement                         |

| help [tablename]                      |

| quit                                  |

|                                       |

+---------------------------------------+

SQL> select * from pg_stat_activity;

+-----------+-----------------------------------------------------------------+------------+-----------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------------------------+---------------------------+---------------------------+---------------------------------------------------+------------+

| datid     | datname                                                         | procpid    | usesysid  | usename                                                         | current_query                                                                                                                                                                                                                                                                                               | waiting| xact_start                | query_start               | backend_start             | client_addr                                       | client_port|

+-----------+-----------------------------------------------------------------+------------+-----------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------------------------+---------------------------+---------------------------+---------------------------------------------------+------------+

| 11564     | postgres                                                        | 12447      | 10        | postgres                                                        | <IDLE>                                                                                                                                                                                                                                                                                                      | 0      |                           | 2012-03-27 11:27:33.824170| 2012-03-27 11:27:26.932954| x.x.x.x                                        | 41192      |

| 55397     | pg_query                                                        | 12448      | 10        | postgres                                                        | <IDLE>                                                                                                                                                                                                                                                                                                      | 0      |                           | 2012-03-27 11:27:27.255187| 2012-03-27 11:27:27.190267| x.x.x.x                                        | 41193      |

| 55397     | pg_query                                                        | 12696      | 55396     | pg_query                                                        | select * from pg_stat_activity;                                                                                                                                                                                                                                                                             | 0      | 2012-03-27 11:33:10.040466| 2012-03-27 11:33:10.040466| 2012-03-27 11:33:08.467963| x.x.x.x                                      | 49032      |

+-----------+-----------------------------------------------------------------+------------+-----------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------------------------+---------------------------+---------------------------+---------------------------------------------------+------------+

SQLRowCount returns 3

3 rows fetched

SQL>

***************************************************

ZProperties http://imageshack.us/photo/my-images/207/zproperties.jpghttp://img207.imageshack.us/img207/6168/zproperties.jpg

 

ZenModeler Pluggings http://img829.imageshack.us/img829/6080/plugginszenossmodeler.jpg--- http://img829.imageshack.us/img829/6080/plugginszenossmodeler.jpg

***************************************************

Moduler Output:

 

2012-03-27 11:46:31,081 INFO zen.ZenModeler: Connecting to localhost:8789

2012-03-27 11:46:31,095 INFO zen.ZenModeler: Connected to ZenHub

2012-03-27 11:46:31,148 INFO zen.ZenModeler: Collecting for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,295 INFO zen.ZenModeler: No WMI plugins found for xxx.xxx.xxx.xxx

2012-03-27 11:46:31,300 INFO zen.ZenModeler: Python collection device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,300 INFO zen.ZenModeler: plugins: community.odbc.PgSqlDatabaseMap

2012-03-27 11:46:31,315 INFO zen.ZenModeler: Using SSH collection method for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,315 INFO zen.ZenModeler: plugins: zenoss.cmd.linux.cpuinfo, zenoss.cmd.linux.memory, zenoss.cmd.linux.netstat_an, zenoss.cmd.linux.netstat_rn, zenoss.cmd.linux.process, zenoss.cmd.uname

2012-03-27 11:46:31,338 INFO zen.ZenModeler: SNMP collection device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,339 INFO zen.ZenModeler: plugins: zenoss.snmp.HRFileSystemMap, zenoss.snmp.HRSWInstalledMap, zenoss.snmp.HRSWRunMap, zenoss.snmp.InformantHardDiskMap, zenoss.snmp.NewDeviceMap, zenoss.snmp.NewRouteMap

2012-03-27 11:46:31,435 INFO zen.ZenModeler: No portscan plugins found for xxx.xxx.xxx.xxx

2012-03-27 11:46:31,435 INFO zen.ZenModeler: Running 3 clients

2012-03-27 11:46:31,572 ERROR zen.SQLClient: Received error (No data available.) from query: SELECT d.datname as dbname,

u.rolname as contact,

'Ver.'||current_setting('server_version') as version,

current_setting('block_size')::float as blocksize,

t.spcname as setdbsrvinst,

d.datallowconn::int as allowconn,

CASE d.datistemplate

WHEN True THEN 'PgSqlTemplate'

ELSE 'PgSqlDatabase'

END as type,

pg_database_size(d.datname)::float as totalblocks

FROM pg_database d,

pg_authid u,

pg_tablespace t

WHERE d.datdba=u.oid AND d.dattablespace=t.oid

2012-03-27 11:46:31,575 INFO zen.PythonClient: Python client finished collection for xxx.xxx.xxx.xxx

2012-03-27 11:46:31,575 ERROR zen.ZenModeler: Received error (No data available.) from query: SELECT d.datname as dbname,

u.rolname as contact,

'Ver.'||current_setting('server_version') as version,

current_setting('block_size')::float as blocksize,

t.spcname as setdbsrvinst,

d.datallowconn::int as allowconn,

CASE d.datistemplate

WHEN True THEN 'PgSqlTemplate'

ELSE 'PgSqlDatabase'

END as type,

pg_database_size(d.datname)::float as totalblocks

FROM pg_database d,

pg_authid u,

pg_tablespace t

WHERE d.datdba=u.oid AND d.dattablespace=t.oid

2012-03-27 11:46:31,576 INFO zen.ZenModeler: No change in configuration detected

2012-03-27 11:46:31,743 INFO zen.SshClient: SshClient connected to device xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)

2012-03-27 11:46:31,843 INFO zen.CmdClient: command client finished collection for xxx.xxx.xxx.xxx

2012-03-27 11:46:31,844 INFO zen.ZenModeler: Collecting routes for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,844 INFO zen.ZenModeler: Processing the OS uname info for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,844 INFO zen.ZenModeler: Collecting CPU information for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,845 INFO zen.ZenModeler: Collecting memory and swap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,845 INFO zen.ZenModeler: Processing zenoss.cmd.linux.process for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,850 INFO zen.ZenModeler: Modeler zenoss.cmd.linux.netstat_an processing data for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,936 INFO zen.SnmpClient: snmp client finished collection for xxx.xxx.xxx.xxx

2012-03-27 11:46:31,937 INFO zen.ZenModeler: Modeler zenoss.snmp.HRFileSystemMap processing data for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,937 INFO zen.ZenModeler: Skipping Swap space (virtualMemory) as it matches zFileSystemMapIgnoreTypes.

2012-03-27 11:46:31,938 INFO zen.ZenModeler: Skipping /proc/xen. 0 total blocks.

2012-03-27 11:46:31,938 INFO zen.ZenModeler: Skipping Physical memory (ram) as it matches zFileSystemMapIgnoreTypes.

2012-03-27 11:46:31,939 INFO zen.ZenModeler: Skipping Cached memory (other) as it matches zFileSystemMapIgnoreTypes.

2012-03-27 11:46:31,939 INFO zen.ZenModeler: Skipping Memory buffers (other) as it matches zFileSystemMapIgnoreTypes.

2012-03-27 11:46:31,939 INFO zen.ZenModeler: processing zenoss.snmp.HRSWInstalledMap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,940 INFO zen.ZenModeler: Processing zenoss.snmp.HRSWRunMap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,946 WARNING zen.ZenModeler: Skipping process with no name

2012-03-27 11:46:31,947 INFO zen.ZenModeler: processing zenoss.snmp.InformantHardDiskMap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,947 INFO zen.ZenModeler: Processing zenoss.snmp.NewDeviceMap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:31,948 INFO zen.ZenModeler: processing zenoss.snmp.NewRouteMap for device xxx.xxx.xxx.xxx

2012-03-27 11:46:32,740 INFO zen.ZenModeler: Changes in configuration applied

2012-03-27 11:46:32,741 INFO zen.ZenModeler: Changes in configuration applied

2012-03-27 11:46:32,860 INFO zen.ZenModeler: Scan time: 1.71 seconds

2012-03-27 11:46:32,870 INFO zen.ZenModeler: Daemon ZenModeler shutting down

 

 

 

 

PLEASE HELPME! And! sorry for my bad english, and please moderator feel free to move every where if u need it

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points