分类: 系统运维
2014-12-08 07:19:16
For security, this repository is gpg signed.
If you do not import our gpg keys, you could see errors such as:
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 0fc6984b: NOKEY Public key for opsview-xxxxx.rpm is not installedCreate the gpg file named opsview.asc in /tmp:
rpm --import /tmp/opsview.asc
The “Public key for” portion of this message indicates that your system does not have the public key for this repository and so cannot verify its contents.
Opsview is not currently compatible with Security-Enhanced Linux extensions, this must be disabled.
Edit /etc/selinux/config and restart system:
# 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
Set up to install any necessary dependencies by downloading and installing the RPMForge release package.
First, ensure that you are working as the root user. If not, enter the following into the command line:
su - root {enter root password}
wget rpm -Uhv rpmforge-release-0.3.6-1..rf. .rpm
Where
and
If the site specified in the above wget is not available, there is a list of alternative sites to obtain the package on the .
Then, use your favourite editor to create the file /etc/yum.repos.d/opsview.repo containing the following lines:
[opsview] name = Opsview baseurl = enabled = 1 protect = 0 gpgcheck = 0
where
Once the repositories have been updated to include the Opsview yum repository, the latest release of Opsview can be installed by running the following command as root.
yum install opsviewIn here, it will pop-up a error that it can't find the below packages:
rpm -ivh php-mbstring-5.3.3-3.el6_1.3.x86_64.rpm php-common-5.3.3-3.el6_1.3.x86_64.rpm
rpm -ivh rrdtool-perl-1.3.8-6.el6.x86_64.rpm rrdtool-1.3.8-6.el6.x86_64.rpm dejavu-lgc-sans-mono-fonts-2.30-2.el6.noarch.rpm dejavu-sans-mono-fonts-2.30-2.el6.noarch.rpm dejavu-fonts-common-2.30-2.el6.noarch.rpm
rpm -ivh perl-Archive-Zip-1.30-2.el6.noarch.rpm perl-Compress-Raw-Zlib-2.023-119.el6_1.1.x86_64.rpm
Then re-install opsview packages using the command:
yum install opsview
After the Opsview packages have been installed, it is necessary to configure Opsview and its databases.
1. Ensure the MySQL root password has been set to a known value:
Start MySQL first,
/etc/init.d/mysqld start
and ensure it is set to start at boot time with
chkconfig --level 35 mysqld on
Set the root password:
mysqladmin -u root password {password}
2. Ensure the nagios user's environment is set up correctly. Opsview will try to set the correct profile, but check that the following line is in the profile script, depending on your shell (e.g. .profile for bourne or korn shell, .bash_profile or .bashrc for bash shell):
Please kindly check the entry whether in that file or not, it exists in my installation.
su - nagios
echo "test -f /usr/local/nagios/bin/profile && . /usr/local/nagios/bin/profile" >> ~/.bash_profile
. ~/.bash_profile
3. 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: Do not use any funny shell characters in the password, such as $ or !.
vi /usr/local/nagios/etc/opsview.conf # change passwords in this file
4. Set up the Opsview mysql database users with the necessary permissions
/usr/local/nagios/bin/db_mysql -u root -p{mysql root password}
5. Install the Opsview databases
/usr/local/nagios/bin/db_opsview db_install /usr/local/nagios/bin/db_runtime db_install
6. Generate all the necessary configuration files:
/usr/local/nagios/bin/rc.opsview gen_config
7. 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. . Confirm that this works correctly before configuring Apache.
iptables maybe running which may disable this port. Configure iptables to allow incoming requests to port 3000 for the duration of this test
$authtkt_shared_secret = "shared-secret-please-change";
Restart Opsview Web for this value to take effect: /etc/init.d/opsview-web restart.
Once Opsview has been installed, a single administrative user will have been created. The credentials for this user are:
username: admin password: initial
You should change this password to prevent unauthorised access to Opsview - this can be done from 'Administrator' link in the top right of the page.
See the guide for an introduction to Opsview.
The RPM packages that used in this guide.