Created
January 30, 2015 15:34
-
-
Save cluther/f631a61e571765a058b4 to your computer and use it in GitHub Desktop.
Zenoss: Show WebTx datasource details.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 datasource.commandTemplate | |
else: | |
print "Twill Script: n/a" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment