sni / mod_gearman

Distribute Naemon Host/Service Checks & Eventhandler with Gearman Queues. Host/Servicegroups affinity included.
http://www.mod-gearman.org
GNU General Public License v3.0
122 stars 42 forks source link

No support for Nagios 4.x? #85

Closed deepak-kosaraju closed 8 years ago

deepak-kosaraju commented 8 years ago

@sni Recently I came to know that mod_gearmanv2 doesn't support Nagios Core 4.x.

## Top of your Readme shows this ##
* Mod-Gearman 1.x works with Nagios 3
 * Mod-Gearman 2.x works with Naemon (and might work with Nagios 4)

but at the bottom it shows this,

Use Mod-Gearman 1 if you still use the Nagios Core. Preferable version 3.2.3 or 3.5.1. Nagios core is not supported anymore. Use Naemon if you plan to upgrade to Nagios 4.

But naemon has no release since March 2015 and I don't see much active development in community for naemon.


I tried to complie from source but I received following error.

checking naemon/naemon.h usability... no
checking naemon/naemon.h presence... no
checking for naemon/naemon.h... no
configure: error: Compiling Mod-Gearman requires naemon.h (hint: install naemon-dev pkg)

So I searched and replaced all neamon to nagios and I was able to compile but failed with following error when building using make

[root@px-nagios-app004 mod_gearman_nagios4]# make
make  all-am
make[1]: Entering directory `/opt/nagios4-packages/brokers/mod_gearman_nagios4'
depbase=`echo neb_module/result_thread.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    gcc -DHAVE_CONFIG_H -I.  -Iinclude   -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -s -DDATADIR='"/opt/nagios4-packages/brokers/mod_gearmand_lib_from_source/share"' -MT neb_module/result_thread.o -MD -MP -MF $depbase.Tpo -c -o neb_module/result_thread.o neb_module/result_thread.c &&\
    mv -f $depbase.Tpo $depbase.Po
In file included from include/result_thread.h:30,
                 from neb_module/result_thread.c:26:
include/mod_gearman.h:69: error: expected declaration specifiers or '...' before 'nebmodule'
In file included from neb_module/result_thread.c:28:
include/mod_gearman.h:69: error: expected declaration specifiers or '...' before 'nebmodule'
neb_module/result_thread.c:40: warning: initialization from incompatible pointer type
make[1]: *** [neb_module/result_thread.o] Error 1
make[1]: Leaving directory `/opt/nagios4-packages/brokers/mod_gearman_nagios4'
make: *** [all] Error 2

Can you share your plans to support Nagios Core 4.x, I downloaded the rpm packages for v2.1.3 Nagios crashes when I submit PASSIVE results using mk-livestatus complied for Nagios 4.x.

1: /tmp/core-nagios-11-5028-5028-32050-1455053698
Feb  9 16:13:27 px-nagios-app003 kernel: nagios[32220]: segfault at 7f1a9c6157d8 ip 00007f1a9aa4f3e8 sp 00007f1a9c6157e0 error 6 in mod_gearman2.o[7f1a9aa3f000+1c000]

Program terminated with signal 11, Segmentation fault.
#0  0x00007f82c0e313e8 in handle_svc_check () from /usr/lib64/mod_gearman2/mod_gearman2.o

Nagios is not crashing if I comment the mod_gearman2 broker in nagios.cfg and just enable mk-livestatus and submit PASSIVE results.

I also downloaded new version but it throws following error, where it doesn't even start Nagios https://labs.consol.de/repo/stable/rhel6/x86_64/mod_gearman2-2.1.5-1.rhel6.x86_64.rpm

## Error loading Nagios with v2.1.5 ##
[1455064773] Error: Could not load module '/usr/lib64/mod_gearman2/mod_gearman2.o' -> /usr/lib64/mod_gearman2/mod_gearman2.o: undefined symbol: nm_log
[1455064773] Error: Failed to load module '/usr/lib64/mod_gearman2/mod_gearman2.o'.

_mod_gearman is a great assert for scaling Nagios in huge production environments and it served community for entire Nagios Core 3.x, so can we get the glory back to serve for Nagios Core 4.x community._

mclarkson commented 8 years ago

+1

I did want to move to Naemon but after looking at Naemon issues it is barely supported - not something I can install professionally. I will need mod-gearman soon so I had saved the following information for packages that the OP said worked together a little while ago.

Nagios 4.1.1 gearmand-devel-0.33-4.x86_64 gearmand-0.33-4.x86_64 mod_gearman2-2.1.3-1.el6.x86_64 gearmand-server-0.33-4.x86_64

I hope the above works and the versions are still somewhat valid.

deepak-kosaraju commented 8 years ago

@mclarkson Thanks for your comment... I am using same version you listed above with mk-livestatus-1.2.6p15. If I run following command to submit PASSIVE check to Nagios its crashing with following segfault. If I comment gearman broker in nagios.cfg and just enable livestatus broker then Nagios doesn't CRASH.

Are you saying that its not the case on your end?

echo "COMMAND [$(date +%s)] PROCESS_SERVICE_CHECK_RESULT;global;service100;2;CRITICAL - we need help, I hate mod_gearman" | nc nagios1.example.com 6557
Core was generated by `/usr/bin/nagios -d /etc/nagios/nagios.cfg'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f73cd0a5905 in __strftime_internal () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install gearmand-0.33-2.x86_64 glibc-2.12-1.149.el6_6.5.x86_64 libgcc-4.4.7-3.el6.x86_64 libstdc++-4.4.7-3.el6.x86_64 libuuid-2.17.2-12.9.el6.x86_64 mk-livestatus-1.2.6p15-1.x86_64 mod_gearman2-2.1.3-1.el6.x86_64 sssd-client-1.9.2-82.el6.x86_64
mclarkson commented 8 years ago

