Discussion:
How to connect correctly to postgresql 8.4
Juan Milano
2012-03-27 16:42:45 UTC
Permalink
Juan Milano [http://community.zenoss.org/people/milanojs] created the discussion

"How to connect correctly to postgresql 8.4"

To view the discussion, visit: http://community.zenoss.org/message/65537#65537

--------------------------------------------------------------
Hello there!

Im trying to monitor my postgresql 8.4 db server with the zenpack provided by Egor ( http://community.zenoss.org/docs/DOC-3497 http://community.zenoss.org/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 http://gregswallow.blogspot.com/2011/04/my-attempt-at-zenoss-postgresql-how-to.html) im using zenoss-core
| Zenoss (http://www.zenoss.com/) | Zenoss 3.2.1 |
| OS (http://www.tldp.org/) | Linux (x86_64) 2.6.32 (Linux gfpalmon01 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64) |
| Zope (http://www.zope.org/) | Zope 2.12.1 |
| Python (http://www.python.org/) | Python 2.6.2 |

------------------------
My ZenPack installed for postgresql
| ZenPacks.community.PgSQLMon_ODBC | community | Egor Puzanov | 2.2 | Yes |
| ZenPacks.community.RDBMS | community | Egor Puzanov | 2.2 | Yes |
| ZenPacks.community.SQLDataSource | community | Egor Puzanov | 1.6 | Yes |
| ZenPacks.community.ZenODBC | community | Egor Puzanov | 3.2 | Yes |
| ZenPacks.community.deviceAdvDetail | community | Egor Puzanov | 2.7 | Yes |
------------------------
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

***@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 Loading Image... http://imageshack.us/photo/my-images/207/zproperties.jpg Loading Image... http://img207.imageshack.us/img207/6168/zproperties.jpg

ZenModeler Pluggings --- Loading Image... 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
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65537#65537]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...