List of Contents
Machbase Web Analytics (MWA)는 Python 2.7과 Flask기반의 Werkzeug, Jinja2로 개발된 Web application이다.
Configuration
MWA는 5001포트를 이용하여 클라이언트와 통신을 수행한다. 해당 포트를 사용할 수 있는지 확인하려면, linux 운영체제는 iptables 명령을 이용하고, windows는 방화벽 설정을 참조하여 통신 문제를 해결해야 한다.
추가로, $MACHBASE_HOME/lib 폴더를 $LD_LIBRARY_PATH에 추가하고 libmachcli_dll.so 파일이 그 폴더내에 있는지 확인해야 한다.
How to run the Server
MWA 서버는 $MACHBASE_HOME/bin/MWAserver 스크립트 파일을 실행하여 수행한다. 이 스크립트는 $MACHBASE_HOME 환경변수를 이용하여 수행되므로 해당 환경 변수를 반드시 설정해야 한다. 이 스크립트는 START, STOP, RESTART, RESET, PORT 명령 옵션을 지원한다. 'MWAserver start' 명령으로 서버를 수행할 수 있다. port 명령 옵션을 이용하면 MWAserver가 이용하는 기본 포트 번호인 5001이 아닌 다른 포트를 이용하여 MWA가 동작하도록 설정할 수 있다.
Example:
[mach@localhost ]$./MWAserver port 1234 WEBSERVER PORT CHANGED : 1234
명령 옵션은 아래와 같다.
List of commands
[mach@localhost flask]$./MWAserver help List of commands: * MWAserver start; Startup WebServer * MWAserver restart; Restart WebServer * MWAserver stop; Shutdown WebServer * MWAserver reset; Reset WebServer database * MWAserver port NUMBER; Change WebServer port.
Connect to MWA with Web Browser
웹 브라우저를 통해서 MWA 서버 IP와 포트번호(예 http:127.0.0.1:5001)를 입력하여 MWA에 접속할 수 있다. 웹 브라우저로는 최신 크롬 브라우저를 추천한다. 접속에 성공하였다면, 로그인 화면이 표시될 것이다. 기본 로그인 계정과 패스워드는 "admin"/"machbase"이다.
How to Use MWA
MWA 의 주 메뉴는 Dashboard, Query, Collection, DB Admin, Preferences 이다.
Overview
사용자 인증
MWA에는 ADMIN과 USER의 두 가지 종류의 사용자가 있다. ADMIN 사용자 계정은 모든 메뉴와 기능을 사용할 수 있고, USER 계정은 ADMIN 사용자가 허가한 기능만 사용할 수 있다.
Group
사용자 권한부여 및 설정을 쉽게 하기 위해서 여러 사용자들을 그룹을 설정할 수 있다. 화면의 좌측 위에서 원하는 그룹 카테고리를 선택할 수 있다. 그룹 카테고리는 "Users"메뉴의 "Available Groups"매뉴에서 설정할 수 있다. ADMIN 계정 사용자는 모든 권한을 갖는다. ADMIN 계정 사용자만 그룹을 등록할 수 있다.
Permission
저장된 Bookmark 질의, 그리드, 대쉬보드등의 리소스에 대한 권한을 설정한다. 권한은 ALL, USER, OWNER 세 가지이다.
ALL : 모든 사용자는 로그인하지 않고 리소스에 접근 가능하다.
USER : 로그인 한 사용자만 리소스에 접근할 수 있다.
OWNER : 그 리소스를 생성한 사용자만 접근할 수 있다.
리소스 생성자가 아니면 ADMIN 권한을 갖는 사용자만 권한 없이 변경할 수 있다.
Change a Server
화면 오른쪽 구석에서 등록한 서버목록을 볼 수 있고, 선택에 따라 다른 서버로 접속할 수 있다. 서버목록은 정상 실행중인 서버만 나타나며, 서버의 IP주소와 포트번호를 이용하여 접속 서버를 확인할 수 있다.
Dashboard
MWA는 질의 결과를 Grid, 차트로 나타내고 이 결과를 대쉬보드 형태로 표시하는 기능이 있다. 대쉬보드를 생성하려면 먼저 그리드, 차트를 생성하여 등록하고, 대쉬보드를 생성하여 등록된 차트, 그리드등을 원하는 형태로 배치하고, 대쉬보드를 등록하는 것이다. 대쉬보드를 한번 등록하면 원본 그리드, 차트를 변경하더라도 그 대쉬보드에 등록된 차트, 그리드는 변경되지 않는다.
사용자는 오른쪽의 대쉬보드와 관련된 정보를 생성하고, 변경하고, 삭제하거나 선택할 수 있다. 그리고 대쉬보드에 외부 url을 우하단의 "Link URL"항목에 입력하여 대쉬보드에 외부 페이지를 입력할 수 있다. 사용자마다 권한여부에 따라 표시될 수 있는 대쉬보드 항목이 다르게 돌 수 있으므로, 로그인하지 않아도 데이터를 표출하려면 권한을 ALL로 설정해야 한다.
Dashboard 생성 및 편집
대쉬보드를 생성하고 차트나 그리드등을 추가하기 위해서 대쉬보드 편집화면에서 "Row+"버튼을 이용하여 row를 생성하고, "Row-"버튼을 이용하여 아래쪽부터 row를 삭제할 수 있다. Row에 판넬을 생성했다면 그 판넬을 삭제한 이후에 삭제할 수 있다. Chart+, Grid+, HTML+, URL+ 버튼을 이용하여 row에 판넬을 추가할 수 있다. 판넬의 내용으로 저장해 둔 차트나 그리드를 선택할 수 있다. 단, 사용자로부터 입력을 받는 입력 매개변수를 갖는 차트와 그리드는 판넬에 등록할 수 없다.
HTML+ 버튼을 이용하여 HTML 또는 자바스크립트, chart.js를 이용하는 jquery 데이터를 표시할 수 있다. ID 애트리뷰트를 설정했다면, 다른 대쉬보드 구성요소와 동일한 값이 설정될 수 있으므로, ID를 "_ID"로 지정하여 사용하면 된다.
URL을 이용하여 접근할 때에는 'X-Frame-Options' 값에 따라 접근할 수 없는 경우가 있으므로 주의해야 한다. 데쉬보드의 각 패널은 각각 리프래쉬 설정을 할 수 있다.
Chart
SQL질의를 그래프로 표시할 수 있다. Chart의 Result탭에서 질의결과를 확인할 수 있고 Setting tab에서 차트 표시에 관련한 파라메터를 설정할 수 있으며, 결과로 표시되는 차트는 Char 탭에서 확인할 수 있다.
MWA는 시계열 차트를 쉽게 생성할 수 있는 "Builder"를 제공한다. 사용자는 집계할 시간 간격을 설정할 수 있고, X축과 Y축에 해당되는 데이터를 설정할 수 있다. Y축 값이 숫자인 경우, SUM 또는 AVERAGE와 같은 함수를 사용할 수 있다. 숫자가 아닌 경우, 레코드 카운트를 이용하여 표시할 수 있다. 시계열 그래프를 생성하면 기본으로 라인 차트를 생성한다. 기본 설정은 Setting 탭에서 변경할 수 있다. 차트 화면의 아래쪽에 그리드를 표시하려면 Config 버튼을 클릭하고 원하는 칼럼을 Columns탭에서 선택한다. 칼럼 데이터를 그리드에 표시할 때 좌우 폭은 비율에 따라 설정된다. 예를 들어 Width에 1, 2, 1의 값을 주면 화면 표시 비율은 25%, 50%, 25%의 순으로 설정된다.
질의문을 실행할 때, 입력 매개변수를 설정할 수 있다. 입력매개변수는 Variables 탭에서 Config 버튼으로 등록해야 한다. 매개변수의 type은 Text, number, date, time, datetime, 및 select query를 선택할 수 있다.
질의문에서 매개변수의 이름은 {} 문자로 둘러싸서 기술한다. 질의가 실행될 때, 매개변수는 사용자가 입력한 값으로 치환된다. 단순히 치환하므로 문자열을 사용할 경우 따옴표를 이용해야 한다. SELECT문의 경우 옵션에서 ',' 문자를 이용하여 분리해야 한다.
e.g.: SELECT * FROM TEST_TABLE WHERE C3 = '{V3}'
Preview 버튼으로 차트 설정을 저장하지 않고 차트 데이터를 표시할 수 있다. View 탭에서 Output 버튼으로 결과값을 Excel, JSON, csv, TDE(Tableau data extract) 타입의 파일로 저장할 수 있다.
Grid
질의 결과를 테이블 형태로 표시하기 위해서 Grid를 사용한다. 질의 결과에서 필요하지 않은 칼럼을 제외하고 표시할 수도 있다. Builder버튼을 이용하여 WHERE절을 작성하는데 도움을 받을 수 있다. 단, 이 기능은 단순 조건절만을 지원한다. 결과데이터에서 특정 칼럼만을 선택하려면 Config버튼을 클릭하여 Columns 탭에서 "+"버튼을 클릭한 후, 타이틀과 출력 너버 설정을 하고 사용할 수 있다.
Column width는 chart의 grid설정에서 설명한 것 처럼 백분율 비율로 처리된다. 질의 매개변수 설정 또한 Chart와 같은 기능을 수행한다. Output에서 질의 결과를 다양한 파일로 저장할 수 있는 점도 차트와 동일한 기능이다.
Query
SQL
질의를 수행하여 결과를 표시한다. LIMIT또는 DURATION 관련 설정이 오른쪽 패널에 표시된다.
질의문을 저장해 두고 재실행할 수 있다. 또한 실행한 질의문들을 히스토리창에서 불러 올 수 있다. 질의 실행창에서 결과를 그리드나 차트 화면으로 전환할 수 있다. 북마크된 질의는 "Bookmark Quries" 메뉴에서 확인할 수 있다.
"Tables"탭에서 생성한 테이블 리스트와 각 테이블 스키마를 확인할 수 있다. 테이블 명을 클릭하면 그 테이블의 일부 데이터가 표시된다. 질의를 매 5초마다 재실행하여 결과를 리프레쉬한다. "Results"탭에서 질의 결과를 확인할 수 있다. "Input selected text at cursor position" 체크박스를 선택한 경우, 클릭한 위치의 문자열이 질의 입력창에 자동으로 입력된다. Grid 또는 Chart와 같은 방법으로 질의 결과를 다양한 포멧의 파일에 저장할 수 있다.
Table Explorer
테이블 탐색자는 테이블 데이터의 입력 상항을 표시한다. 입력한 시간에 의해 데이터 입력 수의 합계를 구하고, 이를 그래프 형태로 표시한다. 그래프에서 일정 영역을 drag로 선택하면 그 기간 동안의 입력 레코드의 수를 볼 수 있다.
화면의 오른쪽 상단 부분에 Zoom mode(시간 범위 조정을 위해서 사용)의 ON/OFF버튼이 있다.
Bookmark Queries
SQL 화면에서 실행 후 북마크한 질의문의 관리 화면이다. 질의문 리스트를 클릭하면, 질의문의 상세 내역을 확인할 수 있다. 또한 "to SQL" 버튼을 이용하여 SQL 화면으로 전환할 수 있다.
Collection
Data Collection
The registered collector managers and lists of collectors will be aggregated in a tree format based on a table unit from the database. Template file (.tpl), regex file (.rgx) and preprocess file (.py) must be located in the specified path of MACHBASE_HOME.
Template file (.tpl): $MACHBASE_HOME/collector
Regex file (.rgx): $MACHBASE_HOME/collector/regex
Preprocess file (.py): $MACHBASE_HOME/collector/preprocess
In a table, the number of records will be displayed on the right next to the icon of an eye. When you hover your mouse over the eye icon, "View Table" window will be appeared. If you click the icon, it will take you to "Table Explorer" to check the contents. And below tables show execution states whether the collector or collector manager is running, and collection speed. On the right side of each collector, you can find three little icons representing START, STOP and DROP commands.
Click "add Manager" button to execute the collector manager in a separate popup window. In this window, you can register a collector manager with "Create Manager" button, and can find the three icons on the right side representing RENAME, DROP and LIST features. LIST will display all the collectors that are registered to the collector manager.
You can create a collector with "add Collector" button. Select the collector manager first and insert a collector name. The collector name must be unique in the collector manager.
To click "Template" button, a window will be appeared. You can manage templates in this window and click "New" button to create a new template. at the end of each template, there is an icon to edit the existing template. With this feature, you can create a new template by changing the name of the existing template and save. Caution must be exercised to check whether DB_ADDR and DB_PORT are correct before saving them. If hovering your mouse over a box where you type in or select items, you can find the information form tooltip description..
Preprocess
It manages script files of preprocess that are used in the template file. If you select a collector manager from the upper right corner of the screen, it fetches the list of preprocess script files. To click "Reload" button under of the collector manager, it fetches the list of script files again.
To click a preprocess script file, you can select and modify the contents, and even initialize the script contents by clicking "New" button. Aslo the contents of the script file will be displayed on the left side. To click "Save" button, it can save inserted contents. In this case, if a new file name is inserted, a new script file will be created.
Regular Expression
It manages regular expression files that are used in template files. When you select a collector manager on the upper right corner of the screen, it fetches the list of regular expression files. To click "Reload" button under the collector manager, it fetches the list of regular expression files again.
When you click a regular expression file from the list on the right side, you can select and modify the contents, and even initialize the contents of regular expressions and create a new regular expression by clicking "New" button.
Insert regular expressions on the top. See below for detailed instructions.
Regex(REGEX): regular expression to analyze data.
Start(START_REGEX): a regular expression to represent a starting point of data. It is included for REGEX analysis.
End(END_REGEX) : a regular expression to represent a ending point of data. It is excluded for REGEX analysis.
- If END_REGEX is not inserted, a collector will not be operated.
On the bottom of the screen, a table of column list will be displayed. In the table, it lists the results of regular expressions that will be stored in tables. Regex No is the result number representing execution results of machregex and the rest of them are a column name, type, and size of a table. These items can be added, modified and deleted.
Click Test tab to conduct sample test. Insert sample data and click "Test" button on the right side of the tab, "Test Regex" window will be displayed so that users can check the execution results of machregex. If the test results are succeeded, select columns from Columns tab to use. The message will be displayed on the window telling you whether the test was succeeded. If so, fill out related information for column name, type and size. When you click "Apply" button, it will organize the column list again. And the existing column list will be disappeared.
DB Admin
Tables
It manages tables and table spaces. It checks schema and indexes of tables.
Running Queries
It selects the currently operating queries. If the currently operating queries are not required, it can make it stop.
System Monitoring
This is a dashboard to monitor system information of Machbase Web analytics Server. If there is item or information that cannot be obtained from the server, it will be left in a blank.
If you wan to monitor other server, MWA must be operating in that server and you can access it if you have "Web URL" that was used when register the server.
Preferences
Servers
Register a server. Users with ADMIN authentication can access it.
Server name | It will be used for IP and port. |
---|---|
Host and Port | It is IP and port to access Machbase DB. If the sever is the same as Machbase Web Analytics, 127.0.0.1 or localhost can be used. |
Web URL | Users can access the server with this URL from their machines. |
UserID and Password | User ID and password to access Machbase database. |
At least one server must be maintained, and for Machbase DB, it is able to execute commands to control the server with "Command" button. When MWA is currently operating, for another Machbase DB, all features can be used except commands that are controlled by "Command" button. If another Machbase database is installed in other server and MWA is operating, that Machbase database can be controlled by "Command" button.
How to change your private IP to public IP
Please change your private IP to public IP in the following way.
1) Go to MWA> Preferences> Servers.
2) Action - Edit server: change server settings.
3) Host: Enter the IP to be changed.
4) Click the "OK" button.
Groups
It manages available groups. Users with ADMIN authentication can access. Groups registered here can be used for categorizing Chart, Grid, Dashboard, and Bookmark Query.
Users
It manages users. Users here mean that users who use Machbase Web Analytics not Machbase database users.
It can set starting screen of users. Starting screen can choose from System Dashboard, SQL and Dashboard. If Dashboard is selected, it can select one of available dashboard should be selected as starting screen.
ADMIN users can register available servers and groups for each user.
Available Groups: set ADMIN/USER to Authority.
Available Servers : set default server.
Users with USER authentication can only modify their information such as password.