<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>froztbyte.getBlog() &#187; infra</title>
	<atom:link href="http://blog.froztbyte.net/tag/infra/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.froztbyte.net</link>
	<description>returns the contents of froztbyte.blog</description>
	<lastBuildDate>Fri, 03 Apr 2020 21:58:55 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Zenoss Device Listing</title>
		<link>http://blog.froztbyte.net/2012/10/zenoss-device-listing/</link>
		<comments>http://blog.froztbyte.net/2012/10/zenoss-device-listing/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 09:23:43 +0000</pubDate>
		<dc:creator><![CDATA[froztbyte]]></dc:creator>
				<category><![CDATA[minipost]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[infra]]></category>
		<category><![CDATA[inventory]]></category>
		<category><![CDATA[zenoss]]></category>

		<guid isPermaLink="false">http://blog.froztbyte.net/?p=326</guid>
		<description><![CDATA[Nice for if you need some form of automated report in zenoss, here&#8217;s a code snippet to print out a list of devices per class, formatted in markdown markup typehash = {} for d in dmd.Devices.getSubDevices(): if typehash.has_key(d.getDeviceClassPath()) == False: &#8230;<p class="read-more"><a href="http://blog.froztbyte.net/2012/10/zenoss-device-listing/">Read more &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<p>Nice for if you need some form of automated report in zenoss, here&#8217;s a code snippet to print out a list of devices per class, formatted in <a href="http://daringfireball.net/projects/markdown/">markdown</a> markup</p>
<pre>typehash = {}
for d in dmd.Devices.getSubDevices():
    if typehash.has_key(d.getDeviceClassPath()) == False:
        typehash[d.getDeviceClassPath()] = []
    typehash[d.getDeviceClassPath()].append(d.viewName())

for key in typehash:
    print """### %s\n""" % (key)
    for item in typehash[key]:
        print "*   %s\n" % (item)
    print ""</pre>
<p>Run it in the zenoss console, or anything with a dmd connection. Tested on 2.5.x, but should be trivial to port forward if it breaks.</p>
<p>(PS: I could probably fix up that last bit to do something with .iteritems() instead&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.froztbyte.net/2012/10/zenoss-device-listing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
