1
0
This commit is contained in:
2023-09-07 10:47:34 +08:00
parent 51a9c29a6f
commit c2aadc123b
29 changed files with 4183 additions and 0 deletions

20
.gitignore vendored Normal file
View File

@@ -0,0 +1,20 @@
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Run temp file and dir
docs/temp/
# Built Visual Studio Code Extensions
*.vsix
*.bak

Binary file not shown.

View File

@@ -0,0 +1,415 @@
# 5GC OMC安装指南
## 1 安装环境及依赖包
X86_64通用服务器
```
计算机或者虚拟机环境(最低配置)CPU: 2, Memory: 8.00 GB, Disk: 200 GB
操作系统环境Ubuntu 18.04
数据库环境mariadb-10.3.38-GA
WEB服务: nginx 1.14.0 (ubuntu)
安装包名称格式OMC 5GC16.1.1.amd64.deb (其中,'5GC16.1.1'为版本号, 'amd64'为硬件平台名称)
```
麒麟arm64服务器
```
计算机或者虚拟机环境(最低配置)CPU: 2, Memory: 8.00 GB, Disk: 200 GB
操作系统环境:银河麒麟 kylin server v10
数据库环境mariadb-10.3.35-1.p01.ky10.aarch64
WEB服务: nginx 1.16.1-11.p01.ky10.aarch64
安装包名称格式OMC 5GC16.1.1.arm64.rpm (其中,'5GC16.1.1'为版本号, 'arm64'为硬件平台名称)
```
注意事项:
```tips
* 以下操作以银河麒麟arm64硬件平台为例
* 全新安装方式,数据库的数据会被全部清除
```
### 1.1 安装数据库
注意:非第一次安装或者全新安装请跳过此步骤
mariadb版本mariadb-server-3:10.3.35-1.p01.ky10.aarch64
软件安装
```bash
# yum clean all
# yum makecache
# yum -y update
# yum install -y mariadb
# yum install -y mariadb-server-3:10.3.35-1.p01.ky10.aarch64
```
配置修改
修改/etc/my.cnf.d/mariadb-server.cnf
增加或者修改如下三行:
```
bind-address=0.0.0.0
port=33066
max_connections=1000
```
验证测试
```bash
# systemctl enable mariadb
# systemctl restart mariadb
# systemctl status mariadb
```
正常显示结果如下:
```bash
[root@ems omc]# systemctl status mariadb
● mariadb.service - MariaDB 10.3.35 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2023-04-30 11:09:56 CST; 7h ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 5127 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 37
Memory: 101.0M
CGroup: /system.slice/mariadb.service
└─5127 /usr/libexec/mysqld
```
修改mysql数据库root密码:
```tips
!!!注意!!!: 修改后的密码需要更新到/usr/local/omc/etc/restconf.yaml, crontask.yaml和nbi_alarm.json等配置文件中的数据库信息配置项
```
```bash
[root@ems ~]# mysql -u root
MariaDB [none]> use mysql
MariaDB [mysql]> update user set password=PASSWORD('******') where User='root';
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '******'
MariaDB [mysql]> quit
```
通过以下登录命令确认修改成功
```
[root@ems ~]# mysql -u root -h 192.168.0.229 -P 33066 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 95
Server version: 10.3.35-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
```
### 1.2 安装WEB服务
注意:非第一次安装或者全新安装请跳过此步骤
WEB服务: nginx-1.16.1-11.p01.ky10.aarch64
* 软件安装
```bash
# yum clean all
# yum makecache
# yum -y update
# yum install -y nginx
```
* 验证测试
```bash
# systemctl enable nginx
# systemctl daemon-reload
# systemctl start nginx
# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2023-05-02 20:57:48 CST; 3h 12min ago
Main PID: 23163 (nginx)
Tasks: 5
Memory: 19.3M
CGroup: /system.slice/nginx.service
├─23163 nginx: master process /usr/sbin/nginx
├─23164 nginx: worker process
├─23165 nginx: worker process
```
## 2 安装配置OMC
### 2.1 安装OMC软件包
* 导入签名证书
OMC软件包使用了RPM的GPG数字签名第一次安装时需要导入签名证书, OMC的签名证书为RPM-GPG-KEY-OMCUSER
```bash
# rpm --import RPM-GPG-KEY-OMCUSER
```
* 验证软件包完整性
显示"digests signatures OK"表示软件包是合法签名
```bash
# rpm -K OMC\ 5GC16.1.1.arm64.rpm
OMC-5GC16.1.1-20230628.ky10.aarch64.rpm: digests signatures OK
```
* 安装OMC软件包
```bash
# rpm -ivh OMC\ 5GC16.1.1.arm64.rpm
```
安装后的软件包目录树(实际目录树会随版本不同有变化,以下仅供参考):
```bash
# cd /usr/local
# tree omc -L 2
omc
├── backup
├── bin
│   ├── cpsshkey.sh
│   ├── crontask
│   ├── importdb.sh
│   ├── nbi_alarm
│   ├── ne-hosts
│   ├── omcsvc.sh
│   ├── restagent
│   └── tables.txt
├── database
├── etc
│   ├── cm
│   ├── crontask.yaml
│   ├── db
│   ├── default
│   ├── nbi_alarm.json
│   ├── restconf.yaml
│   ├── schema
│   └── tasks.yaml
├── htdocs
│   └── front
├── license
├── log
│   ├── crontask.log -> /usr/local/omc/log/crontask.log-20230629
│   ├── crontask.log-20230628
│   ├── crontask.log-20230629
│   ├── nbi_alarm
│   ├── restagent.log -> /usr/local/omc/log/restagent.log-20230629
│   ├── restagent.log-20230628
│   └── restagent.log-20230629
├── software
└── upload
#
```
### 2.2 修改nginx服务的OMC配置
安装软件包成功后可以根据实际环境对nginx的OMC配置进行修改前端Web的默认侦听端口是8888除了侦听端口其它不用修改
```bash
# cd /etc/nginx/conf.d
# cat omc.conf
server {
listen 8888 default_server;
root /usr/local/omc/htdocs/front/;
index index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
}
```
### 2.3 修改OMC Web前端配置
根据实际环境修改如下文件的IP地址和端口端口需要和OMC的配置文件一致, OMC后端ipv4服务侦听端口默认为3030, ipv6的默认侦听端口为6060:
```bash
# sudo sed -i.bak 's/192.168.2.119:/192.168.0.229:/g' /usr/local/omc/htdocs/front/config.js
```
### 2.4 修改OMC后端配置
说明:
```tips
* 目录/usr/local/omc/etc/default下的文件是OMC程序的初始配置文件不要修改
* 拷贝default目录下的文件至/usr/local/omc/etc目录根据使用环境修改配置文件
```
```bash
# cd /usr/local/omc/etc
# cp default/* ../
```
根据实际的运行环境对配置文件restconf.yaml, crontask.yaml, nbi_alarm.json, nbi_agent.json, 4a_agent.yaml及tasks.yaml进行修改, 特别是侦听端口和数据库配置信息(包括端口/用户/密码)
### 2.5 数据库配置
注意:第一次或全新安装执行该步骤, 该步骤会清除掉原有的omc数据库
```bash
# /usr/local/omc/bin/importdb.sh install
```
升级安装执行该步骤
```bash
# /usr/local/omc/bin/importdb.sh upgrade
```
### 2.6 防火墙配置
如果系统默认是打开防火墙,需要添加配置文件中配置的服务和端口(端口要和实际环境配置一致),如下:
```bash
# firewall-cmd --add-port=33066/tcp --permanent
# firewall-cmd --add-port=8443/tcp --permanent
# firewall-cmd --add-port=8080/tcp --permanent
# firewall-cmd --add-port=4443/tcp --permanent
# firewall-cmd --add-port=8888/tcp --permanent
# firewall-cmd --add-port=3030/tcp --permanent
# firewall-cmd --add-port=4040/tcp --permanent
# firewall-cmd --add-port=5050/tcp --permanent
# firewall-cmd --add-port=6060/tcp --permanent
# firewall-cmd --add-port=31232-31271/tcp --permanent
# firewall-cmd --add-port=2222/tcp --permanent
# firewall-cmd --add-port=2152/udp --permanent
# firewall-cmd --reload
```
### 2.7 配置被管网元的SSH信任关系
为了便于OMC管理被管网元(包括登录网元,安装软件,备份配置文件和执行命令等操作), 第一次安装时需要配置被管网元与OMC的SSH信任关系便于无密码SSH登录
* 修改/usr/local/omc/bin目录下的nehosts文件(******替换为明文密码), 根据现网环境增加被管网元的ip, 用户和密码信息列表
* 运行脚本cpsshkey.sh, 将公钥拷贝至被管网元
* 运行ssh root@192.168.4.133验证是否可以无密码登录
* 执行成功后, 为了防止密码泄露清除掉nehosts文件的密码信息
```bash
[root@ems bin]# cat nehosts
# host user password
# Example: 192.168.4.133 root password
192.168.4.133 root ******
192.168.4.134 root ******
[root@ems bin]# ./cpsshkey.sh
[root@ems bin]# ssh root@192.168.4.133
```
## 3 启动和停止OMC
### 3.1 系统服务启动
```bash
# systemctl enable restagent.service
# systemctl enable crontask.service
# systemctl enable sshsvc.service
# systemctl enable captrace.service
# systemctl daemon-reload
```
执行上述命令后,它被设置为作为 systemd 服务运行。
### 3.2 手动启动/查询/停止OMC
您可以按如下方式启动查询状态停止和重新启动OMC, 以下命令可通过/usr/local/omc/bin/omcsvc.sh脚本一次性执行
```bash
# cd /usr/local/omc/bin
# ./omcsvc.sh start/stop/restart/status
```
单个OMC进程的执行命令如下, 启动/状态/停止/重启:
```bash
# systemctl start restagent.service
# systemctl start crontask.service
# systemctl start sshsvc.service
# systemctl start captrace.service
```
```bash
# systemctl status restagent.service
# systemctl status crontask.service
# systemctl status sshsvc.service
# systemctl status captrace.service
```
```bash
# systemctl stop restagent.service
# systemctl stop crontask.service
# systemctl stop sshsvc.service
# systemctl stop captrace.service
```
```bash
# systemctl restart restagent.service
# systemctl restart crontask.service
# systemctl restart sshsvc.service
# systemctl restart captrace.service
```
## 4 问题定位跟踪
OMC restagent程序的配置文件在restagent.yamltrace级别的日志通常在调试系统时使用正常运行级别为debug如下配置项所示
```yaml
logger:
file: /usr/local/omc/log/restagent.log
level: debug
duration: 24
count: 90
```
OMC crontask程序的配置文件在crontask.yamltrace级别的日志通常在调试系统时使用正常运行级别为debug如下配置项所示
```yaml
logger:
file: /usr/local/omc/log/crontask.log
level: trace
duration: 24
count: 90
```
OMC sshsvc程序的配置文件在sshsvc.yaml日志配置项如下所示
```json
logger:
file: /usr/local/omc/log/sshsvc.log
level: debug
duration: 24
count: 30
```
OMC captrace程序的配置文件在capconf.yaml日志配置项如下所示
```json
logger:
file: /usr/local/omc/log/captrace.log
level: trace
duration: 24
count: 10
```
## 5 管理核心网系统
通过浏览器输入:[http://192.168.0.229:8888](http://192.168.0.229:8888)

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,24 @@
# 5GC OMC架构及功能
## 架构图
![1689742764754](image/04-5GCOMCArchitecturev0.81/1689742764754.png)
## 开发平台
1. 采用B/S模式运行在linux系统支持x86和arm平台
2. 前端html+css+js
3. 后端Golang+Nginx+MySQL
## 功能清单
1. 拓扑管理(State/Monitor):网络拓扑,系统状态等
2. 故障管理(FM):活动告警/历史告警等
3. 配置管理(CM):网元管理,参数配置等
4. 性能管理(PM):性能统计相关指标项的订阅任务,数据报表,性能门限等
5. 操作维护(MML)MML命令操作系统维护等
6. 日志管理(Log):操作日志,安全日志,告警日志,北向日志等
7. 跟踪管理(Trace):信令跟踪任务创建,信令分析等
8. 安全管理(Security):用户管理,用户组管理,权限管理等
9. 北向接口(NBI: Northbound Interface): 北向接口服务,资源配置数据,性能统计数据, 性能黄金指标, 告警上报, 4A等

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
## EMS Database
---
### 1. Relationship of menu, account, account_menu, title_info
![1679033737734](image/database/1679033737734.png)
通过多表联合查询可一次性获取某个账号的目录结果:
example, acouunt name='manager', lang-key='cn'
```sql
SELECT m.id, json_unquote(json_extract(t.title_json, '$.en')) as title, m.parent_id, m.sort_id FROM title_info t, menu m WHERE m.id IN (SELECT am.menu_id FROM account_menu am WHERE am.account_id = (SELECT id FROM account WHERE name='manager')) AND m.title_id = t.id ORDER BY m.id
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,11 @@
# MySQL install guide
---
## 环境准备
硬件平台辉腾arm服务器
操作系统:麒麟
MySQL8.0.32

120
docs/release note.txt Normal file
View File

@@ -0,0 +1,120 @@
2023.05.31
1. 中移动北向性能接口性能数据xml文件
2. 15分钟性能统计数据的获取/补采接口
3. 数据库表measure_title的几个指标项带有'\n'问题
4. OMC Web UI 问题修复: 活动告警/历史告警查询
5. 性能管理测量任务的创建修改优化, 测量数据的多维度查询
6. 修改UDM任务激活成功后状态显示未激活的问题
2023.06.14
1. 中移动北向性能接口性能数据xml文件分小时目录存储
2. 中移动北向资源接口资源配置数据xml文件按天目录存储
3. 安全管理下的用户管理可以增删改
4. 告警级别颜色可自定义,告警声音可自定义
5. 参数配置增加optional选填或必填默认为选填
6. MML增加exec shell命令可执行linux shell命令
7. UDM的用户数据MML命令增加export udmuser/export authdat命令返回“本地UDM数据禁止导出”
8. 导出网元可下载zip的文件
9. 增加UPF的参数项
10. 删除网元判断网元状态,如果正常网元删除不成功
2023.06.21
1. 性能门限产生越限告警
2. 增加软件管理,支持软件包上传下载和删除
3. 支持导入网元网元需要进行ssh密钥的发放
4. MML命令拆分为系统操作MML和用户数据MML
5. 数据访问控制---安全部分
6. 完成搜索框的自动检索功能---对应测试用例:7.10 性能测量数据的查询
7. 完成导出全部、打印全部数据功能
8. 软件完整性校验
2023.06.28
1. 增加性能报表
2. 北向增加告警上报接口测试需要oss的socket客户端模拟器
3. 增加性能订阅数据表的定期备份功能
4. 修正页面的问题:参数配置网元标识未刷新加载
5. 修正历史告警页面的多余按钮
2023.07.06
1. 增加跟踪管理功能项,实现跟踪任务创建/详细信息,网元暂未实现跟踪任务创建/修改/删除
2. 北向增加黄金指标上报的相关接口
3. 4A管控实现从账号和角色的相关查询/创建/修改/删除
4. EMS(OMC后台)可作为一个网元增加至网元管理界面,并实现系统状态监控
5. 网元管理的网元信息增加了省份厂商名称网络标识的参数设置项并实现把网元标识rmUID/neUID),网元名称友好名称UserLabel),网元虚拟化标识,省份,厂商名称,网络标识下发到网元进行设置,网元暂未实现接收该消息
6. 性能任务修改开始时间/结束时间的完整性(增加秒)
7. 软件管理页面完成,可实现上传/下载/删除,网元的软件下发/激活/回退,和网元版本信息查询
8. 修正活动告警/历史告警/数据管理(性能管理)的查询结果的全部数据导出功能,修正活动告警的个性化设置(告警颜色/声音)
9. 修正了性能统计任务在网元不正常情况下无法删除的问题
10. 修正了性能统计任务在网元不存在(创建性能统计任务后未激活情况,修改了网元的标识导致查找为空)激活提示成功的问题
2023.07.25
1. 前端告警声音可自定义上传声音文件
2. 备份管理支持网元备份文件的查看和下载/删除功能
3.
4.
2023.07.29
1. 自定义性能指标创建,查询,修改和删除
2. 用户在线状态,用户注销
3. 告警手动同步bug有网元状态无法下发后续网元Get请求
4. 性能采集超时修复bug: 时间格式问题(目前仍遗留任务挂起后激活有告警产生,及恢复告警)
5. OMC ssh mml框架可通过ssh admin@xx.xx.xx.xx -p 2222进行登录目前只创建了一个mml命令dsp neInfo:neType=...的脚本
2023.07.30
1. restconf.yaml增加配置项omc: testMode, 为true表示测试模式, 部分操作和检测将被略过, 网元软件的激活和回退操作在testMode=true时不进行实际操作
2. 用户登录时, 当配置项authsession=single时一个用户只允许在线一个session, 返回403-2。
3. Web上设置的注销等待时长将被应用在用户登录会话超时时长
4. 添加告警前转接口的设置
5. 修正日志设置、性能报表设置的数据回填
6. 增加更新超时会话为离线状态
7. 增加判断是否web的定时刷新操作定时刷新操作不更新握手时间戳
8. 系统操作mml分离出ausf网元部分
2023.07.31
1. 修复OMC显示系统状态信息问题
2. 告警前转增加短信接口, 记录前转日志web界面查看日志未完成
3. 登录增加验证码
4. 自定义性能指标与性能门限进行关联
5. 上传软件包时版本说明comment, 填充网元类型和输入的版本号, 如AMF16.1.1
2023.08.03
1. nbi_agent问题修改
2. omc mml 4~10
3. 前端告警前转, 软件管理
2023.08.05
1. 增加dsp nelink命令需在表ne_link中构造数据
2. dsp licenseinfo增加使用和功能开启列表, 可在新增的配置文件testconfig.yaml进行设置输出的数据信息
2. 增加system_log表启动定时任务扫描进程情况写入system_log
3. omc mml 增加del/atc/dea (删除/激活/去激活),后面两个暂时不可用
4. 修复跟踪任务下发无task id
2023.08.06
1. 修改add/mod measuretask无法成功的问题
2. 增加日志备份的自动定时任务
3. 前转和北向日志增加时间搜索条件
4. 修复OMC MML的界面命令的拼接问题
2023.08.07
1. 操作维护增加dsp nbicm/upg neversion命令用例11.1.4/11.1.11
2. 增加记录mml历史记录文件的功能只能在配置文件/usr/local/omc/etc/sshsvc.yaml进行配置 用例11.1.17
3. Web界面的OMC MML部分可以运行, 输入排版暂没有对齐
2023.08.08
1. 操作维护增加dsp neconfig命令用例11.1.17 配置数据)
2. 增加user,role,permission的映射关系RBAC, 数据库中增加test1,test2的用户 test1只能做查询操作test2可做查询和增加/删除/修改类操作mml命令用例11.1.17 权限)
3. 注意后续测试用test1test2用户用户权限的数据没有完全配置好admin无权限执行mml命令
2023.08.10
1. 支持4A单点登录sso功能, 注意没有对用户进行认证, 需关闭toke的校验功能
2. 用户管理,用户组管理 (未完整实现)

44
docs/tips.txt Normal file
View File

@@ -0,0 +1,44 @@
rsync -avz agtuser@192.168.6.188:/home/agtuser/goprojects /home/simon
ssh root@192.168.122.229
192.168.0.109
防火墙配置
firewall-cmd --add-service=https --permanent
firewall-cmd --add-service=samba --permanent
firewall-cmd --add-port=8888/tcp --permanent
firewall-cmd --add-port=445/tcp --permanent #samba
firewall-cmd --add-port=139/tcp --permanent #samba
firewall-cmd --reload
firewall-cmd --list-all
add measuretask:netype=AMF,neids=["SZ_T01"],granuloption=30M,kpiset=[{"Code":"AMFHA01","KPIs":["AMF.AuthReq"]}]
lst measuredata:id=40,starttime="2023-07-10 09:50:13",endtime="2023-07-10 11:00:00"
lst measuredata:id=40,kpiid=UDM.SmfUecmRegReq,starttime="2023-07-10 13:36:01"
/api/rest/dataManagement/v1/omc_db/param_config?SQL=select+ne_type,ne_id,top_tag,json_extract(param_json,'$.*[*].name')+AS+param_name,JSON_EXTRACT(param_json,'$.*[*].value')+as+param_value+from+param_config
select+ne_type,ne_id,top_tag,json_extract(param_json,'$.*[*].name')+AS+param_name,JSON_EXTRACT(param_json,'$.*[*].value')+as+param_value+from+param_config
license:
lst license
dep license:srcnetype=AMF,srcneid=SZ_01,dstnetype=SMF,dstneid=SZ_01,number=50
rel license:number=1000
ins license:netype=UDM,neid=SZ_01,number=10000
adj license:netype=UDM,neid=SZ_01,number=-100
exp license:netype=UDM,neid=SZ_01
uni license:netype=AMF,neid=SZ_01
java -Dfile.encoding=utf-8 -jar ost-20230807.jar