Monitoring Tool, OpsView Installation Manual
Created by 2015.08.14 ASD Korea Nalee Jang
시스템을 설치하고 나면 항상 함께 설치를 해야 하는 툴이 있습니다. 그 중 하나가 시스템 모니
터링 툴입니다. Cloudike에서는 OpsView라는 모니터링 툴을 사용합니다. 이번 매뉴얼에서는 모니
터링 툴인 OpsView를 함께 설치해 보고자 합니다.
OpsView Server 설치
OpsView는 생각보다 많이 쓰는 모니터링 툴입니다. 그래서, Server 설치 방법도 많은 분들이 올려
놓아서 쉽게 찾을 수 있습니다. 그러나, 오픈소스의 단점이 설치 방법이 자주 바뀐다는 문제가 있
습니다. OpsView 역시 마찬가지입니다. 이전에는 쉽게 설치가 가능했으나, 근래에는 OpsView 사
이트에 가입을 해서 레파지토리 ID를 별도로 받아와야 합니다. 그럼, 지금부터 OpsView를 설치해
보도록 하겠습니다.
OpsView 사이트 가입하기
1. 가장 먼저 OpsView 웹사이트(http://www.opsview.com)에 방문합니다. 그리고, 상단 오른쪽의
“Sing Up”을 클릭합니다.
2. “Sing Up”을 클릭하면 아래와 같이 Register with OpsView 페이지가 나타납니다. E-mail(이메일
주소), Password(패스워드), Confirm password(패스워드 확인), First name(이름), Second name(성)
을 입력하고, Accept Terms & Conditions of Use 항목에 체크를 한 후 “Continue” 버튼을 클릭
하면 가입이 됩니다.
사이트에 맞는 버전 선택하기
3. 회원가입을 완료했으면 이번에는 모니터링 할 시스템의 규모에 맞는 버전을 확인해 보도록
하겠습니다. OpsView 사이트에 방문하여 상단 메뉴에서 Products의 Compare Versions를 클릭
하면 아래와 같은 화면을 확인할 수 있습니다. Atom 버전을 제외한 모든 버전은 유료이며, 25
대 미만의 노드를 모니터링 할 경우에만 Atom 버전을 사용할 수 있습니다. 저는 모니터링 할
노드가 적어서 그냥 Atom 버전을 설치 할 생각입니다.
4. 어떤 버전으로 설치할 지를 정했다면 이번에는 설치 매뉴얼을 살펴보도록 하겠습니다.
OpsView 사이트의 상단 메뉴에서 Resources의 Downloads를 클릭합니다. 그러면 아래와 같은
화면을 확인할 수 있습니다. 글을 잘 보다 보면 굵은 글씨로 “Please note: you’ll need a
software key to activate Opsview Atom. If you don’t yet have a key, you can request on
here” 라는 글씨를 볼 수 있을 것입니다. 우리는 소프트웨어 키를 받아와야 하므로 “request
on here” 라고 써 있는 글씨를 클릭합니다.
레파지토리 코드와 소프트웨어 코드 발급받기
5. 위 화면에서 “request on here” 를 클릭하면 아래와 같은 화면이 보입니다. 그러면 하단의 Get
Atom 버튼을 클릭합니다.
6. 그러면 아래와 같은 화면이 나오면서 가입할 때 설정했던 이메일 주소로 레파지토리 코드와
소프트웨어 코드가 전달됩니다. 또는 회사 정보를 입력하라는 페이지가 나올 수도 있는데
그러면 회사 정보를 입력하면 됩니다.
7. 아래 내용과 같은 메일이 바로 레파지토리 코드가 포함되어 있는 메일입니다.
8. 또 다른 메일은 소프트웨어 키가 포함되어 있는 아래와 같은 메일입니다.
OpsView 서버 설치하기
이렇게 해서 OpsView 설치하기 위한 사전 준비를 했습니다. 사이트에 가입하고 어떤 버전으로
설치를 할 것인지를 확인하고, 레파지토리 키와 소프트웨어 키를 메일을 통해 받아왔습니다. 이번
에는 OpsView를 설치할 서버에 직접 접속해서 설치를 해 보도록 하겠습니다.
9. 가장 먼저 redhat-lsb-core를 설치합니다. 본 과정의 OpsView의 아래 설치 매뉴얼을 참조하여
설치하였으므로 매뉴얼과 함께 비교해서 설치하면 좋습니다.
설치 매뉴얼: http://docs.opsview.com/doku.php?id=opsview4.6:automated-installation
[root@opsview ~]# yum -y install sudo curl redhat-lsb-core
Loaded plugins: fastestmirror
Setting up Install Process
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: centos.tt.co.kr
* extras: centos.tt.co.kr
* rpmforge: ftp.neowiz.com
* updates: centos.tt.co.kr
base
| 3.7 kB 00:00
extras
| 3.4 kB 00:00
opsview
| 951 B 00:00
…
Package sudo-1.8.6p3-19.el6.x86_64 already installed and latest version
Package curl-7.19.7-46.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package redhat-lsb-core.x86_64 0:4.0-7.el6.centos will be installed
--> Processing Dependency: perl-Test-Simple for package: redhat-lsb-core-4.0-7.el6.centos.x86_64
--> Processing Dependency: perl-Test-Harness for package: redhat-lsb-core-4.0-
7.el6.centos.x86_64
…
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================
Package Arch Version
Repository Size
==============================================================
Installing:
redhat-lsb-core x86_64 4.0-7.el6.centos
base 25 k
Installing for dependencies:
at x86_64 3.1.10-48.el6
base 61 k
bc x86_64 1.06.95-1.el6
….
Transaction Summary
==============================================================
Install 20 Package(s)
Total download size: 12 M
Installed size: 38 M
Downloading Packages:
(1/20): at-3.1.10-48.el6.x86_64.rpm
| 61 kB 00:00
(2/20): bc-1.06.95-1.el6.x86_64.rpm
…
(20/20): time-1.7-38.el6.x86_64.rpm
| 26 kB 00:00
-----------------------------------------------------------------------------------------------------------
Total
5.4 MB/s | 12 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-CGI-3.51-141.el6.x86_64
1/20
… 20/20
Verifying : db4-devel-4.7.25-19.el6_6.x86_64
20/20
Installed:
redhat-lsb-core.x86_64 0:4.0-7.el6.centos
Dependency Installed:
at.x86_64 0:3.1.10-48.el6 bc.x86_64 0:1.06.95-1.el6
cvs.x86_64 0:1.11.23-16.el6
…
Complete!
10. 이번에는 아래 명령어를 이용하여 OpsView를 자동으로 설치해 보도록 합시다. 아래 명령어를
실행하면 바로 레파지토리 키와 소프트웨어 키를 물어보는데 이메일로 받았던 해당 키를 입
력하면 됩니다. 입력할 때 보고 치면 실수를 할 수 있으므로 복사해서 붙여넣기를 하면 좋습
니다. 소프트웨어 키와 레파지토리 키를 입력하고 나면 remote database 사용 여부를 물어봅
니다. 이때 별도의 MySql 서버를 사용 할 생각은 없으므로 그냥 “N”이라고 입력하면 됩니다.
그리고 나서 약 20여분 정도 기다리며 OpsView가 설치 완료됩니다.
[root@opsview ~]# curl -L https://install.opsview.com | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15862 100 15862 0 0 9137 0 0:00:01 0:00:01 --:--:-- 25137
2015-08-13 13:47:53 Opsview Automatic Installation
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
....Package redhat-lsb-core-4.0-7.el6.centos.x86_64 already installed and latest version
Running this software will install Opsview and configure your system. Do you wish to continue?
[y/N] y
2015-08-13 13:48:09 Installation started
Please provide software key: 2454cf62-c4b9-4d73-baf6-6310b9dde9cd
Please provide repository access key: fb2b2aa022ccb1807ccaabe07188f24979a8f81a
Install Opsview using a remote database? [y/N] N
Please enter your desired Opsview admin & database root password:
Please confirm your desired Opsview admin & database root password:
2015-08-13 13:50:19 Setting up packages repositories
2015-08-13 13:50:19 - Setting up Opsview repository
2015-08-13 13:50:19 - Setting up RPMforge repository
. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12640 100 12640 0 0 3777 0 0:00:03 0:00:03 --:--:-- 44664.
package rpmforge-release-0.5.3-1.el6.rf.x86_64 is already installed
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
.........................................................
2015-08-13 13:51:23 Installing prerequisites
2015-08-13 13:51:23 - Installing Zip
2015-08-13 13:51:23 Installing packages: zip
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
.
2015-08-13 13:51:25 - Installing MySQL
2015-08-13 13:51:25 Installing packages: mysql-server
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
....
2015-08-13 13:51:30 - Starting database server
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h opsview password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
2015-08-13 13:51:32 Tunning system configuration
2015-08-13 13:51:32 - Updating MySQL configuration
2015-08-13 13:51:32 - Disabling SELinux
2015-08-13 13:51:32 - Upgrading your system
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
2015-08-13 13:51:33 Installing Opsview
2015-08-13 13:51:33 Installing packages: opsview opsview-core opsview-base opsview-perl
opsview-web mod_auth_tkt_opsview
.Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
.....................................................................................Setting up compatibility links
................................AuthTkt configuration file generated
Running postinstall_root
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
...
2015-08-13 13:53:35 Post-installation configuration
2015-08-13 13:53:35 - Installing databases
Checking if Opsview database already exists
No Opsview DB found
Validating database access...
Database connected
New install - creating databases with random passwords
Creating database opsview
Creating database runtime
Creating database dashboard
Updated dashlets
Creating database odw
Running common postinstall tasks
Generating configs
Thu Aug 13 13:55:05 2015 Starting
Thu Aug 13 13:55:05 2015 --> Writing config files for Master Monitoring Server
Thu Aug 13 13:55:05 2015 Created distributed information
Thu Aug 13 13:55:05 2015 Created keyword lookup list for 7 keywords
Thu Aug 13 13:55:05 2015 101 commands written to checkcommands.cfg
Thu Aug 13 13:55:07 2015 28 service definitions written to services.cfg
Thu Aug 13 13:55:07 2015 1 hosts written to hosts.cfg
Thu Aug 13 13:55:07 2015 1 hostgroups written to hostgroups.cfg
Thu Aug 13 13:55:07 2015 1 contacts (0 profiles) written to contacts.cfg
Thu Aug 13 13:55:07 2015 1 contacts written to htpasswd.users
Thu Aug 13 13:55:07 2015 6 groups written to contactgroups.cfg
Thu Aug 13 13:55:07 2015 Written nagios.cfg
Thu Aug 13 13:55:07 2015 Written cgi.cfg
Thu Aug 13 13:55:07 2015 Written misccommands.cfg
Thu Aug 13 13:55:07 2015 Written timeperiods.cfg
Thu Aug 13 13:55:07 2015 Written snmptraps.cfg
Thu Aug 13 13:55:07 2015 Written notificationmethodvariables.cfg
Thu Aug 13 13:55:07 2015 Written nsca.cfg
Thu Aug 13 13:55:07 2015 Written nrd.conf
Thu Aug 13 13:55:07 2015 Written send_nrd.cfg
Thu Aug 13 13:55:07 2015 Written send_nsca.cfg
Thu Aug 13 13:55:07 2015 19 dependencies written to services.cfg
Thu Aug 13 13:55:07 2015 Written ndomod.cfg
Thu Aug 13 13:55:07 2015 secure wallet db written to sw.db
Nagios config re-generated in 2.063 seconds
AuthTkt configuration file generated
Stopping opsview... nrd is not running
nsca is not running
opsviewd is not running
nagios is not running
import_ndologsd is not running
import_perfdatarrd is not running
import_ndoconfigend is not running
opsviewadmd is not running
opsviewhd is not running
done
Starting Opsview...
done
NRPE stopped
NRPE started
Not running
Starting opsview-web: INFO - Starting Opsview Web 4.6.3.15643
done
2015-08-13 13:55:30 - Starting Opsview-Web
Already running
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
2015-08-13 13:55:31 - Setting up environment
Stopping opsview... Starting Opsview...
done
2015-08-13 13:55:43 - Activating Opsview
Successfully activated
Stopping opsview... Stopping opsview-web: done
Starting opsview-web: INFO - Starting Opsview Web 4.6.3.15643
done
Starting Opsview...
done
Do you wish to install ServiceDesk Connector? [y/N] n
Do you wish to install SMS Gateway? [y/N] n
2015-08-13 13:58:57 Setting admin password
********************************************
Opsview Installation Complete - please go to
http://172.27.0.232/
and log on using:
username: admin
password: [database password]
모니터링 화면 확인하기
11. 설치가 완료되었으면 이번에는 OpsView 웹 사이트에 한번 방문해 보도록 하겠습니다. 아래와
같이 로그인 페이지가 뜨면 ID와 패스워드를 입력하고 “Sign in” 버튼을 클릭합니다.
12. 그러면 아래와 같이 localhost의 OpsView 서버를 설치한 노드가 보입니다.
OpsView Agent 설치
서버가 정상적으로 설치되었으면 이번에는 OpsView Agent를 설치해 보도록 하겠습니다. 대부분
의 매뉴얼은 서버 설치 매뉴얼만 나와 있어서 서버를 설치 후에 어떻게 모니터링을 해야 할지 잘
모릅니다. 그래서, 다시 또 어떻게 사용을 해야 하나 한참 연구를 해야만 합니다. 이번 매뉴얼에
서는 그런 과정을 좀 줄이고자 모니터링 할 노드에 OpsView Agent 설치 방법도 함께 다루었습니
다.
13. 모니터링 할 모든 노드에 OpsView Agent를 설치해야 합니다. 그럼, 지금부터 OpsView Agent
를 설치해 보도록 하겠습니다. 모니터링 할 노드들의 Selinux 상태를 아래와 같이 확인합니다.
아래와 같이 SELINUX가 disabled로 되어 있지 않으면, SELINUX를 disabled로 변경해 줍니다.
[root@cloudike1 ~]# cat /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=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
14. SELINUX 상태 확인을 했으면 이번에는 rpmforge-release rpm 패키지를 아래와 같이 wget으
로 다운로드 받습니다. 이때 다운로드 받을 패키지는 미리 사이트에 들어가서 보고 해당 OS
에 맞는 패키지로 다운로드 받아야 합니다.
[root@cloudike1 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm
--2015-08-12 17:25:07-- http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm
Resolving pkgs.repoforge.org... 78.46.17.228
Connecting to pkgs.repoforge.org|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm [following]
--2015-08-12 17:25:08--
http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm
Resolving rpmforge.sw.be... 78.46.17.228
Connecting to rpmforge.sw.be|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-
0.5.3-1.el6.rf.x86_64.rpm [following]
--2015-08-12 17:25:09--
http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm
Resolving tree.repoforge.org... 78.46.17.228
Connecting to tree.repoforge.org|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm [following]
--2015-08-12 17:25:10-- http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-
release-0.5.3-1.el6.rf.x86_64.rpm
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12640 (12K) [application/x-redhat-package-manager]
Saving to: ??rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm??
100%[==========================================================
========================================>] 12,640 --.-K/s in 0s
2015-08-12 17:25:11 (75.4 MB/s) - ??rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm?? saved
[12640/12640]
15. 다운로드 받은 rpm 패키지를 아래와 같이 설치합니다.
[root@cloudike1 ~]# rpm -Uhv rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
warning: rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID
6b8d79e6: NOKEY
Preparing... ########################################### [100%]
1:rpmforge-release ########################################### [100%]
16. 이번에는 opsview agent를 설치하기 위한 레파지토리 파일을 아래와 같이 생성해 줍니다.
[root@cloudike1 ~]# vi /etc/yum.repos.d/opsview.repo
[opsview]
name = Opsview
baseurl = http://downloads.opsview.com/opsview-core/latest/yum/centos/6/$basearch
enabled = 1
protect = 0
gpgcheck = 0
17. 이번에는 yum을 이용해 opsview-agent를 설치합니다.
[root@cloudike1 ~]# yum install opsview-agent -y
18. 설치가 완료되고 나면 nagios로 프로세스가 돌아가고 있는지 확인합니다.
[root@cloudike1 ~]# ps -ef | grep nagios
nagios 22855 1 0 Aug13 ? 00:00:50 /usr/local/nagios/bin/nrpe -c
/usr/local/nagios/etc/nrpe.cfg -d
이렇게 해서 모니터링 할 모든 노드에 OpsView Agent를 설치합니다.
OpsView Host 추가
이번에는 OPSVIEW 데쉬보드에 방금 설치한 모니터링 할 노드들을 추가해 보도록 하겠습니다. 사
실 이 부분도 잘 나오지 않아서 한참을 구글 링을 했습니다. 본 매뉴얼에서는 함께 설명하니 쉽
게 모니터링 할 노드들을 추가할 수 있으리라 생각이 듭니다.
19. 설치한 OpsView 데쉬보드에 접속합니다. 그리고, 상단의 settings 메뉴의 Hosts를 클릭합니다.
그리고, “+” 버튼을 클릭하면 아래와 같이 Host 정보를 입력할 수 있는 창이 뜹니다.
** 어떤 정보를 입력해야 할지 잘 모르겠다면 이미 등록되어 있는 호스트를 참조하여 등록하면
쉽게 등록할 수 있습니다. 아래 화면처럼 말입니다.
20. 모니터링 할 모든 호스트를 다 등록하면 아래와 같이 리스트에서 해당 정보들을 모두 확인할
수 있습니다. 그러나, 그렇다고 해서 데쉬보드 메인 화면에서 지금 등록한 노드들을 모니터링
할 수 있는 건 아닙니다.
21. 상단 메뉴의 settings의 No changes 라는 연두색 버튼 밑에 있는 Reload를 클릭해야 합니다.
22. 그러면 아래와 같은 화면이 나옵니다. 이때 다시 Reload Configuration 버튼을 클릭합니다.
23. 이제 데쉬보드에서 등록한 모든 노드를 모니터링 할 수 있습니다.
24. 아래와 같은 데쉬보드 화면도 설정해서 확인 할 수 있습니다.
이렇게 해서 OpsView 설치를 해 보았습니다. 서버를 설치하고, 모니터링 할 노드에 Agent를 설치
하고, OpsView 데쉬보드에 Agent를 설치한 노드를 추가하고 모니터링 화면까지 확인해 보았습니
다. 이 다음에는 기회가 된다면 화면에서 보이는 것들이 어떤 의미를 가지는지 그리고, 어떻게 모
니터링 시스템을 가지고, 위험 상황을 알 수 있는지를 알아보면 좋겠습니다.