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:

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

Starting sites isn't working either:

 1# omd start test
 2Creating temporary filesystem /omd/sites/test/tmp...mount: can't find /omd/sites/test/tmp in /etc/fstab or /etc/mtab
 3ERROR
 4Starting dedicated Apache for site test...OK
 5Starting rrdcached...OK
 6Starting npcd...touch: cannot touch `/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory
 7chown: cannot access `/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory
 8An Error occured while reading your config on line 197
 9Message was: "Could not open pidfile '/omd/sites/test/tmp/pnp4nagios/run/npcd.pid': No such file or directory"
10OK
11/omd/sites/test/etc/rc.d/80-nagios: line 58: /omd/sites/test/tmp/nagios/nagios.cfg: No such file or directory
12Nagios configuration file /omd/sites/test/tmp/nagios/nagios.cfg not found. Terminating...
13Initializing 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:

1file("/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

1# wget https://cstan.io/files/2013/03/omd.patch_.txt
2# cd /usr/bin
3# cp omd omd.initial
4# patch < /PATH/omd.patch_.txt

Now creating OMD sites is working again:

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

Starting sites is also working without errors:

1# omd start test
2Starting dedicated Apache for site test...OK
3Starting rrdcached...OK
4Starting npcd...OK
5Starting nagios...OK
6Initializing Crontab...OK

🙂

Translations: