patrickpr / trapdirector

Icingaweb2 module for receiving and handling snmp traps
GNU General Public License v3.0
53 stars 15 forks source link

trap handler fails for hostgroup #40

Closed lazyfrosch closed 4 years ago

lazyfrosch commented 4 years ago

Get debug logs

[2020/07/06 10:12:52] [TrapDirector] [Error]: Connection failed to IDO : invalid data source name
[2020/07/06 10:12:52] [TrapDirector] [Warning]: Exception : [TrapDirector] [Error]: Connection failed to IDO : invalid data source name

Describe the bug

setupIDO seems to be executed to be used by hostgroups, should only happen when an Icinga 2 API connection is configured.

The culprit should be:

https://github.com/patrickpr/trapdirector/blob/ba4b05e5c09eadfd21ac319a3f989747b42a125e/library/Trapdirector/TrapsProcess/TrapConfig.php#L176

We should setup the IDO data regardless of if the API is configured here.

Your Environment:

patrickpr commented 4 years ago

Hi,

Thanks for pointing this, seems this is why hostgroup wasn't working.

I'll update master ASAP and make a new release.

Patrick

patrickpr commented 4 years ago

Released 1.0.4b version correcting this. For your information, I am going to get rid of direct IDO queries and only use Icinga API in next versions. (related to issue #39 )

Keeping this open as I need to add hostgroups rules check in travis-ci to be sure it won't happen again.

Patrick

patrickpr commented 4 years ago

Version 1.0.4c should correct this : please tell me if all is ok now.

patrickpr commented 4 years ago

Closing issue. Reopen in case of related problems.