Discussion:
Adjusting Monitoring Plugin for Title
Adam Pilbeam
2012-12-04 21:11:17 UTC
Permalink
Adam Pilbeam [http://community.zenoss.org/people/sysadminadam] created the discussion

"Adjusting Monitoring Plugin for Title"

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

--------------------------------------------------------------
Hello all,

I'm working with Zenoss and monitoring Windows machines at the moment. I would like to be able to use the Device Map plugin to adjust the title field to reflect the WMI name pulled off the target machine. I have established my process by populating the SNMP SysName field from the WMI string, but I can't for the life of me figure out what term I need to use to populate (or, rather, change) the device title.


for e in results["Win32_ComputerSystem"]:
            model = e.model
            if not model: model = "Unknown"
            om.Title = e.Name


I have something like that at the moment; I've tried deviceTitle, Title, setTitle, etc. I'm not a big programmer so I'm sort of going along with whatever snippets of information I can find.

Thanks!

-Adam
--------------------------------------------------------------

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

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]
kb8u
2012-12-05 00:03:18 UTC
Permalink
kb8u [http://community.zenoss.org/people/kb8u] created the discussion

"Re: Adjusting Monitoring Plugin for Title"

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

--------------------------------------------------------------
Are you modifying /opt/zenoss/Products/DataCollector/plugins/zenoss/snmp/DeviceMap.py or creating your own DeviceMap modeler?

DISCLAIMER: I haven't tried this, and hacking on this code is a good way to completely hose up your zenoss install (so only try this on a test system you are willing to destroy and start over from scratch on).  Try this: getdata['setTitle'] = e.Name

I was hestitant to post this because the method it calls (if it even works, that is) says it reindexes and that may be the one thing you don't want to do while modeling, so heed the disclaimer.

I've had a couple of problems when the title is different than the device id.  Searches for the device title don't work reliably, and TCP port tests don't work unless the id is an IP address or a fully qualified domain name that resolves to an IP address.  Good luck!
--------------------------------------------------------------

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

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]
Adam Pilbeam
2012-12-05 13:32:22 UTC
Permalink
Adam Pilbeam [http://community.zenoss.org/people/sysadminadam] created the discussion

"Re: Adjusting Monitoring Plugin for Title"

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

--------------------------------------------------------------
It's acutally /opt/zenoss/Zenpacks/zenoss/WindowsMonitor/modeler/plugin/zenoss/wmi/WindowsDeviceMap.py that I'm editing at the moment - though I'm certainly open to editing anything else. I have a ''global name 'getdata' is not defined'' error when I run the modeler now.

The device IDs are populated with the FQDNs, but I wanted a more friendly title - and I also want to be able to look at a device and correlate the name of the machine (what the machine thinks it is) correlates to our reverse DNS lookups.

Thank you for the reply!
--------------------------------------------------------------

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

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]
kb8u
2012-12-06 23:00:03 UTC
Permalink
kb8u [http://community.zenoss.org/people/kb8u] created the discussion

"Re: Adjusting Monitoring Plugin for Title"

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

--------------------------------------------------------------
OK, I thought it was an SNMP based collector.  I see it's WMI now.  Looking at the code, I would have thought om.setTitle = e.Name would work (but I see you already tried that).

Are you confident that your for e in results["Win32_ComputerSystem"]loop is executing?  You can add a log.info('found %s in Win32_ComputerSystem loop',e.Name) statement to check.

I'm afraid that's about all the help I can give, I'm at the limit of my expertise on this subject.
--------------------------------------------------------------

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

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]
Adam Pilbeam
2012-12-11 14:08:32 UTC
Permalink
Adam Pilbeam [http://community.zenoss.org/people/sysadminadam] created the discussion

"Re: Adjusting Monitoring Plugin for Title"

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

--------------------------------------------------------------
The log.info entry returned the proper name; I guess it's just a matter of figuring out exactly what field to write to in order to get the title to change automatically. I appreciate the help!
--------------------------------------------------------------

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

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