Memory leaks in Nagios Core 4.3.4

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vlakshman
Posts: 27
Joined: Tue Aug 21, 2018 11:03 am

Memory leaks in Nagios Core 4.3.4

Post by vlakshman »

Hi Guys,

Am using Nagios 4.3.4 which works fine most of the time but on odd occasions end up with errors seen below.

Nagios logs
(Return code of 12 is out of bounds : (No output on stdout) stderr: execvp(python, ...) failed. errno is 12: Cannot allocate memory))

(Return code of 7 is out of bounds : (No output on stdout) stderr: execvp(python, ...) failed. errno is 7: Argument list too long))

(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: libdl.so.2: cannot create shared object descriptor: Cannot allocate memory))
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: libc.so.6: cannot create shared object descriptor: Cannot allocate memory))
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: cannot allocate symbol search list: Cannot allocate memory))
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: libc.so.6: cannot map zero-fill pages: Cannot allocate memory))
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: cannot allocate symbol search list: Cannot allocate memory))
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: python: error while loading shared libraries: libdl.so.2: failed to map segment from shared object: Cannot allocate memory))

httpd logs look like below
[Tue Feb 05 17:03:20.477479 2019] [cgi:error] [pid 17656] (12)Cannot allocate memory: [client 209.78.42.241:62962] couldn't create child process: 12: tac.cgi
[Tue Feb 05 17:03:20.479178 2019] [cgi:error] [pid 17656] (12)Cannot allocate memory: [client 209.78.42.241:62962] AH01223: couldn't spawn child process: /usr/lib64/nagios/cgi-bin/tac.cgi
[Tue Feb 05 17:20:32.064283 2019] [cgi:error] [pid 29369] (12)Cannot allocate memory: [client 209.78.42.241:53292] couldn't create child process: 12: status.cgi
[Tue Feb 05 17:20:32.066149 2019] [cgi:error] [pid 29369] (12)Cannot allocate memory: [client 209.78.42.241:53292] AH01223: couldn't spawn child process: /usr/lib64/nagios/cgi-bin/status.cgi
[Tue Feb 05 17:20:32.073165 2019] [cgi:error] [pid 11652] (12)Cannot allocate memory: [client 223.237.224.147:17725] couldn't create child process: 12: status.cgi
[Tue Feb 05 17:20:32.073269 2019] [cgi:error] [pid 11652] (12)Cannot allocate memory: [client 223.237.224.147:17725] AH01223: couldn't spawn child process: /usr/lib64/nagios/cgi-bin/status.cgi
Any thoughts?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Memory leaks in Nagios Core 4.3.4

Post by benjaminsmith »

Hello @vlakshman,

The current version is 4.4.3 and there have been many improvements. I would recommend upgrading to the latest version.

How to Upgrade Nagios Core
https://assets.nagios.com/downloads/nag ... ading.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
vlakshman
Posts: 27
Joined: Tue Aug 21, 2018 11:03 am

Re: Memory leaks in Nagios Core 4.3.4

Post by vlakshman »

Hey Benjaminsmith,

Thanks for your reply!

1) Are the errors reported by me are truly Memory Leaks in Nagios?
2) If yes, is there a way of knowing what's causing it?
3) All these memory related error occur occasionally and I don't see a pattern.

Thanks again!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Memory leaks in Nagios Core 4.3.4

Post by benjaminsmith »

Hello @vlakshman,

You can view the changelog for Nagios Core here:
https://github.com/NagiosEnterprises/na ... /Changelog

I would start by enabling debugging and debug verbosity, then review or tail the log files.
Debug Level
Format: debug_level=<#>
Example: debug_level=24
This option determines what type of information Nagios should write to the debug_file. This value is a logical OR of the values below.
-1 = Log everything
0 = Log nothing (default)
1 = Function enter/exit information
2 = Config information
4 = Process information
8 = Scheduled event information
16 = Host/service check information
32 = Notification information
64 = Event broker information
Refer to the documentation for the Nagios Core configuration file:
https://assets.nagios.com/downloads/nag ... gmain.html

When debugging is enabled you can watch the log live.

Code: Select all

tail -f /usr/local/nagios/var/nagios.debug
Please note that I'm not aware any memory leaks in the current version, and these types of issues are difficult to replicate and debug.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked