Skip to content

Instantly share code, notes, and snippets.

@cluther
Created January 30, 2015 15:34
Show Gist options
  • Save cluther/f631a61e571765a058b4 to your computer and use it in GitHub Desktop.
Save cluther/f631a61e571765a058b4 to your computer and use it in GitHub Desktop.
Zenoss: Show WebTx datasource details.
#!/usr/bin/env zendmd
#
# Print details of all WebTx datasources.
from Products.Zuul.interfaces import ICatalogTool
from ZenPacks.zenoss.ZenWebTx.datasources.WebTxDataSource import WebTxDataSource
catalog = ICatalogTool(dmd.Devices)
for result in catalog.search(WebTxDataSource):
datasource = result.getObject()
template = datasource.rrdTemplate()
label = "{} - {}".format(template.getUIPath(), datasource.id)
print "--[ {} ]{}".format(label, "-" * (73 - len(label)))
print "Initial URL: {}".format(datasource.initialURL)
print "Initial User: {}".format(datasource.initialUser)
print "Timeout: {}".format(datasource.webTxTimeout)
print "Interval: {}".format(datasource.cycletime)
if datasource.commandTemplate:
print "Twill Script:"
print
print datasource.commandTemplate
else:
print "Twill Script: n/a"
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment