Can Zabbix OEC support multiple integrations?
Asked by DMC:

Have Zabbix v5.0 w/ OEC v1.1.4 ... the config.json only allows for a single api_Key, yet we need Zabbix to notify multiple different application teams. I know that we can specify a responder in the call to send2opsgenie, but the issue is all other teams are stuck with the integration settings the primary integration uses, which in my case suppresses alerts. Thus, all other teams have their alerts suppressed.

I attempted to setup a 2nd OEC agent, with a separate config.json. When I start it, I get an error stating it is unable to bind to a tcp port (as the primary oec process has it bound). I'm finding no documentation or way to specify a secondary port for it to listen on. Nor am I sure it would even work bound to a different port.


Answers:
author: Connor Eyles
body: Hi [@DMC](/t5/user/viewprofilepage/user-id/4462664)

Yes, you can run multiple OEC services on a single host :smile:

When it comes to setting up your secondary OEC to run on another port here are some steps on how you can do this:

Linux {#toc-hId--1240966424}
----------------------------

### Editing the Linux service {#toc-hId--550404950}

1. Edit **/etc/systemd/system/oec_custom.service** change the line `ExecStart=/usr/local/bin/OpsgenieEdgeConnector` add the parameter **--oec-metrics with a unique port value** (the default value is 7070) for example`ExecStart=/usr/local/bin/OpsgenieEdgeConnector --oec-metrics 7071`

2. Edit **/etc/systemd/system/oec_custom.service** change the line `Environment="OEC_CONF_LOCAL_FILEPATH=/home/opsgenie/oec/conf/config.json"` edit it to reflect the new path of config.json `Environment="OEC_CONF_LOCAL_FILEPATH=/home/opsgenie/oec/conf/config.json"` (See the paths highlighted green in the screenshots below)

3. Lastly, enable the service to start after system boot: `systemctl enable oec_custom`

![Image 2021-07-05 at 2.41.47 pm](https://p-25foddj.b0.n0.cdn.getcloudapp.com/items/JruDeyl1/947b7254-3dba-491a-81c8-267a6b3f208a.jpg?source=viewer&v=e3a3fd451b6f0b0414ae0226361f2d3a) {#toc-hId--560908054}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

![Image 2021-07-05 at 2.42.57 pm](https://p-25foddj.b0.n0.cdn.getcloudapp.com/items/L1uBv65E/330d2da9-96d4-4eb3-89aa-3bac7b73acb6.jpg?source=viewer&v=f514de4cb40904381dd775fb215fd751)

Windows {#toc-hId-1926604779}
-----------------------------

### Creating a new Windows Service {#toc-hId--1677801043}

Edit `oecService64.json` update the **service name** (highlighted pink), **oec-metrics port** (highlighted green) and **update the file paths** to reflect the new folder's path (highlighted blue).  
![Image 2021-07-05 at 2.47.29 pm](https://p-25foddj.b0.n0.cdn.getcloudapp.com/items/Apuzge8r/91cfdde9-c47e-4382-9a2c-8fd550105abe.jpg?v=34633aa35d8414aba9dd835615ee1068)  
![Image 2021-07-05 at 2.47.44 pm](https://p-25foddj.b0.n0.cdn.getcloudapp.com/items/Wnux6ZKY/5b014134-2d44-415d-853b-a7974870644d.jpg?v=98a595cfb26b2f32819c0801003c583f)  
Install and start the new service:

```
cd "c:\opsgenie\oec_custom"
.\oecService64.exe install
.\oecService64.exe start
```

Thanks,  
Connor

comments: author: DMC
body: Thanks Connor. Appreciate the timely response.

Here's what I've learned, while testing this. I'm not sure you need multiple OEC agents running. I found that the OEC agent is only used during INBOUND communications. I was under the impression that the send2opsgenie command was using it for outbound.

Seems the OpsGenie integration can be selected by specifying the '-apiKey=xxxxx' flag to my 'send2opsgenie' command.

The other observation, was than while running two OEC agents, there was no difference. Both agents seem to be pulling from the same OpsGenie cloud queue. Such that when an event/alert is acknowledged both of them would attempt to action it.

At this point, I don't believe I see a need to have more than a single OEC agent. However, I certainly appreciate the response Connor.


author: Connor Eyles
body: Hi [@dmc](/t5/user/viewprofilepage/user-id/454128)

You are correct, OEC is used for inbound communication. Glad to hear you got this one working regardless!  

The above steps are how you can run multiple OEC agents on different ports :smile:  

Thanks,  
Connor


Tags: cloud