dav3860 / vmbix

Fork of vmbix, a TCP proxy for querying a VMWare infrastucture with Zabbix
53 stars 19 forks source link

VMBIX Crashing Zabbix v3.4.2 Proxy #49

Closed boyemillar closed 6 years ago

boyemillar commented 6 years ago

I can run vmbix command and this returns values but when trying the start the Loadable module via my Zabbix Proxy it crashes my proxy

whosgonna commented 6 years ago

Similar (same?) problem here. The problem looks to occur when issuing a command for a counter item. counter.list, and counter.discovery work but if i do:

zabbix_get -s 127.0.0.1 -p 12050 -k esx.counter.discovery[esxihost101.mydomain.com,rescpu.actpk1.latest]

The return is:

zabbix_get [49599]: Check access restrictions in Zabbix agent configuration

From the proxy log:

 49185:20171008:212208.250 In get_value() key:'vmbix[vm.counter,{HOST.HOST},disk.busResets.summation,eui.d49a4e8dc19bdf836c9ce900f11712b9,300]'
 49185:20171008:212208.251 In get_value_simple() key_orig:'vmbix[vm.counter,{HOST.HOST},disk.busResets.summation,eui.d49a4e8dc19bdf836c9ce900f11712b9,300]' addr:'10.10.179.21'
 49185:20171008:212208.251 Got signal [signal:11(SIGSEGV),reason:1,refaddr:0x30]. Crashing ...
 49185:20171008:212208.252 ====== Fatal information: ======
dav3860 commented 6 years ago

There were some changes in the communication libraries between Zabbix 3.4.1 and 3.4.2. This impacts the VmBix module. I'll publish a new version with the fix soon.

dav3860 commented 6 years ago

This was an issue with the building system and Zabbix 3.4.2. I have published a v1.1.31 (https://bintray.com/dav3860/generic/vmbix-zabbix-module/1.1.31#files), which should fix this issue.

whosgonna commented 6 years ago

I'm using FreeBSD for my proxy, so the pre-compiled module in the link provided does not work (cannot load module "vmbix.so": Shared object "libc.so.6" not found, required by "vmbix.so").

I did clone the git repository for the module and compiled it (this has worked for me in the past), and the resulting module has the same crash issue as reported here (program counter not available for this architecture). I compiled from both the zabbix_3.4 and the test_3.4.4_rc1 branches with the same result. Am i building the wrong code?

clutchy commented 6 years ago

Can you please explain how did you come to this conclusion, why wouldn't the module work without --enable-ipv6. Thank you.

whosgonna commented 6 years ago

That is the error message in the zabbix proxy log when i load the preconfigured module from the link above (https://bintray.com/dav3860/generic/download_file?file_path=vmbix-zabbix-module-1.1.31-zabbix-3.4.tar.gz specifically). My proxy is compiled with ipv6. Here's the log when i use the pre-compiled module:

 63251:20171023:115654.277 **** Enabled features ****
 63251:20171023:115654.277 SNMP monitoring:       YES
 63251:20171023:115654.277 IPMI monitoring:        NO
 63251:20171023:115654.277 Web monitoring:        YES
 63251:20171023:115654.277 VMware monitoring:      NO
 63251:20171023:115654.277 ODBC:                  YES
 63251:20171023:115654.277 SSH2 support:          YES
 63251:20171023:115654.277 IPv6 support:          YES
 63251:20171023:115654.277 TLS support:           YES
 63251:20171023:115654.277 **************************
 63251:20171023:115654.277 using configuration file: /usr/local/etc/zabbix34/zabbix_proxy.conf
 63251:20171023:115654.277 cannot load module "vmbix.so": Shared object "libc.so.6" not found, required by "vmbix.so"
 63251:20171023:115654.277 loading modules failed, exiting...

Also, i don't think libc.so.6 is related to ipv6. From some googling, it looks like it's used in FreeBSD's Linux compatability layer. This is why i was compiling the module myself. If I use the module I've compiled, then I'll have something like this in the event look (looking to be when the vmbix module is called). I think this is the same error i was observing in the pre-3.4 module.

 44516:20171023:094620.328 Got signal [signal:11(SIGSEGV),reason:1,refaddr:0x0]. Crashing ...
 44516:20171023:094620.328 ====== Fatal information: ======
 44516:20171023:094620.328 program counter not available for this architecture
 44516:20171023:094620.328 === Registers: ===
 44516:20171023:094620.328 register dump not available for this architecture
 44516:20171023:094620.328 === Backtrace: ===
 44514:20171023:094620.329 Got signal [signal:11(SIGSEGV),reason:1,refaddr:0x0]. Crashing ...
 44514:20171023:094620.329 ====== Fatal information: ======
 44514:20171023:094620.329 program counter not available for this architecture
 44514:20171023:094620.329 === Registers: ===
 44514:20171023:094620.329 register dump not available for this architecture
 44514:20171023:094620.329 === Backtrace: ===
 44516:20171023:094620.340 3: 0x473feb <zbx_log_fatal_info+0x9b> at /usr/local/sbin/zabbix_proxy
 44516:20171023:094620.340 2: 0x47440b <zbx_set_common_signal_handlers+0x29b> at /usr/local/sbin/zabbix_proxy
 44516:20171023:094620.340 1: 0x803ca579d <pthread_sigmask+0x50d> at /lib/libthr.so.3
 44516:20171023:094620.340 0: 0x803ca4d6f <pthread_getspecific+0xe9f> at /lib/libthr.so.3
 44516:20171023:094620.340 === Memory map: ===
 44516:20171023:094620.340 memory map not available for this platform
 44516:20171023:094620.340 ================================
 44499:20171023:094620.341 One child process died (PID:44516,exitcode/signal:1). Exiting ...
 44514:20171023:094620.342 3: 0x473feb <zbx_log_fatal_info+0x9b> at /usr/local/sbin/zabbix_proxy
 44514:20171023:094620.342 2: 0x47440b <zbx_set_common_signal_handlers+0x29b> at /usr/local/sbin/zabbix_proxy
 44514:20171023:094620.342 1: 0x803ca579d <pthread_sigmask+0x50d> at /lib/libthr.so.3
 44514:20171023:094620.342 0: 0x803ca4d6f <pthread_getspecific+0xe9f> at /lib/libthr.so.3
 44514:20171023:094620.342 === Memory map: ===
 44514:20171023:094620.342 memory map not available for this platform
 44514:20171023:094620.342 ================================
dav3860 commented 6 years ago

No, the issue was basically related to the compilation in a Travis-CI image. It started to fail recently. So I recompiled the module on a Centos 7. Also, --enable-ipv6 seems to be necessary since the modifications in the zbxcomms library between v3.4.1 and v3.4.2.

whosgonna commented 6 years ago

Ah - I think i see. Before compiling the vmbix module, Instead of:

./configure --with-openssl

It needs to be

./configure --with-openssl --enable-ipv6

Is this correct?

clutchy commented 6 years ago

Yes that was the fix for the module, it must have something to do with the macros

whosgonna commented 6 years ago

Would you like a PR with the documentation change? It's really just updating 1 line in the readme, so it kind of feels like overkill to have a PR.

dav3860 commented 6 years ago

I've added it. Thank you for this.

boyemillar commented 6 years ago

Thanks for fixing this @dav3860... I've only just got round to testing it and it is working on v3.4.4 of Zabbix too.