zenoss/ZenPacks.zenoss.PostgreSQL — Issue #4: "postgres failure: float division" when running on a new database
Author: szpak
Created: 2012-03-09 15:43:17+00:00
State: open

Hi,

When I tried to use ZenPacks.zenoss.PostgreSQL on a quite new/empty database I've got "postgres failure: float division". I suspect there is no check for 0 on some value. I modified poll_postgres.py to get some stact trace and when running via "Test Against Device" I've got:

Preparing Command...
Executing command $ZENHOME/libexec/poll_postgres.py <***> server against <***>
File "/opt/zenoss/libexec/poll_postgres.py", line 187, in printJSON
data = self.getData()
File "/opt/zenoss/libexec/poll_postgres.py", line 125, in getData
databases = pg.getDatabaseStats()
File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.PostgreSQL-1.0.3-py2.6.egg/ZenPacks/zenoss/PostgreSQL/util.py", line 172, in getDatabaseStats
xactRollbackPct = (float(row[4]) / xactTotal) * 100
*** float division *** print_tb: {"events": [{"eventClassKey": "postgresFailure", "summary": "postgres failure: float division", "severity": 4, "eventKey": "postgresFailure"}]}
DONE in 1 seconds

ZenPacks.zenoss.PostgreSQL 1.0.3 (for Python 2.6)
zenoss-3.2.0-1258.el5
PostgreSQL 9.1

Regards
Marcin