Bobcares

Segmentation fault in Nagios – How to resolve

by | Mar 26, 2021

Wondering how to fix the segmentation fault in Nagios? We can help you.

A segmentation fault (segfault) is a common condition that causes programs to crash. Often they are caused by a program trying to read or write an illegal memory location. In Nagios XI versions 5.4.0 and 5.4.1, there was a bug in the Nagios Core version that lead to a segmentation fault in some systems.

Here at Bobcares, we often get requests from our customers to fix these segmentation faults in their Nagios as a part of our Server Management Services.

Today let’s see how our Support Engineers fix this issue for our customers.

How to fix Segmentation fault in Nagios

Segfault occurs when a program attempts to access memory that is either not been assigned to it by the operating system, or not allowed to access.

Before going into the steps to fix this issue we will see what causes it.

Typical causes of a segmentation fault:

The following are  some of the typical causes of a segmentation fault:

1. Attempting to access a nonexistent memory address (outside process's address space)

2. Attempting to access memory the program does not have rights to (such as kernel structures in process context)

3. Attempting to write read-only memory (such as code segment)

Following are the steps to fix this issue

Firstly, we will take a backup before making any changes so that we can revert it if something goes wrong.

For creating a backup of Nagios XI system from the command line, open a terminal or SSH session and log into Nagios XI server as the root user.

We can create a backup of Nagios XI installation by running the following script:

/usr/local/nagiosxi/scripts/backup_xi.sh

A successful backup will complete with the following message:

===============
BACKUP COMPLETE
===============

Backup is stored in /store/backups/nagiosxi/1479858443.tar.gz

This will fix the bug in the Nagios core version. After that, we can run the following commands to fix the segfault issue on a running 5.4.0 or 5.4.1 system.

We can download the file “ndoutils_segfault_patched.tar.gz” from the URL given below:

https://support.nagios.com/kb/file.php?id=30

Finally, we need to transfer this file to the Nagios XI server and run the following commands from the directory containing the patch:

# service nagios stop
# killall -9 nagios
# service ndo2db stop
# service mysqld restart
# for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
# tar zxf ndoutils_segfault_patched.tar.gz
# cd ndoutils_segfault_patched
# ./upgrade

[Need Assistance? We are available 24*7]

Conclusion

To conclude we saw how our Support Engineers fix the Segmentation fault in Nagios for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.