# System Monitoring with Xymon/Administration Guide/Compiling on CentOS
## Installing the OS

First obtain a disk image from the Centos 6.2 Mirrorlist. This guide is for 6.2/isos/i386/CentOS-6.2-i386-minimal.iso.
Boot from the CD and when the boot menu shows up hit tab and append "linux text". That means hit the tab key, space bar and then linux text.
* Skip media test
* OK to welcome screen
* OK to English
* OK to us keyboard layout
* Partition disk(s), for the most part it will be
** /boot with 100MB
** swap with 1024MB
** / with remainder of disk (also enable force to be primary partition)
* OK to use GRUB
* OK - no kernel options needed
* OK leaving no GRUB password
* OK to use default boot loader configuration
* Use /dev/sda or /dev/hda to use the MBR part of the disk for the boot loader
* Default ethernet device settings are DHCP
* OK for system to use UTC and New York time zone
* Root password - make it good!
* Select Basic Server for the set of software
Now you have the minimal packages for working with a CentOS system.

## Obtaining the package and installing it

Starting with root...
Now reboot with the new kernel
Once you've rebooted we've got to get to configuring. Let's start by changing the ServerTokens directive in httpd.conf
Change ServerTokens OS to ServerTokens Major
Add a user for Xymon to use. A popular user is xymon.
Make this easier and enable copy and paste
The echo should spit out changethis or whatever you want your Xymon user to be.
Make sure you pick a good password!
Now compiling Xymon...
At this point accept the defaults until you see...
The rest will use default except the name of the host and IP address. These two options will vary depending on the host's destined network installation. Now compile the code:
Now exit out to become root and finish with...

## Groundwork Configuration

Let's stop those crawlers at the door!
You will need to take the configuration from the Xymon created xymon-apache.conf and place it in the Apache HTTPD running configuration.
and also add some more configuration to httpd.conf around line 292 and 595 (under the Redirect comment)
nano /etc/httpd/conf/httpd.conf
Now test the new httpd.conf and restart Apache HTTPD to those configurations.
Create a user for the administrative scripts on Xymon and we're done working with Apache.
Next we'll want to steal the Xymon startup script and use it to start Xymon upon entering run level 3.
YOU ABSOLUTELY MUST MODIFY /etc/init.d/xymon and will probably only need to change STARTBIN, STARTDIR and USERNAME as this example shows:
Now you want to open the firewall to allow this viewer to see Xymon's web page outputs.
nano /etc/sysconfig/iptables
This can go a lot of places, but this works
SELinux causes a lot of problems for me. You can do it the right way, but this guide is just to get it working.
Disable it for now
Disable it upon boot
nano /etc/selinux/config
You will need NTP for a time based application =)
Make it so that Xymon has the capability of reading /var/log/messages

## Installation Completion

You should have a Xymon server with basic configuration ready to go. You can either reboot to confirm you have a working init script or just start it with
Wait about 5 seconds for Xymon to do it's initial run and you should be able to browse to your server at http://servername.com/xymon/

## Important Network Information

I personally disable SELinux and the firewall on my installations. I have a dedicated firewall and a strong hate for SELinux. I suggest installing security software - at the very least DenyHosts.
If you want to run Xymon under SELinux, here is one recipe System_Monitoring_with_Xymon/Selinux.