I have not tried the combination I described. I'd saved them in my notes for when I do need them - I got them from the mod_gearman or Thruk newsgroup, I can't remember which.

It would be really great if mod_gearman gets back to supporting Nagios. Naemon looks plain dead but Sven uses it, and knows the Naemon guys, so that's good for him but unfortunately no one else. (If you look you'll see he even ends up supporting Naemon!!). The main Naemon developer left Nagios on bad terms and now that Thruk is bundled with Naemon it might be politically incorrect for mod_gearman to support Nagios. The problem is, the longer it's left, the harder it will be to get it working again.

Please get mod_gearman back with Nagios - it's still a de-facto industry standard!

sni commented 8 years ago

Right now i have no ressources to support Nagios4 or Naemon and all our customers still use Nagios 3. Also the situation with Mod-Gearman 1.x and 2.x is not ideal, i would like to move things into configure options to build the neb module for the different cores. Patches in that direction would be helpful.

mclarkson commented 8 years ago

Note that Nagios 4 is the default for Centos 7, and it's in the testing repo for Centos 6. It's still Nagios3 for debian and ubuntu. Message received for help required!

sni commented 8 years ago

Help would be much appreciated. If anyone has time to work on this, please get in touch with me to coordinate things a bit.

deepak-kosaraju commented 8 years ago

@sni I wish I know C programming. Looking at your comment's above it appears there is no plan in near future to provide support for Nagios4.x unless someone like @mclarkson finds time to help with code changes. Sorry to know that you have no resources to support Nagios4 (or) Naemon. I thought you support Naemon as you have good relation with Andreas Ericsson and you made code changes to look for naemon headers for mod_gearman-v2.x.

At this point I have no option other than missing mod_gearman with Nagios Core 4.x. I have to redo my entire nagios architecture to address scaling issue which was handled using mod_gearman 1.x and Nagios Core 3.x until now.

Hope you (or) someone will find time to port mod_gearman v2.x to work with Nagios Core 4.x and I am counting my days for it.

Thanks for your time, support & help to OpenSource Monitoring Community.

sni commented 8 years ago

All i am saying was, i have very little spare time right now. I am still working on and with these tools in my daily job. But so far there is no Nagios 4 there. This might change, but i don't know when.

