[PATCH] for nagios 3.x to speed up send_nsca (in parallel)

Sielski, Wojciech wsielski at team.mobile.de
Wed Feb 27 14:58:36 CET 2013


Hi there

We have one main Nagios server that receive plenty passive checks
from many satellites Nagios serveres - in each datacenter one.
We had a lot of Nagios performance issues in our very big environment
(more than 900 hosts, more than 13000 services).

Performance was connected with (forwarding) sending
passive check from satellite to master Nagios.
Script which is responsible for that is executed
 for each send passive check
./contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca
and makes that other checks are queued till script finished.
-> overall it causes Nagios scheduled queue
was more than 30 minutes behind.


Trick is to use '&' and STDOUT to /dev/null
I know this is a workaround / proof of concept
(ideal solution would be to have 'send_nsca ­-b'
- run in background as an option)
but this workaround will help also for any previous Nagios version.


Here is a patch to make sending more parallel and makes Nagios realtime
again. I hope you like it:

---
./contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca
    2008-11-30 18:22:59.000000000 +0100
+++ fix/submit_check_result_via_nsca    2013-02-20 16:28:48.497742097 +0100
@@ -32,8 +32,11 @@
NscaCfg="/usr/local/nagios/etc/send_nsca.cfg"
NagiosHost="nagioshost"
+Debug="/var/log/nagios3/send_via_naca.log"
+#Debug="/dev/null"
+
# Fire the data off to the NSCA daemon using the send_nsca script
-$printfcmd "%s\t%s\t%s\t%s\n" "$1" "$2" "$3" "$4" | $NscaBin -H
$NagiosHost -c $NscaCfg
+$printfcmd "%s\t%s\t%s\t%s\n" "$1" "$2" "$3" "$4" | $NscaBin -H
$NagiosHost -c $NscaCfg >> $Debug &
# EOF

----------------
Wojciech Sielski
Site Ops Engineer
mobile.international GmbH
www.mobile.de

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list