Discussion:
MS SQL Database Monitor zenpack, modeling and custom properties
jeronimo
2013-02-05 17:43:42 UTC
Permalink
jeronimo [http://community.zenoss.org/people/jeronimo] created the discussion

"MS SQL Database Monitor zenpack, modeling and custom properties"

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

--------------------------------------------------------------
I'm having a problem that's a weird interaction between several things.  I installed the MS SQL Database Monitor zenpack and got it working just fine.  However, I wanted to avoid having to hardcode the username/password for the sql login I created for the monitoring.  I also wanted to give it a different password.  Plus, since I could use a domain user (since the linux box isn't on the domain, sql wouldn't allow integrated logins for domain users), I needed it to use a username that was just "username" instead of "domain\username".  So what I wanted to do was set up custom properties for this.

I created and populated two custom properties:
cSqlUsername
cSqlPassword

I changed the zenpack's zMsSqlConnectionString config property to:
'pyodbc',driver='FreeTDS', host='${here/manageIp}', port='1433', database='master', uid='${here/cSqlUsername}', pwd='${here/cSqlPassword}'

And that worked great for the sql monitoring.  I was still getting data.  I also added a SQL datasource to do some monitoring on some data in one of our tables and used the same connectionstring.  Again, worked great.

The problem comes in when the device is re-modeled.  I get this:

2013-02-05 10:22:03,650 INFO zen.ZenModeler: Connecting to localhost:8789
2013-02-05 10:22:03,656 INFO zen.ZenModeler: Connected to ZenHub
2013-02-05 10:22:03,845 INFO zen.ZenModeler: Collecting for device schlitz
2013-02-05 10:22:04,453 INFO zen.ZenModeler: No WMI plugins found for schlitz
2013-02-05 10:22:04,460 INFO zen.ZenModeler: Python collection device schlitz
2013-02-05 10:22:04,460 INFO zen.ZenModeler: plugins: community.sql.MsSqlDatabaseMap
2013-02-05 10:22:04,461 ERROR zen.ZenModeler: Unable to fill collection slots: [Failure instance: Traceback (failure with no frames): <class 'Products.ZenUtils.ZenTales.InvalidTalesException'>: Error when processing tales expression string:'pyodbc',driver='FreeTDS', host='${here/manageIp}', port='1433', database='master', uid='${here/cSqlUsername}', pwd='${here/cSqlPassword}' on context <Products.DataCollector.DeviceProxy.DeviceProxy instance at 0x6d76ea8> : Exception Class <class 'zope.location.interfaces.LocationError'> Message: (<Products.DataCollector.DeviceProxy.DeviceProxy instance at 0x6d76ea8>, 'cSqlUsername')
]

As you can see, it's choking on the custom property cSqlUsername.  It doesn't appear to be able to see custom properties at all.

Is this a bug in the zenpack or in zenoss?  Considering that the ZP otherwise works great with that connectionstring, it seems like zenoss.  Am I just stuck with this unless I patch some files?  Any other thoughts?
--------------------------------------------------------------

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

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...