TECHZEN Zenoss User Community ARCHIVE  

Porblem with Zenoss 5 Transform

Subject: Porblem with Zenoss 5 Transform
Author: [Not Specified]
Posted: 2016-03-23 03:08

Hi,

recently I came up with zenoss 3 to 5.0. I tried to use the same transforms as in 3 versions zenoss. But none of them no longer works. What is the problem Changed syntax
Two examples of transforms:

In triggers action command -curl --data 'chat_id='xxxx --data-urlencode 'text=''{"${device/summary}", "${device/Location}", "${device/SnmpLocation}", "${device/message}", "${device/firstTime}"}' 'https://api.telegram.org/xxxx/sendMessage'

And transform for link down/up events:

import re
device = dmd.Devices.findDevice(evt.device)
index = getattr(evt, 'ifIndex', 0)
descr = getattr(evt, 'ifDescr', '')

evt.component = descr
evt.deviceSnmpLocation = device.snmpLocation
evt.deviceName = device.titleOrId()
if device:
description = ''
for iface in device.os.interfaces():
if index and iface.ifindex == index:
descr = iface.description
elif descr and iface.name == descr:
descr = iface.description
int = getattr(evt, 'component', '')
evt.summary = "Port " + int + " is down!"
evt.message = "Port " + int + " is down!"


Subject: I've found transforms are
Author: [Not Specified]
Posted: 2016-03-23 16:21

I've found transforms are flaked in 5.0, especially when using the "Reclassify an event" button in the main Event console....especially when using the "Reclassify an Event" button in the main console. Try updating to 5.1; I've found that transforms are more reliable in that version than in 5.0 for us.



Subject: If you continue to see issues
Author: Andrew Kirch
Posted: 2016-03-24 10:56

If you continue to see issues in 5.1 please report each as a bug. Thanks!

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: I fixed the problem with a
Author: [Not Specified]
Posted: 2016-03-25 10:33

I fixed the problem with a transform link down / up. it works

But the problem with the trigger command using Curlremains.

Now there was another problem. In zenoss 3I created a custom datapointand draw a graph, as a result of this setting I could use a transform in the form device.getRRDValue ( 'name'). InZenoss 5 rrdis not used. How, then use these custom parameters(datapoints) in the transforms



Subject: I would like to know as well
Author: [Not Specified]
Posted: 2016-03-26 20:34

I would like to know as well if the syntax of device.getRRDValue has changed for 5.x since RRD is no longer the database used. Is the old RRD syntax still in use or was it replaced by something else

Manuel



Subject: I found in Zenoss 5.0 how to
Author: [Not Specified]
Posted: 2016-03-30 11:12

I found in Zenoss 5.0 how to get a custom setting getRRDValuesin zendmd. But it does not work intransforms.Inthe logsI seethis error:

2016-03-30 15:13:02,994 ERROR zen.MetricMixin: Unable to collect metric values for /zport/dmd/Devices/Network/Switch/xxx/devices/myrouter
Traceback (most recent call last):
File "/opt/zenoss/Products/ZenModel/MetricMixin.py", line 93, in getRRDValues
extraRpn=extraRpn, cf=cf)
File "/opt/zenoss/Products/Zuul/facades/metricfacade.py", line 148, in getValues
results = self.queryServer(context, metrics, start=start, end=end, format=format, extraRpn=extraRpn, cf=cf, returnSet=returnSet, downsample=downsample)
File "/opt/zenoss/Products/Zuul/facades/metricfacade.py", line 207, in queryServer
response = self._post_request( self._uri(METRIC_URL_PATH), request)
File "/opt/zenoss/Products/Zuul/facades/metricfacade.py", line 318, in _post_request
timeout=timeout, cookies=self._authCookie)
File "/opt/zenoss/lib/python2.7/site-packages/requests/sessions.py", line 425, in post
return self.request('POST', url, data=data, **kwargs)
File "/opt/zenoss/lib/python2.7/site-packages/requests/sessions.py", line 383, in request
resp = self.send(prep, **send_kwargs)
File "/opt/zenoss/lib/python2.7/site-packages/requests/sessions.py", line 486, in send
r = adapter.send(request, **kwargs)
File "/opt/zenoss/lib/python2.7/site-packages/requests/adapters.py", line 378, in send
raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: ///api/performance/query (Caused by : [Errno 111] ECONNREFUSED)



Subject: Everyone,
Author: [Not Specified]
Posted: 2016-04-21 02:54

Everyone,

It's not working in the transforms because the transforms are running in a container that doesn't have the neccesarry endpoint access to hit the datastorage backend. Technically it's possible to adjust the zeneventd template definition to grant it the correct endpoint access. Email me if you're interested in that.

Generally speaking it's not a good idea to grab metric data in a transform. While it does work please use extra case. It really can dramatically tie up the system at the worst of times. :)

If anyone needs custom development or consulting don't hesitate to reach out!

Take care!

ZenMaster Shane William Scott (Hackman238)

CTO

GoVanguard Inc.

sscott@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



< Previous
Zenoss 5 and WinRM
  Next
LDAP+Zenoss Core 4.2.5+CentOS 6
>