Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've set Zenoss 4.2.3 to get devices from our entire network from all subnets (INFRASTRUCTURE -> DEVICES). But it returns me the device list only with the IP address, it doesn't obtain the hostnames from both Windows and Linux machines.

How can I config it to obtain the names of the machines?

share|improve this question
    
Does your DNS resolve the device IPs correctly? –  jscott May 7 '13 at 16:44
    
Yes. We are inside a domain. –  tenshimsm May 7 '13 at 16:51
    
Heh, I do remember fiddling with it, do not recall exact solution, but it is definitely out there. Some settings for WUI some sort. –  Danila Ladner May 7 '13 at 17:59
    
:) Haha, I did not find, yet, the setting for that. :( –  tenshimsm May 7 '13 at 19:33

2 Answers 2

up vote 2 down vote accepted

"But it returns me the device list only with the IP address"

Do you mean in the infrastructure tab or are you referring to the emails from a notifier?

If in the notifier, there is a bug in Zenoss 4.2 where the device.id is used instead of device.title in email notifications.

To fix, put the following transform into the root "/" event class.

d = dmd.Devices.findDevice(evt.device)
if d is not None:
  evt.device_title = d.title
else:
  evt.device_title = d.id

and then in your notification "Content" tab, use the following

Message (subject) Format: [zenoss] **${evt/device_title}** - ${evt/summary}
Body Format: 

Location: ${evt/zenoss.device.groups}
Device: **${evt/device_title}**
Component: ${evt/component}
Severity: ${evt/sevword}
Time: ${evt/lastTime}

Message:

${evt/message}

a href="${urls/eventsUrl}">Device Events

a href="${urls/eventUrl}">Event Detail

a href="${urls/ackUrl}">Acknowledge

a href="${urls/closeUrl}">Close

Hope this helps.

share|improve this answer

I spent hours researching this yesterday and hopefully I can save someone some pain. I discovered two answers for this, and we'll start with the easy one.

No transforms required

In the Notification Content tab, simply replace

${evt.device}

with

${eventSummary/actor/element_title}

Discovered via: http://community.zenoss.org/message/71252#71252
(thanks to Philip Warren)
 

Using transforms

Ophir's answer above will work for real events, but I discovered that it will not work for any manually created (a.k.a. test) events. The Transform itself will parse properly, but, for whatever reason, test events cannot properly parse custom attributes used in the Notification Contents and will fail with an "Unable to perform TALES evaluation" error. This makes it difficult to test custom attributes, so hopefully Zenoss will fix this soon.

I would also recommend changing the last line of his transform, otherwise it might fail when "d" is not found. Here's the full reworked Transform code:

d = dmd.Devices.findDevice(evt.device)
if d is not None:
  evt.device_title = d.title
else:
  evt.device_title = evt.device.title

Discovered via: http://www.eventenrichment.com/zenoss-event-enrichment-5-min-less
 

Um... How do I Transform anything?

For those that haven't done it before (like me, as of yesterday) you do not need to use Zope to get to the Transform area. Just follow these steps in Zenoss to add a Transform to the Root Event:

  1. Click on Events > Event Classes
  2. Click on the bottom-left gear
  3. Click on Transform
  4. Type the code in to the Transform field area
  5. Click Save

If you feel like using Zope instead (because "Danger" is your middle name) then you can browse to http[s]://yourserver.com[:port]/zport/dmd/Events/manage and then click on the Properties tab to get to the Transform field.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.