mclarkson commented 8 years ago

@jklre have you tried it with livestatus? If that also works then I'd be happy.

@kkdk5535 did you try changing the module order in nagios.cfg? This was an issue for me a few years ago, segfaulted if I put them in the "wrong" order.

jm101093 commented 8 years ago

Yes it works with livestatus. :)

On Feb 18, 2016, at 10:00 AM, Mark Clarkson notifications@github.com wrote:

@jklre have you tried it with livestatus? If that also works then I'd be happy.

@kkdk5535 did you try changing the module order in nagios.cfg? This was an issue for me a few years ago, segfaulted if I put them in the "wrong" order.

— Reply to this email directly or view it on GitHub.

BoomerET commented 8 years ago

Here's the line in nagios.log with those 4 RPM's installed: Error: Could not load module '/usr/lib/mod_gearman/mod_gearman.o' -> /usr/lib/mod_gearman/mod_gearman.o: wrong ELF class: ELFCLASS32

mclarkson commented 8 years ago

@BoomerET, try the X86_64 rpms: http://mod-gearman.org/download/v1.4.0nagios4/rhel6/x86_64/

It's quite old though, 2012-09-24.

BoomerET commented 8 years ago

That works, but receiving passive results still crashes Nagios. (Granted, it took about 30 seconds this time instead of immediately) (Entry from /var/log/messages) Feb 18 16:51:38 pink_pingpong_balls kernel: nagios[37066]: segfault at 7fb468fa97d8 ip 00007fb46739a76c sp 00007fb468fa97e0 error 6 in mod_gearman.o[7fb467389000+1c000]

BoomerET commented 8 years ago

Yes, I removed the 32 bit, installed the 64 bit, made the change in nagios.cfg from lib to lib64.

Nagios restarted just fine, but as you can see from my paste from /var/log/messages, passive checks for whatever reason, crashed mod_gearman (I'm baffled, makes no sense to me)

jm101093 commented 8 years ago

What version of nagios are you running? I'm running nagios xi just fine. I'm seeing a similar segfault on one of my systems and one is working fine. The only difference is the one that's failing is a 32 bit system I upgraded to the latest version of nagios xi. Check_mk. The one where everything is working is a x64 bit system with a clean install. Same nagios config (servers / monitors / plugins) on both. Both are centOS. The working one is centOS 6.5 the failing one is centOS 5.

On Feb 18, 2016, at 1:55 PM, David Berkompas notifications@github.com wrote:

That works, but receiving passive results still crashes Nagios. (Granted, it took about 30 seconds this time instead of immediately) (Entry from /var/log/messages) Feb 18 16:51:38 pink_pingpong_balls kernel: nagios[37066]: segfault at 7fb468fa97d8 ip 00007fb46739a76c sp 00007fb468fa97e0 error 6 in mod_gearman.o[7fb467389000+1c000]

— Reply to this email directly or view it on GitHub.

BoomerET commented 8 years ago

We're running Nagios Core 4.1.1 on RHEL6 boxes.

sni commented 8 years ago

i openend a discussion about nagios 4 on the mailing list: https://groups.google.com/forum/#!topic/mod_gearman/_paz9unEzYY If someone is interested in supporting nagios 4, please speak up there.

ashirel commented 8 years ago

hi j.m. , how did u get livestatus running on nagios 4.1.1? i'm running on debian8 and whenever try to load the livestatus.o i get:

Error: Could not load module '/usr/lib/check_mk/livestatus.o' -> file not found Error: Failed to load module '/usr/lib/check_mk/livestatus.o'. Error: Module loading failed. Aborting.

looks like i'm using the same version of livestatus as u use:

/omd/versions/1.2.6p16.cre/lib/mk-livestatus# ls -l /usr/lib/check_mk/livestatus.o -rwxr-xr-x 1 nagios www-data 486596 Mar 12 17:34 /usr/lib/check_mk/livestatus.o

any hints would be appreciated. tnx, ams