RHEL 6.4, tmpfs and OMD: can’t find /omd/sites/… in /etc/fstab or /etc/mtab

Hint: The following issue has been fixed by a RHEL / CentOS patch (util-linux-ng) – just update your system!

If you want to install Open Monitoring Distribution on RHEL or CentOS 6.4, you might have the problem that creating sites isn’t working as expected:

# omd create test
Adding /omd/sites/test/tmp to /etc/fstab.
Creating temporary filesystem /omd/sites/test/tmp...mount: can't find /omd/sites/test/tmp in /etc/fstab or /etc/mtab
ERROR

Starting sites isn’t working either:

# omd start test
Creating temporary filesystem /omd/sites/test/tmp...mount: can't find /omd/sites/test/tmp in /etc/fstab or /etc/mtab
ERROR
Starting dedicated Apache for site test...OK
Starting rrdcached...OK
Starting npcd...touch: cannot touch `/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory
chown: cannot access `/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory
An Error occured while reading your config on line 197
Message was: "Could not open pidfile '/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory"
OK
/omd/sites/test/etc/rc.d/80-nagios: line 58: /omd/sites/test/tmp/nagios/nagios.cfg: No such file or directory
Nagios configuration file /omd/sites/test/tmp/nagios/nagios.cfg not found. Terminating...
Initializing Crontab...OK

While searching for a solution I discovered the following thread in the check_mk mailing list: http://comments.gmane.org/gmane.network.nagios.checkmk.german/1694.

It seems that this issue is forced by the latest RHEL / CentOS 6.4 update: https://bugzilla.redhat.com/show_bug.cgi?id=917678.

The OMD script (/usr/bin/omd) creates for the /tmp directory tree of sites ramdisks – these disks contain temporary files and pidfiles. To implement this, appropriate lines – with symbolic links for path names – in /etc/fstab are created.

With the latest 6.4 update enabled, lines in /etc/fstab mustn’t contain symbolic path names. Additional modifying the affected line does not fix this issue because the ramdisk is mounted during the omd create command – because of this, the omd start command is also causing an error.

This problem can be fixed by modifying line 747 in the file /usr/bin/omd – you just have to add /opt to ensure that no symbolic links are used:

file("/etc/fstab", "a+").write("tmpfs  /opt%s tmpfs noauto,user,mode=755,uid=%s,gid=%s 0 0n" % 

I created a patch file for this so that you can apply this change easily: omd.patch

# wget http://blog.christian-stankowic.de/wp-content/uploads/2013/03/omd.patch_.txt
# cd /usr/bin
# cp omd omd.initial
# patch < /PATH/omd.patch_.txt

Now creating OMD sites is working again:

# omd create test
Adding /omd/sites/test/tmp to /etc/fstab.
Creating temporary filesystem /omd/sites/test/tmp...OK
Created new site test with version 0.56.

Starting sites is also working without errors:

# omd start test
Starting dedicated Apache for site test...OK
Starting rrdcached...OK
Starting npcd...OK
Starting nagios...OK
Initializing Crontab...OK

🙂

Sharing is caring

Leave a Reply