Thursday, August 23, 2012

# check_mk install linux # check_mk installation on rhel 6

check_mk Installation on RHEL 6.3

Now then, I suppose some of you must have had troubles with installing OMD unto your open source distros. I had installed this on RHEL 5.7 and on RHEL 6.3 and by comparison it worked better on RHEL 6.3 that it did on 5.7 because of some bug in the python lib in the former. I was told by check_mk techie that I had to downgrade the python on 5.7 to accommodate the back-dated libraries. Here's the link to view the bug, although the bug says its applicable to older 32-bit distro I had more or less the same python libraries errors showing up in my /var/log/httpd/error_log with 64-bit 5.7

First things first, the VM guy did a very basic RHEL installation for me (with gnome of course). By default I had SElinux policy Enforced (more on this later) and firewall turned on (here's the kicker I had totally overlooked)

So I did what it says on the installation page, I downloaded omd-0.54 for RHEL 6 from their download page



After configuring network connection and registering the server with RHN network (please use legacy registration method, other wise the server won't appear in your subscription list)

I did a simple # yum search ftp just to confirm that yum is working properly

Then I disabled the product ID and subscription manager from yum plugin configuration. If you have kathello config, you might want disable that too (it comes in RHEL 5.7 and older)

# vi /etc/yum/pluginconf.d/product-id.conf

# vi /etc/yum/pluginconf.d/subscription-manager.conf

Before:

[main]
enabled=1

After:

[main]
enabled=0

Based on two weeks of testing and my hunches confirmed by RHEL techies, both these configs hindered with my yum and it kept hanging on me when used with epel repo

Right then, lets move on to the EPEL repo. You can get the latest repo from here

I stored everything in my /tmp (makes it easy to remove all the installation files later once I am done) Install that epel repo you downloaded earlier


Epel repo installation on RHEL 6.3

Now, in RHEL 5.7, once you have epel installed, all you have to do is pretty much clean up your yum cache and reload yum. Then you can move on and install the omd

# rm -rf /var/cache/yum/*

# yum clean all

# yum repo list

# yum install --nogpgcheck omd.rpm

Your yum will work on looking for the dependencies and list them right away for installation. On my RHEL 5.7 I had about 31 dependencies installed prior to OMD installation. Once you have your OMD installed all you have to do is run the final steps on creating a user for OMD management and start the services

# su - priti

OMD [priti]:~$ omd start

Your browser will request for the default username and password that comes with OMD installation which is usually omdadmin/omd

http://server-ip/nagios

Make sure your httpd services will run persistently across reboots

# chkconfig --list | grep httpd
# chkconfig httpd on

You got to manually start apache the first time though, it doesn't start automatically after installation

# service httpd start

Now, some tippers on installing OMD on RHEL 6.3. The epel repo for RHEL 6 doesn't come with graphviz yet, so you've got to go to their website here and do what I did, get their repo config and add that into your /etc/yum/repos.d/ folder. I was getting xml error when I ran "yum repolist" because the server wasn't able to read "https" (firewall again!) so two things you can do here. Either allow https thru your firewall or edit the graphviz-rhel.repo file and rename the "https" to "http"

Here's my repo lists, the ones in blue are what you need

# ls -lrt /etc/yum.repos.d/
total 20
-rw-r--r--. 1 root root 1056 May 9 23:55 epel-testing.repo
-rw-r--r--. 1 root root 529 May 31 02:19 rhel-source.repo
-rw-r--r--. 1 root root 954 Aug 23 12:30 epel.repo
-rw-r--r--. 1 root root 1138 Aug 23 12:40 graphviz-rhel.repo
-rw-r--r--. 1 root root 125 Aug 23 15:16 packagekit-media.repo

Now, about that php-mbstring you will need to add an additional RHEL repo into your subscription list:

RHEL Server Optional (v. 6 for 32-bit x86) (Channel Details)

Check on the box circled in red and click on the "Change Subscriptions" button

Before you start going about yumming, I would recommend you to clear your yum cache and then run "yum repolist" command to view all the installed repos on your server

# rm -rf /var/cache/yum/*

# yum repolist
Loaded plugins: refresh-packagekit, rhnplugin, security
repo id repo name status
epel Extra Packages for Enterprise Linux 6 - x86_64 7,707
graphviz-stable Graphviz - RHEL 6Server - x86_64 31
rhel-x86_64-server-6 Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) 8,396
rhel-x86_64-server-optional-6 RHEL Server Optional (v. 6 64-bit x86_64) 5,293
repolist: 21,427

And you're ready to install OMD on RHEL 6.3. Mark my words folks, if you hadn't already added the optional RHEL, graphviz and epel repos, your installation WILL FAIL





Ok, now lets start your httpd daemon and set that to run persistently across reboots. Remember the tricky little thing I mentioned earlier about the firewall and SElinux? My SELinux policy was set to Enforcing (so try as I might I wasn't able to open the web browser for check_mk). I had overlooked this bit until i pored over the /var/log/messages and /var/log/httpd/erro_log. Sooooo then I changed that to permissive and made sure it stayed that way by editing /etc/selinux/config file too

# getenforce
Enforcing

# setenforce Permissive

# getenforce
Permissive

# more /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted



The error messages indicating web page failed to load

If you are behind proxy server, make sure you enable HTTP and HTTPS port from your firewall




And now with all that done lets start OMD shall we? By default OMD doesn't star automatically. I also noticed that the omd for RHEL 6 doesn't ask for the omdadmin user name and password, it just opens the browser without password prompt. I guess they must have removed this feature but forgot to take it out of the installation result display







Good luck folks with installing OMD and check_mk. The config I have for my system may or may not not work for you, and if you have any queries just post them here I will try my best to answer you!

Note: Don't forget to remove the rpms from /tmp once you are done

No comments:

Post a Comment