Tuning Nagios

In order to allow the Nagios system to run thousands of alert checks per minute, we needed to tune a few things in Nagios.

First we moved the database and program directories /var/lib and /usr/local over to a high speed EMC disk Array.

Create a RAM disk for Nagios tempory files

I created a ramdisk by adding the following entry to the /etc/fstab file:

none                              /mnt/ram                        tmpfs   size=500M           0 0

Mount the disk using the following commands

# mkdir -p /mnt/ram; mount /mnt/ram

Verify the disk was mounted and created

# df -k

Modify the /usr/local/nagios/etc/nagios.cfg file with the following tuned parameters

temp_file=/mnt/ram/nagios.tmp
temp_path=/mnt/ram
status_file=/mnt/ram/status.dat
precached_object_file=/mnt/ram/objects.precache
object_cache_file=/mnt/ram/objects.cache

IMPORTANT: Stop ALL Nagios processes including DB and postgres. 

Check for any Nagios process that are still running

ps -ef | grep -i nagios

Manually kill any Nagios processes that didn't stop

# kill <process ID>

# sudo /sbin/service nagios stop
# sudo /sbin/service npcd stop
# sudo /sbin/service ndo2db stop
# sudo /sbin/service nagiosxi stop
# sudo /sbin/service mysqld stop
# sudo /sbin/service postgresql stop
# sudo /sbin/service httpd stop

Restart all Nagios processes

# sudo /sbin/service mysqld start
# sudo /sbin/service postgresql start
# sudo /sbin/service nagios start
# sudo /sbin/service npcd start
# sudo /sbin/service ndo2db start
# sudo /sbin/service nagiosxi start
# sudo /sbin/service httpd start

Ensureall Nagios processes are all running by logging in the GUI console and clicking on "Admin"

Subject