ramdisk script for nagios

Categories: Linux, Nagios, Script

to prevent the hard drive on the nagios server from thrashing around like a drunken idiot while running nagios, i set the status.dat file to reside in a ramdisk since that file gets read and written everytime that either a service,passive or host check goes through.

i put this little script in start up so if the machine goes down, when brought back up the ramdisk script would run first so that nagios can start without complaining.

to first check if the ramdisk module is loaded:
[devterm old]$ dmesg | grep RAM
BIOS-provided physical RAM map:
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize

this shows me that i have 16 ramdisks eacho of 16M size – i only need one.

/sbin/mke2fs -g -m 0 /dev/ram0
mount /dev/ram0 /usr/local/nagios/rd
chown nagios.nagios /usr/local/nagios/rd
chmod --reference=/usr/local/nagios/sbin /usr/local/nagios/rd/

once nagios is loaded with the status.dat file in ramdisk, you should run nagios with the “-s” option so it can give you help as to how to tweak your settings.


    Leave a Reply

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