| 0 comments ]

Install Centos 5.5 base server install

The above packages do install perl 5.8.8-27.e15 which is a requirement for Opsview install

You can use the NetInstall so you don't have to download the huge Centos file,
A nice tutorial can be found here: http://www.chrisgountanis.com/technical/45-centos-netinstall.html

Once Centos is? install, I usually go back to my computer and run everything through a ssh using putty.

First before you begin your Opsview install, we must disable Security Enhanced Linux, (aka SeLinux)
The SELinux configuration file on CentOS is located at /etc/selinux/config and after a default install looks like this:

# 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 - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#?????? targeted - Only targeted network daemons are protected.
#?????? strict - Full SELinux protection.
SELINUXTYPE=targeted

To disable SELinux you need to change "SELINUX=enforcing" to "SELINUX=disabled" so that the configuration file now looks like this:

# 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 - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#?????? targeted - Only targeted network daemons are protected.
#?????? strict - Full SELinux protection.
SELINUXTYPE=targeted

This would then disable SELinux on your next reboot. To change the SELinux setting right now, without having to reboot, you can use the setenforce command like so:

setenforce 0



Download rpmforge:

Open a browser and goto here: http://packages.sw.be/rpmforge-release/
This is so you can view which package you want to install with the wget command.
I have a 32bit OS, so I chose: rpmforge-release-0.5.1-1.el5.rf.i386.rpm


#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
#rpm -Uhv rpmforge-release-0.5.1-1.el5.rf.i386.rpm

Then, use your favourite editor to create the file /etc/yum.repos.d/opsview.repo? containing the following lines:

[opsview]
name = Opsview
baseurl = http://downloads.opsera.com/opsview/yum/community/centos/5/$basearch
enabled = 1
protect = 0
gpgcheck = 0

Note: vi command
#vi /etc/yum.repos.d/opsview.repo

Hit "i" to be able to insert
Once done typing, hit ESC
To quit and save file type:
:wq

Now to begin install:? This will take a little while.
#yum install opsview

1.
Start Mysql:
#/etc/init.d/mysqld start
Set to start at boot time with:
#chkconfig ?level 345 mysqld on.

See the Mysql setup page for more general mysql settings

2. Ensure the MySQL root password has been set to a known value:

#mysqladmin -u root password {Enter the password}

3. The rest of the steps should be performed as the nagios user

#su - nagios

4. Edit the opsview configuration file and amend the password as you see fit to secure the system (those passwords that should be changed as set to changeme by default). Note that any service checks for MySQL systems will also require the default password of changeme to be amended.

#vi /usr/local/nagios/etc/opsview.conf   # change passwords in this file

5. Set up the Opsview mysql database users with the necessary permissions

#/usr/local/nagios/bin/db_mysql -u root -p{mysql root password}

6. Install the Opsview databases

#/usr/local/nagios/bin/db_opsview db_install
#/usr/local/nagios/bin/db_runtime db_install
#/usr/local/nagios/bin/db_odw db_install
#/usr/local/nagios/bin/db_reports db_install

7. Generate all the necessary configuration files for Opsview and Nagios to run

#/usr/local/nagios/bin/rc.opsview gen_config

8. You can now start up the web application server:

/etc/init.d/opsview-web start


The Opsview server is now listening on port 3000, i.e. http://your.server:3000/

If you get a timeout error, as I did when I installed Opsview, then you may need to disable your firewall, or add a rule to allow traffic on port 3000 and port 80.

To disable the firewall:
Make sure you are using root.

# /etc/init.d/iptables save
# /etc/init.d/iptables stop

To make the change permanent after reboot
#chkconfig --level 2345 iptables off

To verify
#chkconfig --list iptables
They should all say off

The default logon:
Username: admin
Password: initial


Graph problems, mrtg graphs not displaying:
There seems to be a problem with the mrtg graphs with the Centos installation.
The problem was that the cfgmaker.cfg file was corrupt.
the cfgmaker.cfg file is responsible for creating the mrtg configuration files.

You can copy my cfgmaker file from here: cfgmaker-2.16.2.txt

If you are using putty, you can rename the current cfgmaker file to something like cfgmaker.old, then open
a new cfgmaker file, and just copy and paste from the file above.
ie.
#cd /usr/bin
#mv cfgmaker cfgmaker.old
#vi cfgmaker

Type "i" for INSERT
Now copy the text from cfgmaker-2.16.2.txt, and paste into the cfgmaker
Type ESC
Type ":wq"? to save the file.

Now you need make sure the permissions are correct since you created a new file.
#chmod 0755 cfgmaker
You can compare the permissions with the old file:
#ls -l cfg*

Now navigate to /usr/local/nagios/etc and do a list for a file named: "mrtg.cfg"
# cd /usr/local/nagios/etc
#ls mr*

If you do not see this file you need to run a perl script.
You must run it as nagios
#su nagios
#/usr/local/nagios/bin/mrtgconfgen.pl full

if you go back to /usr/local/nagios/etc
you should now see the file "mrtg.cfg"

You should also now be able to go into Opsview
Navigate to Module -> MRTG
and be able to see the graphs.

For some reason these graphs don't generate until the "mrtgconfgen.pl full" is run.
So what I did is create a cron job that runs once a day.

Creating a cron job
Make sure you are logged on as root

The cron jobs for nagios are stored here:
/var/spool/cron
We are going to edit the file nagios.

#vi nagios
Scroll to the bottom just below: # OPSVIEW-END

Add the line:

@daily /usr/local/nagios/bin/mrtgconfgen.pl full

Or if you like you can use something like below which will run once every hour:

0 * * * * /usr/local/nagios/bin/mrtgconfgen.pl full


For more on setting up cron jobs, do a google search.
Ubuntu has a nice article: https://help.ubuntu.com/community/CronHowto

now do :wq to save the file.

That's it

This is a good link: http://docs.opsview.com/doku.php?id=opsview3:faq

0 comments

Post a Comment