RAM disk and processes not auto starting after reboot

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
paul.jobb
Posts: 167
Joined: Tue Aug 02, 2011 4:37 pm

RAM disk and processes not auto starting after reboot

Post by paul.jobb »

Hi;

I ran the following: http://assets.nagios.com/downloads/nagi ... ramdisk.sh , on a brand new XI vm image however the nagios and npcd services don't want to auto start on a reboot. I was hoping you might have a suggestion as to how to correct that.

Thanks,

Paul
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RAM disk and processes not auto starting after reboot

Post by lmiltchev »

Did you use the VMware VM or the vSphere OVF template? 32- or 64-bit? Can you post the "/etc/sysconfig/nagios" and the "/etc/init.d/nagios" files for a review?
Be sure to check out our Knowledgebase for helpful articles and solutions!
paul.jobb
Posts: 167
Joined: Tue Aug 02, 2011 4:37 pm

Re: RAM disk and processes not auto starting after reboot

Post by paul.jobb »

it was the ovf template 64 bit: nagiosxi-2014r2.7-64.ova
etc.zip
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RAM disk and processes not auto starting after reboot

Post by lmiltchev »

I was able to recreate the issue. It is a bug. :(

I will be working on modifying the script. For the time being, here's a solution. Add the following line to the "/etc/sysconfig/nagios" file right below the "RAMDISK_SIZE=xxx" line. See an example below:
USE_RAMDISK=1
RAMDISK_DIR=/var/nagiosramdisk
RAMDISK_SIZE=500
mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
...
Reboot your system and see if nagios and npcd will start OK. Let me know if this fixed your issue. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
paul.jobb
Posts: 167
Joined: Tue Aug 02, 2011 4:37 pm

Re: RAM disk and processes not auto starting after reboot

Post by paul.jobb »

yes they auto started, does show up as being mounted twice though i'm not sure if that matters
Capture.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RAM disk and processes not auto starting after reboot

Post by lmiltchev »

I am sorry, one more change was needed. We need to mount the ramdisk only if it is not mounted already. As is, it will add a new mountpoint on each reboot. :(

Replace the mount line:

Code: Select all

mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
in the /etc/sysconfig/nagios with this:

Code: Select all

if [ "`mount |grep "${RAMDISK_DIR} type tmpfs"`"X == "X" ]; then
        mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
fi
Reboot again, wait for a several seconds, then check:

Code: Select all

service nagios status
service npcd status
df -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
paul.jobb
Posts: 167
Joined: Tue Aug 02, 2011 4:37 pm

Re: RAM disk and processes not auto starting after reboot

Post by paul.jobb »

looks good now, both services are running and only one ramdisk, thank you for your help I appreciate it.
Capture.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: RAM disk and processes not auto starting after reboot

Post by hsmith »

paul.jobb wrote:looks good now, both services are running and only one ramdisk, thank you for your help I appreciate it.
Capture.JPG
Do you want us to close this topic, or do you want to leave it open for just a little longer in case this comes back?
Former Nagios Employee.
me.
paul.jobb
Posts: 167
Joined: Tue Aug 02, 2011 4:37 pm

Re: RAM disk and processes not auto starting after reboot

Post by paul.jobb »

I think its fine to close
Locked