TECHZEN Zenoss User Community ARCHIVE  

Transform ZepConnectionError issue

Subject: Transform ZepConnectionError issue
Author: [Not Specified]
Posted: 2016-01-13 22:21

Hi,

We are wanting to use transforms to suppress events based on the device status. One example of this is sometime events come through for SNMP being down, when the whole device is actually down

In the transform if we use

device.getPingStatus()

When an event comes in and the transform runs it is throwing:

ZepConnectionError: Could not connect to service.

The strange part is if we manually run "zeneventd run" it runs through fine without throwing any exceptions

Full example of transform:

#Suppress events if the device is not pingable
if getattr(evt, 'severity', 0) > 0 and getattr(evt, 'eventClass', '/Unknown') == '/Status/Snmp':
ping_state = device.getPingStatus()

mydedupid = "%s|%s|%s|%s|%s" % (evt.device,evt.component,evt.eventClass,evt.severity,evt.summary)
evt.dedupid = mydedupid #Keep dedupid id the same (changing summary affects it)

if ping_state > 0:
#suppress
evt.eventState = 2
evt.summary += " (down)"
elif evt.eventState == 2:
#unsuppress event if previously supressed and now is up
evt.eventState = 0

Running Zenoss Core 5.0.9. We were previously on 5.0.6 and have just upgraded to try and resolve the issue but it is still there

Any clues would be greatly appreciated!

Thanks



Subject: update
Author: [Not Specified]
Posted: 2016-01-14 23:06

Had a better look at this and the issue appears to be that zeneventd can't access port 8084 (from zeneventserver)

I am guess this is by design in the new version of zenoss with docker

Is there any an alternative way of running device.getPingStatus() now from a transform rule

Alternatively how can you forward 8084 from the zeneventserver service to zeneventd service

# serviced service attach zeneventd
[root@400866192eb3 /]# netstat -lpnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22350 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:5042 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:5043 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:8444 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:5672 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1/serviced
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 1/serviced

Thanks!



Subject: I got around this by linking
Author: [Not Specified]
Posted: 2016-01-17 20:02

I got around this by linking 8084 from zeneventserver to zeneventd

edit eventd service
# serviced service edit eventd

added the following under Endpoints

{
"Name": "zep",
"Purpose": "import",
"Protocol": "tcp",
"PortNumber": 8084,
"PortTemplate": "",
"VirtualAddress": "",
"Application": "zep",
"ApplicationTemplate": "",
"AddressConfig": {
"Port": 0,
"Protocol": ""
},
"VHosts": null
},

restart eventd for it to apply
# serviced service restart eventd



Subject: Follow up
Author: Paul Manno
Posted: 2016-05-05 12:59

Hello,

I'm having a similar problem where I cannot get a "real" value for getPingStatus(). When I call it, it returns 0 always, suggesting the device is up, when it is not. Wondering if I'm having the same issue you were having and I'm trying to figure out what file you edited to allow you to add the endpoint.

It looks like you have a serviced commmand somewhere, and I don't have that... If you could let me know what file holds the Endpoints, that would be a great help.

Thanks.

Paul



< Previous
Does Zenoss 5 support WMI?
  Next
Custom SSH monitor
>