On 2/25/07, David Carmean <[EMAIL PROTECTED]> wrote:
I see that there's a trac item open to create documentation for
zendmd; how's this coming along?
I've suddenly been tasked with a new application for zenoss: I need
to provide stripped-down usage stats for several thousand server
and client systems. I need to be able to programmatically
walk through the list of /Discovered devices after a zendisc run and
move the devices to various locations in the tree based on criteria
like whether snmp is configured and allows access to CPU load OIDs,
whether rpc.statd is enabled, etc.
I'm trying to get as much as I can without touching those systems,
so I'll have to collect the data by various means. For example,
the stock Solaris 2.8/2.9 snmp config doesn't give CPU load but
rpc.statd is enabled, so I've made a command template that uses
awk(1) to massage rup(1) output into nagios-plugin performance-data
format, and am storing that to the RRDs. On other systems I'll
have to use ssh.
So, given that I'm teaching myself Python in the process, where do
I start with zendmd?
David,
I can't comment on the status of the documentation, but I can steer
you towards the usage of zendmd. The best documentation of zendmd is
to look at the model's source under Products/ZenModel, but here are
some tips:
sourceClass = dmd.Devices.Discovered
# Loop through all devices in the source class.
for device in sourceClass.getSubDevices():
print "%s (%s)" % (device.id, device.manageIp)
# Is this a generic Sun agent?
if device.hw.getProductKey() == '.1.3.6.1.4.1.42.2.1.1':
print " - Generic Sun Agent"
# Re-classify the device if rpc.statd is running.
for process in device.os.processes():
if process.name().find('rpc.statd') >= 0:
sourceClass.moveDevices('/Devices/Server/Solaris/RPC',
device.id)
--
Chet Luther
[EMAIL PROTECTED]
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users