1
0

51 Commits

Author SHA1 Message Date
2be4cfdd03 .. 2024-11-01 15:30:34 +08:00
9acb7caaa1 ... 2024-11-01 15:22:36 +08:00
a547fda132 add version tag for multi-tenant 2024-11-01 15:21:01 +08:00
821af0148e ... 2024-11-01 14:44:33 +08:00
0a43eea194 ... 2024-11-01 14:23:34 +08:00
e11f0235f1 ... 2024-11-01 14:13:11 +08:00
904a13fd56 ... 2024-11-01 14:12:03 +08:00
c4539e30bb ... 2024-11-01 10:50:47 +08:00
103140f08d ... 2024-11-01 10:46:39 +08:00
48e6bfd67d Merge branch 'main' into multi-tenant 2024-11-01 10:43:40 +08:00
05940359d8 git ignore update 2024-10-25 18:48:39 +08:00
9ddc4ea6cb exclude bin file and release file 2024-10-25 15:23:17 +08:00
e4deb815b9 remove release file 2024-10-25 15:16:22 +08:00
zhangsz
3649afe328 solve conflict file 2024-10-25 14:59:47 +08:00
zhangsz
5cdb82297a rebase 2024-10-25 14:59:45 +08:00
615000ee68 change git local root directory 2024-10-24 18:33:17 +08:00
625b49a6b4 chmod for shell script 2024-10-24 17:27:32 +08:00
2fe1725288 release version 2.2410.2 2024-10-24 17:11:25 +08:00
7ecd7e1602 update makepkg.sh 2024-10-22 15:05:15 +08:00
9dd9a2f391 copyright 2023 change to 2024 2024-10-22 14:15:23 +08:00
11e1604683 update for project tag with such as multi-tenancy while build package 2024-10-17 16:46:02 +08:00
a78fd76e3b fix: postinst shell script 2024-10-16 16:53:01 +08:00
22119320d1 add: update config file while upgrade 2024-10-16 16:40:50 +08:00
c4142d894b add: upgrade config file while upgrade 2024-10-16 16:22:53 +08:00
815a754485 release 2.2410.1 for multi-tenant 2024-10-12 13:58:59 +08:00
1bbaf9b4d7 Merge branch 'main' into multi-tenant 2024-10-12 11:03:39 +08:00
ac6ef015eb release 2.2409.1 for multi-tenancy 2024-09-25 18:20:49 +08:00
69a54c9243 Merge branch 'main' into multi-tenant 2024-09-25 17:09:04 +08:00
860b53b06a add: dkpg support environment parameter to do DB install/upgrade 2024-09-03 16:12:18 +08:00
7831377857 release for 2.2408.1 2024-08-26 10:46:38 +08:00
dfb1b87772 add: doc and ctyunos tips 2024-08-26 10:46:21 +08:00
8c2e7957d9 fix: remove kvdb installation 2024-07-23 19:00:54 +08:00
5902ba2f51 release 2.2407.5 for multi-tenant 2024-07-23 15:20:32 +08:00
5a822828e6 release 2.2407.4 for multi-tenancy 2024-07-19 10:20:03 +08:00
a4ff093c81 release 2.2407.3 for multi-tenancy 2024-07-16 10:01:53 +08:00
41ea7703f8 change doc sub-directory name 2024-07-16 09:52:12 +08:00
ed650b18db rename docs sub-directory 2024-07-12 17:38:35 +08:00
ca9b21ffe3 release 2.2407.2 for multi-tenancy 2024-07-11 11:53:09 +08:00
52f038e4e1 opt: setting firewall 2024-07-09 16:17:52 +08:00
761e4ed44a opt: setting firewall 2024-07-09 16:13:50 +08:00
2097f177e0 opt: setting firewall in package installation 2024-07-09 16:10:52 +08:00
07868f83dc Merge branch 'main' into multi-tenant 2024-07-09 15:16:56 +08:00
3837d1d491 keep logo directory 2024-07-06 16:15:04 +08:00
5d390fcefc keep system directory 2024-07-06 15:22:23 +08:00
d17ae34d37 release 2.2407.1 multi-tenancy beta version 2024-07-05 19:47:04 +08:00
272ff190c0 fix: disable system auto upgrade 2024-07-05 10:49:18 +08:00
66366c39fc 更新omc架构和功能文档 2024-07-01 11:58:36 +08:00
c86f8e0356 release 2.2406.4 2024-06-28 15:37:02 +08:00
152813bbd4 add: omcuser and cdr format 2024-06-28 15:36:25 +08:00
a7e9e6acb7 release 2.2406.3 2024-06-26 15:19:44 +08:00
bf6a756b28 change db to tenants_db 2024-06-19 11:44:45 +08:00
248 changed files with 130772 additions and 2156 deletions

16
.gitignore vendored
View File

@@ -8,14 +8,18 @@
# Local History for Visual Studio Code
.history/
.idea/
# Run temp file and dir
docs/temp/
# Built Visual Studio Code Extensions
*.vsix
*.log
*.log
*.bak
*.exe
# Build Output
tmp/*
# build and release package
build/
!build/usr/local/omc/etc/db
debbuild/
!debbuild/22.04/DEBIAN/
!debbuild/DEBIAN/
release/

View File

@@ -4,34 +4,23 @@
OS: Ubuntu 18.04 / 22.04 (Recommendation)
Golang: go1.24.2 (or above)
Arch: amd64
Golang: go1.22.1 linux/amd64
Database: 10.6.16-MariaDB, Redis server v=5.0.5 (or above)
node.js: v20.18.0 (or above)
node.js: v18.16.0 (or above)
## Build Guide
### Pull Code
`pwd` default in `/root`
```bash
git clone https://xxx@git/ems.git omc.git
cd omc.git && ls
# be.ems build.ems fe.ems.vue3
cp build.ems/pkg-* .
```
### Build System Pageage Manager
Modify the information in the script as appropriate
```bash
# Universal
bash pkg.sh --web --api -v 2.2508.1
# RemoveChinese
bash pkg-remove-chinese.sh --web --api -v 2.2508.1
# Docker
bash pkg-docker.sh -v 2.2508.1
git clone https://xxx@bitbucket.org/bluearcuscom/ems.git omc.git
cd omc.git
git pull
cd fe.ems.vue3
npm install
npm run build
cd ../build.ems
./build.sh deb
```

BIN
bin/binWriter Normal file

Binary file not shown.

View File

@@ -1,164 +0,0 @@
#!/usr/bin/env bash
set -e
# Check if Docker is installed
if command -v docker &> /dev/null; then
echo $(docker --version)
else
echo "Docker is not installed"
exit 1
fi
# Default Version
VERSION="1.0.0"
# Default Platform
PLATFORM="amd64"
# Default System
SYSTEM="ubuntu22.04"
# usage
usage() {
echo "Usage: bash $0 [OPTION]"
echo
echo "Build Software Package OPTION:"
echo " -v, --version Specify the version"
echo " -p, --platform Specify the platform architecture (amd64,arm64)"
echo " -s, --system Specify the system image (ubuntu22.04,alpine3.20)"
echo " -h Display this help message"
echo
exit 1
}
# Read command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-v|--version) VERSION="$2"; shift 2 ;; # Processing the version after -v
-p|--platform) PLATFORM="$2"; shift 2 ;; # Processing the platform after -p
-s|--system) SYSTEM="$2"; shift 2 ;; # Processing the system after -s
*) usage ;;
esac
done
# output result
echo "Version: $VERSION"
# =================== Compile System Information
# Determine if -p is passed in
if [ -n "$PLATFORM" ]; then
case $PLATFORM in
amd64) ;;
arm64) ;;
*)
echo "Error: platform be: $PLATFORM"
echo "can only be amd64/arm64"
exit 1
;;
esac
fi
echo "Platform: $PLATFORM"
# Determine if -s is passed in
if [ -n "$SYSTEM" ]; then
case $SYSTEM in
ubuntu22.04) ;;
alpine3.20) ;;
*)
echo "unknown system image: $SYSTEM"
exit 1
;;
esac
fi
echo "System: $SYSTEM"
# =================== Compile Variable Information
# Script Path
RootDir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Compile Linux System Directory
BuildLinuxDir=${RootDir}/linux
# Compile Package Management Directory
BuildPackagelDir=${RootDir}/pkg
# Compile the build directory
BuildDir=${RootDir}/tmp
# Release Package directory
ReleaseDir=${RootDir}/release/docker/${PLATFORM}
# Release Package name file
ReleaseFileName=omc-r${VERSION}-docker-${SYSTEM}-${PLATFORM}
# =================== file processing
# Apply file handling
app() {
cd ${BuildDir}
# Database scripts within common are rebuild scripts
modeList="std lite"
for v in ${modeList}; do
# . /Located in the temporary directory
path=./linux/usr/local/etc/omc/database/${v}
cp -rf $path/common/* $path/install/
cp -rf $path/common/* $path/upgrade/
rm -rf $path/common
done
}
# =================== compile
docker_build() {
cd ${BuildDir}
# Replacement Tags {version} {arch}
sed -i "s/{version}/${VERSION}/g" ./${ReleaseFileName}/omc-docker.sh
sed -i "s/{arch}/${PLATFORM}/g" ./${ReleaseFileName}/omc-docker.sh
sed -i "s/{system}/${SYSTEM}/g" ./${ReleaseFileName}/omc-docker.sh
# check docker image
if ! docker images | grep -q "mariadb-$PLATFORM\s*10.6.21"; then
docker pull --platform linux/${PLATFORM} mariadb:10.6.21
docker tag mariadb:10.6.21 mariadb-$PLATFORM:10.6.21
fi
if [ ! -f ${BuildDir}/$ReleaseFileName/tar/mariadb_10.6.21_$PLATFORM.tar ]; then
docker save mariadb-$PLATFORM:10.6.21 -o ${BuildDir}/${ReleaseFileName}/tar/mariadb_10.6.21_$PLATFORM.tar
fi
if ! docker images | grep -q "keydb-$PLATFORM\s*6.3.4"; then
docker pull --platform linux/${PLATFORM} bitnami/keydb:6.3.4
docker tag bitnami/keydb:6.3.4 keydb-$PLATFORM:6.3.4
fi
if [ ! -f ${BuildDir}/$ReleaseFileName/tar/keydb_6.3.4_$PLATFORM.tar ]; then
docker save keydb-$PLATFORM:6.3.4 -o ${BuildDir}/${ReleaseFileName}/tar/keydb_6.3.4_$PLATFORM.tar
fi
# build omc
docker build --platform linux/${PLATFORM} --build-arg TARGETARCH=${PLATFORM} --build-arg VERSION=${VERSION} -t omc:${VERSION}-${SYSTEM}-${PLATFORM} .
docker save omc:${VERSION}-${SYSTEM}-${PLATFORM} -o ${BuildDir}/${ReleaseFileName}/tar/omc_${VERSION}-${SYSTEM}-${PLATFORM}.tar
# tar package
filename=${ReleaseFileName}.tar.gz
output=${ReleaseDir}/${filename}
tar -czf ${output} ./${ReleaseFileName}
echo "build success => ${output}"
# Generate HAX file
cd ${ReleaseDir}
md5sum ${filename} > ${filename}.md5
echo "md5 => $(cat ${filename}.md5)"
sha256sum ${filename} > ${filename}.sha256
echo "sha256 => $(cat ${filename}.sha256)"
}
# =================== building
echo
echo "building omc..."
mkdir -p ${BuildDir}/${ReleaseFileName}/tar
cp -rf ${BuildLinuxDir} ${BuildDir}
cp -rf ${BuildPackagelDir}/docker/linux ${BuildDir}
cp -rf ${BuildPackagelDir}/docker/tar/* ${BuildDir}/${ReleaseFileName}
cp -rf ${BuildPackagelDir}/docker/Dockerfile.${SYSTEM} ${BuildDir}/Dockerfile
app
docker_build
# bash build-docker.sh --version 2.2505.2 --platform amd64 --system ubuntu22.04
# bash build-docker.sh --version 2.2505.2 --platform amd64 --system alpine3.20

508
build.sh
View File

@@ -1,188 +1,336 @@
#!/usr/bin/env bash
set -e
#!/bin/bash
# Default Version
VERSION="1.0.0"
# usage
usage() {
echo "Usage: bash $0 [OPTION]"
echo
echo "Build Software Package OPTION:"
echo " -v Specify the version"
echo " -h Display this help message"
echo
exit 1
echo "Usage: $0 [OPTION] deb|badeb|rpm"
echo
echo "Build omc package, option as follow:"
echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg"
echo " badeb: ubuntu|debian package build by dpkg"
echo " rpm: centos/redhat package, build by rpmbuild"
echo " -r, =build root directory build root directory, default directory is $HOME/omc.git"
echo " -d dump SQL from database"
echo
}
# Read command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-v) VERSION="$2"; shift 2 ;; # Processing the version after -v
*) usage ;;
esac
done
# output result
echo "Version: $VERSION"
# =================== Compile System Information
# package manager
get_manager() {
if command -v rpm &> /dev/null; then
echo "rpm"
elif command -v dpkg &> /dev/null; then
echo "deb"
else
echo "unknown manager"
cat /etc/os-release
exit 1
fi
}
# Get the package manager of the current system
PACKAGE_MANAGER=$(get_manager)
echo "Package Manager: $PACKAGE_MANAGER"
# System Architecture
get_arch() {
ARCH_UNAME=$(uname -m)
case $ARCH_UNAME in
x86_64) echo "amd64" ;;
aarch64) echo "arm64" ;;
i386|i686) echo "i386" ;;
*)
echo "unknown architecture: $ARCH_UNAME"
exit 1
;;
esac
}
# Get the architecture of the current system
PACKAGE_ARCH=$(get_arch)
echo "Architecture: $PACKAGE_ARCH"
# Operating System Name Version
get_os_name_version() {
if [ -f /etc/os-release ]; then
. /etc/os-release
# 检查 $ID 是否为空
if [ -z "$ID" ]; then
echo "ID is not defined in /etc/os-release"
exit 1
fi
echo "$ID$VERSION_ID"
pkgtype=""
new_args=()
# Traverse all parameters
for arg in "$@"; do
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" ]]; then
pkgtype=$arg
else
echo "unknown ID: /etc/os-release not found"
exit 1
fi
}
# Get the current operating system name version
OS_NAME=$(get_os_name_version)
echo "OS Version: $OS_NAME"
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
fi
done
# =================== Compile Variable Information
# Compile Date
Date=`date +%Y%m%d`
# Script Path
RootDir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Compile Linux System Directory
BuildLinuxDir=${RootDir}/linux
# Compile Package Management Directory
BuildPackagelDir=${RootDir}/pkg
# Compile the build directory
BuildDir=${RootDir}/tmp
# Release Package directory
ReleaseDir=${RootDir}/release/${PACKAGE_MANAGER}/${PACKAGE_ARCH}
# Release Package name file
ReleaseFileName=omc-r${VERSION}-${Date}-${OS_NAME}-${PACKAGE_ARCH}.${PACKAGE_MANAGER}
# =================== file processing
# Apply file handling . /Located in the temporary directory
app() {
# Database scripts within common are rebuild scripts
modeList="std lite"
for v in ${modeList}; do
path=./usr/local/etc/omc/database/${v}
cp -rf $path/common/* $path/install/
cp -rf $path/common/* $path/upgrade/
rm -rf $path/common
done
}
# =================== system package manager
# deb package manager
deb() {
cd ${BuildDir}
# Replacement Tags {version} {arch}
sed -i "s/{arch}/${PACKAGE_ARCH}/g" ./DEBIAN/control
sed -i "s/{version}/${VERSION}/g" ./DEBIAN/control
sed -i "s/{date}/${Date}/g" ./DEBIAN/control
# Packaging deb
chmod 755 -R ${BuildDir}
dpkg -b ${BuildDir} ${ReleaseDir}/${ReleaseFileName}
echo "build success => ${ReleaseDir}/${ReleaseFileName}"
# Generate HAX file
cd ${ReleaseDir}
md5sum ${ReleaseFileName} > ${ReleaseFileName}.md5
echo "md5 => $(cat ${ReleaseFileName}.md5)"
sha256sum ${ReleaseFileName} > ${ReleaseFileName}.sha256
echo "sha256 => $(cat ${ReleaseFileName}.sha256)"
}
# rpm package manager
rpm() {
cd ${BuildDir}
ARCH_UNAME=$(uname -m)
# Replacement Tags {version} {arch} {date}
sed -i "s/{version}/${VERSION}/g" ./SPECS/omc.spec
sed -i "s/{arch}/${ARCH_UNAME}/g" ./SPECS/omc.spec
sed -i "s/{date}/${Date}/g" ./SPECS/omc.spec
# Packaging rpm
chmod 755 -R ${BuildDir}
rpmbuild -bb -D "_topdir ${BuildDir}" ${BuildDir}/SPECS/omc.spec
# Moving package to the distribution directory
if [[ "$OS_NAME" = "kylinV10" ]]; then # kylin system has ky10 tags
mv ${BuildDir}/RPMS/${ARCH_UNAME}/omc-${VERSION}-${Date}.ky10.${ARCH_UNAME}.rpm ${ReleaseDir}/${ReleaseFileName}
else
mv ${BuildDir}/RPMS/${ARCH_UNAME}/omc-${VERSION}-${Date}.${ARCH_UNAME}.rpm ${ReleaseDir}/${ReleaseFileName}
fi
rm -rf ${BuildDir}/RPMS
echo "build success => ${ReleaseDir}/${ReleaseFileName}"
# Generate HAX file
cd ${ReleaseDir}
md5sum ${ReleaseFileName} > ${ReleaseFileName}.md5
echo "md5 => $(cat ${ReleaseFileName}.md5)"
sha256sum ${ReleaseFileName} > ${ReleaseFileName}.sha256
echo "sha256 => $(cat ${ReleaseFileName}.sha256)"
}
# =================== building
echo
echo "building omc..."
rm -rf ${BuildDir} && mkdir -p ${BuildDir}
cp -rf ${BuildPackagelDir}/${PACKAGE_MANAGER}/* ${BuildDir}
if [[ $PACKAGE_MANAGER = "deb" ]]; then
cp -rf ${BuildLinuxDir}/* ${BuildDir}
cd ${BuildDir}
app
deb
elif [[ $PACKAGE_MANAGER = "rpm" ]]; then
cp -rf ${BuildLinuxDir}/* ${BuildDir}/BUILD
cd ${BuildDir}/BUILD
app
rpm
else
echo "unknown runing: $PACKAGE_MANAGER"
exit 1
if [ -z "$pkgtype" ]; then
usage
exit 1
fi
# bash build.sh -v 2.2505.2
# Use a new parameter list
set -- "${new_args[@]}"
GitLocalRoot=${HOME}/omc.git
while getopts "r:d" option; do
case $option in
r)
GitLocalRoot=$OPTARG
;;
d)
dumpdb="yes"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
usage
exit 2
;;
esac
done
if [ ! -d ${GitLocalRoot} ]; then
echo "Not exist directory: ${GitLocalRoot}"
exit 3
fi
ProjectL=omc
ProjectU=OMC
PROJECT=${ProjectL}
VERSION=2.2410.2
RelDate=`date +%Y%m%d`
RelVer=${VERSION}-${RelDate}
Ky10Arch=ky10.aarch64
RpmPkgName=${ProjectL}-${RelVer}.ky10.aarch64.rpm
RpmPkgRename=${ProjectL}-r${RelVer}-ky10.rpm
DebPkgName=${ProjectL}-r${RelVer}-ub*.deb
EmsBEDir=${GitLocalRoot}/be.ems
EmsBuildRoot=${GitLocalRoot}/build.ems
RpmArch=`arch`
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS/
ReleaseDir=${EmsBuildRoot}/release
DumpToolDir=${EmsBEDir}/tools/misc
ProjectTag=""
BuildDir=${EmsBuildRoot}/build
CustomizedDir=${EmsBuildRoot}/customized
BuildOMCDir=${BuildDir}/usr/local/omc
BuildOMCBinDir=${BuildOMCDir}/bin
BuildOMCEtcDir=${BuildOMCDir}/etc
BuildLibDir=${BuildDir}/lib
BuildLibSystemDir=${BuildLibDir}/systemd/system
DebBuildDir=${EmsBuildRoot}/debbuild
DebBuildOMCDir=${EmsBuildRoot}/debbuild/usr/local/omc
DebFEBuildDir=${EmsBuildRoot}/debbuild/usr/local/omc/htdocs
DebBuild2204Dir=${EmsBuildRoot}/debbuild/22.04
DebBuild2204OMCDir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc
DebFEBuild2204Dir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc/htdocs
RpmBuildDir=${EmsBuildRoot}/rpmbuild
RpmFEBuildDir=${RpmBuildDir}/BUILD/usr/local/omc/htdocs
OmcInstallDir=/usr/local/omc
ConfigEtcDir=${EmsBEDir}/config/etc
ConfigSystemdDir=${EmsBEDir}/config/systemd
EmsFEDir=${GitLocalRoot}/fe.ems
EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist
LibDir=${EmsBEDir}/lib
RESTAGENT=restagent
CRONTASK=crontask
SshSvcBin=sshsvc
CapTraceBin=captrace
Data2htmlBin=data2html
NBI_ALARM=nbi_alarm
NBI_AGENT=nbi_agent
AAAA_AGENT=4a_agent
RestagentDir=${EmsBEDir}/${RESTAGENT}
CrontaskDir=${EmsBEDir}/${CRONTASK}
SshSvcDir=${EmsBEDir}/${SshSvcBin}
CapTraceDir=${EmsBEDir}/${CapTraceBin}
Data2htmlDir=${EmsBEDir}/${Data2htmlBin}
DBSQLSrcDir=${EmsBEDir}/database
MiscDir=${EmsBEDir}/misc
FrontBuildDir=${BuildOMCDir}/htdocs
FrontSrcDir=${EmsBEDir}/front
CrontaskSize=27788951
RestagentSize=29525312
BinWriterDir=${HOME}/bin
if [[ ${RpmArch} =~ "x86_64" ]];then
RelArch=amd64
elif [[ ${RpmArch} =~ "aarch64" ]];then
RelArch=arm64
fi
case "${pkgtype}" in
rpm)
ReleasePkgDir=${ReleaseDir}/rpms/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
cd $EmsBEDir
# make rpm
# clear build cache
rm -rf ${FrontBuildDir}/front/*
rm -rf ${RpmFEBuildDir}/front/*
rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${RESTAGENT} ${RestagentSize}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${CRONTASK} ${CrontaskSize}
# cp -rf ${MiscDir}/ne-hosts ${BuildOMCBinDir}
# cp -rf ./nbi/${NBI_ALARM}/bin/${NBI_ALARM} ${BinDir2}
# cp -rf ./nbi/${NBI_AGENT}/bin/${NBI_AGENT} ${BinDir2}
# cp -rf ./${4A_AGENT}/bin/${4A_AGENT} ${BinDir2}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
# rm -rf ${BinDir2}/ne-hosts
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "$dumpdb" = "yes" ]; then
cd ${DumpToolDir}
chmod +x ${DumpToolDir}/dumpsql.sh
${DumpToolDir}/dumpsql.sh
fi
cp -rf ${ConfigSystemdDir}/* ${BuildLibSystemDir}
#unzip ${FrontSrcDir}/front.zip -d ${FrontBuildDir} >/dev/null
mkdir -p ${FrontBuildDir}/front
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
chmod 755 ${BuildOMCBinDir}/*
# chmod 755 ${BinDir2}/*
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
#cp -rf ${BuildDir}/nginx ${RpmBuildDir}/BUILD/etc/
#cp -rf ${BuildDir}/systemd ${RpmBuildDir}/BUILD/lib/
cd ${RpmBuildDir}
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
# rpm --addsign *.rpm
md5sum $RpmPkgRename >omc-md5sum.txt
;;
deb)
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22-${ProjectTag}.deb
fi
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18-${ProjectTag}.deb
fi
else
echo "Invalid OS release: ${VersionID}"
exit 1
fi
cd ${EmsBEDir}
#make deb
# clear build cache
rm -rf ${FrontBuildDir}/front/*
rm -rf ${DebFEBuildDir}/front/*
rm -rf ${DebBuildDir}/usr/local/omc/etc/db/*
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
chmod +x ${DumpToolDir}/dumpsql.sh
${DumpToolDir}/dumpsql.sh
fi
cp -rf ${ConfigSystemdDir}/* ${BuildLibSystemDir}
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
chmod 755 ${BuildOMCBinDir}/*
chmod 755 ${DebBuildDir}/DEBIAN/preinst
chmod 755 ${DebBuildDir}/DEBIAN/postinst
chmod 755 ${DebBuildDir}/DEBIAN/postrm
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/agt.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/omc.d ${DebBuildOMCDir}/static
#cp -rf ${BuildDir}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' ${DebBuildDir}/usr/local/omc/etc/default/restconf.yaml
dpkg -b ${DebBuildDir} ${ReleasePkgDir}/${DebPkgFile}
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
# rpm --addsign *.rpm
md5sum ${DebPkgName} >omc-md5sum.txt
;;
badeb)
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22-ba.deb
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18-ba.deb
else
echo "Invalid OS release: ${VersionID}"
exit 1
fi
cd ${EmsBEDir}
#make deb
# clear build cache
rm -rf ${FrontBuildDir}/front/*
rm -rf ${DebFEBuildDir}/front/*
rm -rf ${DebBuildDir}/usr/local/omc/etc/db/*
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
chmod +x ${DumpToolDir}/dumpsql.sh
${DumpToolDir}/dumpsql.sh
fi
cp -rf ${ConfigSystemdDir}/* ${BuildLibSystemDir}
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
chmod 755 ${BuildOMCBinDir}/*
chmod 755 ${DebBuildDir}/DEBIAN/preinst
chmod 755 ${DebBuildDir}/DEBIAN/postinst
chmod 755 ${DebBuildDir}/DEBIAN/postrm
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/ba.d ${DebBuildOMCDir}/static
# replace Chinese character
find "${DebBuildOMCDir}/etc/db" -type f -name '*.sql' -exec sed -i 's/[一-龥]//g' {} +
echo "Replace all chinese character."
chmod +x ${DebBuildDir}/usr/local/omc/bin
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' ${DebBuildDir}/usr/local/omc/etc/default/restconf.yaml
dpkg -b ${DebBuildDir} ${ReleasePkgDir}/${DebPkgFile}
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
md5sum ${DebPkgName} >omc-md5sum.txt
;;
*)
usage
exit 4
;;
esac

View File

@@ -0,0 +1,71 @@
server {
listen 44080;
listen 44443;
listen [::]:44080;
listen [::]:44443;
server_name localhost;
client_max_body_size 100M;
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/local/omc/etc/certs/omc-server.crt;
# ssl_certificate_key /usr/local/omc/etc/certs/omc-server.key;
# ssl_client_certificate /usr/local/omc/etc/certs/omc-ca.crt;
# ssl_verify_client on;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# OMC
location / {
root /usr/local/omc/htdocs/front;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api/rest/ {
proxy_pass http://127.0.0.1:33030/api/rest/;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@@ -0,0 +1,38 @@
-----BEGIN OPENSSH PRIVATE KEY-----
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
-----END OPENSSH PRIVATE KEY-----

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCjzE0MHy0P2sQmG1OKvArwLEzR77BwxPp+4N9NKBz8lEyNch4zoHvoLDaUJKPBMwTrScZnxhvRJNde6hz5Z0QVxZolVKV95fMfgb9YICzDfPF3Bphae5q/PBYUJNfrC9SAjQeHV4CCO6xk6LV8O/Nfw8uaXwtuN3yfpUWd5mRWKMc3GHV4vxerfKoIQZN6etLhIEYibAhCJ21P0uoWzZl7ceLmkG+6qrRSbyC0bCnrN3+wjN4bwtflrEFJk3XQGuRbVsYLzux+mMm9p22+CLPRl/FUPF3x4/wKCsqr7JDSxx80HSPhk4g/1nCTpDR9hAfF6A9ww2va/k8jMeYPBO8Owe7erLEZzvg5WQAR3Wj05eJpJD99BeC91S5KW6AFQDfDHxWWprSibd/Jj9dtct2pK2ZxW0ph9OJ49ftRhzT1iVi4UnJwnG5/qLfwl6Tnx+qnQ1If/9lY/99erCTATzFTMSImKrRz7CnuPlcw8WkzCYpWKKe0kJLkL2cRD5Qi4yk= simon@simonzhangsz

View File

@@ -0,0 +1,38 @@
-----BEGIN OPENSSH PRIVATE KEY-----
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
-----END OPENSSH PRIVATE KEY-----

View File

@@ -0,0 +1,49 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
AmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
AmfGuamiList: ""
SnssaiList: ""
MaxUser: ""
RelativeCapacity: ""
MaxGnbNum: ""
EpRpDynN8Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN11Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN12Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,48 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
SmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
MaxPduSessions: ""
MaxQfi: ""
UpfList: ""
AddrPool:
Id: ""
UserLabel: ""
AddrType: "Static"
IpVersion: ""
AddrSegList: ""
EpRpDynN7Smf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN10Smf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,39 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
UdmFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
UdrFunction:
Id: ""
UserLabel: ""
AddrType: "Static"
IpVersion: ""
AddrSegList: ""
AusfFunction:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,141 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
InventoryUnitRack:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
MaxPduSessions: ""
MaxQfi: ""
UpfList: ""
InventoryUnitShelf:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
RackPosition: ""
InventoryUnitPack:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
PortsInformation: ""
PackPosition: ""
SlotsOccupied: ""
InventoryUnitHost:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
HostPosition: ""
NumberOfCpu: ""
MemSize: ""
HardDiskSize: ""
InventoryUnitAccessory:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
AccessoryPosition: ""
AccessoryType: ""
AddtionalInformation: ""
UpfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
MaxQosFlows: ""
MaxThroughput: ""
EpRpDynN9Upf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN3Upf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
AmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
UdrFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
AusfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,182 @@
select count(*) from kpi_report_upf
CREATE VIEW kpi_report_all AS
SELECT * FROM kpi_report_udm
UNION ALL
SELECT * FROM kpi_report_amf
UNION ALL
SELECT * FROM kpi_report_upf;
select DISTINCT(ne_type) from kpi_title
SELECT DISTINCT LOWER(ne_type) FROM kpi_title
SELECT JSON_EXTRACT(kpi_values, CONCAT('$[', @path, '].', @key_to_search)) AS value FROM kpi_report_upf where `date`="2024-04-26";
SELECT JSON_EXTRACT(JSON_CONTAINS(kpi_values, '{"kpi_id": "UPF.01"}') FROM kpi_report_upf where `date`="2024-04-26";
SELECT
JSON_EXTRACT(kpi_values, CONCAT('$[', JSON_UNQUOTE(JSON_SEARCH(kpi_values, 'kpi_id', 'UPF.01')), '].value')) AS value_UPF01,
JSON_EXTRACT(kpi_values, CONCAT('$[', JSON_UNQUOTE(JSON_SEARCH(kpi_values, 'kpi_id', 'UPF.03')), '].value')) AS value_UPF03
FROM
kpi_report_upf
WHERE
JSON_SEARCH(kpi_values, 'kpi_id', 'UPF.01') IS NOT NULL
AND JSON_SEARCH(kpi_values, 'kpi_id', 'UPF.03') IS NOT NULL;
SELECT
JSON_EXTRACT(kpi_values, CONCAT('$[', JSON_UNQUOTE(JSON_SEARCH(kpi_values, 'all', 'UPF.01')), '].value')) AS value_UPF01
FROM
kpi_report_upf
WHERE
JSON_CONTAINS(kpi_values, '{"kpi_id": "UPF.01"}');
SELECT
COALESCE(JSON_EXTRACT(kpi_values, CONCAT('$[', JSON_UNQUOTE(JSON_SEARCH(kpi_values, 'all', 'UPF.01')), '].value')), 0) AS value_UPF01
FROM
kpi_report_upf
WHERE
JSON_CONTAINS(kpi_values, '{"kpi_id": "UPF.01"}');
SELECT
CONCAT(
DATE_FORMAT( gk.start_time, '%H:' ),
LPAD( FLOOR( MINUTE ( gk.start_time ) / 15 ) * 15, 2, '0' )
) AS timeGroup,
min( CASE WHEN gk.INDEX != '' THEN gk.INDEX ELSE 0 END ) AS startIndex,
min( CASE WHEN gk.ne_name != '' THEN gk.ne_name ELSE 0 END ) AS neName,
sum( CASE WHEN JSON_CONTAINS(kpi_values,JSON_OBJECT('kpi_id', "UPF.01")) THEN gk.kpi_values->'$[*].value ELSE 0 END ) AS 'UPF.01',
sum( CASE WHEN JSON_CONTAINS(kpi_values,JSON_OBJECT('kpi_id', "UPF.02")) THEN gk.kpi_values->'$[*].value ELSE 0 END ) AS 'UPF.02',
sum( CASE WHEN gk.kpi_id = 'UPF.03' THEN gk.VALUE ELSE 0 END ) AS 'UPF.03',
sum( CASE WHEN gk.kpi_id = 'UPF.04' THEN gk.VALUE ELSE 0 END ) AS 'UPF.04',
sum( CASE WHEN gk.kpi_id = 'UPF.05' THEN gk.VALUE ELSE 0 END ) AS 'UPF.05',
sum( CASE WHEN gk.kpi_id = 'UPF.06' THEN gk.VALUE ELSE 0 END ) AS 'UPF.06',
sum( CASE WHEN gk.kpi_id = 'UPF.07' THEN gk.VALUE ELSE 0 END ) AS 'UPF.07',
sum( CASE WHEN gk.kpi_id = 'UPF.08' THEN gk.VALUE ELSE 0 END ) AS 'UPF.08',
sum( CASE WHEN gk.kpi_id = 'UPF.09' THEN gk.VALUE ELSE 0 END ) AS 'UPF.09',
sum( CASE WHEN gk.kpi_id = 'UPF.10' THEN gk.VALUE ELSE 0 END ) AS 'UPF.10',
sum( CASE WHEN gk.kpi_id = 'UPF.14' THEN gk.VALUE ELSE 0 END ) AS 'UPF.14',
sum( CASE WHEN gk.kpi_id = 'UPF.11' THEN gk.VALUE ELSE 0 END ) AS 'UPF.11',
sum( CASE WHEN gk.kpi_id = 'UPF.12' THEN gk.VALUE ELSE 0 END ) AS 'UPF.12',
sum( CASE WHEN gk.kpi_id = 'UPF.13' THEN gk.VALUE ELSE 0 END ) AS 'UPF.13',
sum( CASE WHEN gk.kpi_id = 'UPF.15' THEN gk.VALUE ELSE 0 END ) AS 'UPF.15'
FROM
kpi_report_upf gk
WHERE
gk.rm_uid = '4400HX1UPF001'
AND gk.date = "2024-04-26"
AND gk.start_time >= '00:00:00'
AND gk.start_time <= '23:59:59'
GROUP BY
timeGroup
ORDER BY
timeGroup DESC
SELECT
CONCAT(
DATE_FORMAT( gk.start_time, '%H:' ),
LPAD( FLOOR( MINUTE ( gk.start_time ) / 15 ) * 15, 2, '0' )
) AS timeGroup,
min( CASE WHEN gk.INDEX != '' THEN gk.INDEX ELSE 0 END ) AS startIndex,
min( CASE WHEN gk.ne_name != '' THEN gk.ne_name ELSE 0 END ) AS neName,
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[0].kpi_id') = "UPF.01" THEN JSON_EXTRACT(gk.kpi_values, '$[0].value') ELSE 0 END) AS 'UPF.01',
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[1].kpi_id') = "UPF.02" THEN JSON_EXTRACT(gk.kpi_values, '$[1].value') ELSE 0 END) AS 'UPF.02',
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[2].kpi_id') = "UPF.03" THEN JSON_EXTRACT(gk.kpi_values, '$[2].value') ELSE 0 END) AS 'UPF.03'
FROM
kpi_report_upf gk
WHERE
gk.rm_uid = '4400HX1UPF001'
AND gk.date = "2024-05-08"
AND gk.start_time >= '10:55:00'
AND gk.start_time <= '23:59:59'
GROUP BY
timeGroup
ORDER BY
timeGroup DESC
SELECT
CONCAT(
DATE_FORMAT( gk.start_time, '%H:' ),
LPAD( FLOOR( MINUTE ( gk.start_time ) / 15 ) * 15, 2, '0' )
) AS timeGroup,
min( CASE WHEN gk.INDEX != '' THEN gk.INDEX ELSE 0 END ) AS startIndex,
min( CASE WHEN gk.ne_name != '' THEN gk.ne_name ELSE 0 END ) AS neName,
SUM(JSON_EXTRACT(gk.kpi_values, '$[0].`UPF.01`')) AS 'UPF.01',
SUM(JSON_EXTRACT(gk.kpi_values, '$[1].`UPF.02`')) AS 'UPF.02',
SUM(JSON_EXTRACT(gk.kpi_values, '$[2].`UPF.03`')) AS 'UPF.03'
FROM
kpi_report_upf gk
WHERE
gk.rm_uid = '4400HX1UPF001'
AND gk.date = "2024-05-08"
AND gk.start_time >= '10:53:00'
AND gk.start_time <= '10:59:59'
GROUP BY
timeGroup
ORDER BY
timeGroup DESC
SELECT
min( CASE WHEN gk.INDEX != '' THEN gk.INDEX ELSE 0 END ) AS startIndex,
min( CASE WHEN gk.ne_name != '' THEN gk.ne_name ELSE 0 END ) AS neName,
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[*].kpi_id') = 'UPF.01' THEN JSON_EXTRACT(gk.kpi_values, '$[*].value') ELSE 0 END) AS 'UPF.01',
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[*].kpi_id') = 'UPF.02' THEN JSON_EXTRACT(gk.kpi_values, '$[*].value') ELSE 0 END) AS 'UPF.02',
SUM(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[*].kpi_id') = 'UPF.03' THEN JSON_EXTRACT(gk.kpi_values, '$[*].value') ELSE 0 END) AS 'UPF.03'
FROM
kpi_report_upf gk
WHERE
gk.rm_uid = '4400HX1UPF001'
AND gk.date = "2024-05-03"
AND gk.start_time >= '00:00:00'
AND gk.start_time <= '23:59:59'
SELECT
CONCAT( DATE_FORMAT(CONCAT(gk.`date`, " ", gk.start_time), '%Y-%m-%d %H:'), LPAD(FLOOR(MINUTE(gk.start_time) / 15) * 15, 2, '0') ) AS timeGroup,
min(CASE WHEN gk.index != '' THEN gk.index ELSE 0 END) AS startIndex,
min(CASE WHEN gk.ne_type != '' THEN gk.ne_type ELSE 0 END) AS neType,
min(CASE WHEN gk.ne_name != '' THEN gk.ne_name ELSE 0 END) AS neName,
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[0].kpi_id') = 'UPF.01' THEN JSON_EXTRACT(gk.kpi_values, '$[0].value') ELSE 0 END) AS 'UPF.01',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[1].kpi_id') = 'UPF.02' THEN JSON_EXTRACT(gk.kpi_values, '$[1].value') ELSE 0 END) AS 'UPF.02',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[2].kpi_id') = 'UPF.03' THEN JSON_EXTRACT(gk.kpi_values, '$[2].value') ELSE 0 END) AS 'UPF.03',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[3].kpi_id') = 'UPF.04' THEN JSON_EXTRACT(gk.kpi_values, '$[3].value') ELSE 0 END) AS 'UPF.04',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[4].kpi_id') = 'UPF.05' THEN JSON_EXTRACT(gk.kpi_values, '$[4].value') ELSE 0 END) AS 'UPF.05',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[5].kpi_id') = 'UPF.06' THEN JSON_EXTRACT(gk.kpi_values, '$[5].value') ELSE 0 END) AS 'UPF.06',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[6].kpi_id') = 'UPF.07' THEN JSON_EXTRACT(gk.kpi_values, '$[6].value') ELSE 0 END) AS 'UPF.07',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[7].kpi_id') = 'UPF.08' THEN JSON_EXTRACT(gk.kpi_values, '$[7].value') ELSE 0 END) AS 'UPF.08',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[8].kpi_id') = 'UPF.09' THEN JSON_EXTRACT(gk.kpi_values, '$[8].value') ELSE 0 END) AS 'UPF.09',
sum(CASE WHEN JSON_EXTRACT(gk.kpi_values, '$[9].kpi_id') = 'UPF.10' THEN JSON_EXTRACT(gk.kpi_values, '$[9].value') ELSE 0 END) AS 'UPF.10'
FROM kpi_report_upf gk
where gk.rm_uid = '4400HX1UPF001' and gk.ne_type = 'UPF' and CONCAT(gk.`date`, " ", gk.start_time) >= '2024-05-08 10:00:00' and CONCAT(gk.`date`, " ", gk.start_time) <= '2024-05-08 23:59:59'
GROUP BY timeGroup order by timeGroup desc
DELETE t1
FROM ne_state t1
JOIN (
SELECT `timestamp`
FROM ne_state where ne_type='upf'
ORDER BY id DESC
LIMIT 999999 OFFSET 3
) t2 ON t1.`timestamp` = t2.`timestamp` and ne_type='upf';
select count(1) from ne_state where ne_type='upf'
CREATE TABLE IF NOT EXISTS kpi_report_test AS SELECT * FROM kpi_report WHERE 1=0;ALTER TABLE kpi_report_test MODIFY COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,ADD PRIMARY KEY IF NOT EXISTS (`id`);
ALTER TABLE kpi_report_ims MODIFY COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,ADD PRIMARY KEY IF NOT EXISTS (`id`)
SELECT * FROM kpi_report WHERE 1=0

View File

@@ -0,0 +1,71 @@
server {
listen 44080;
listen 44443;
listen [::]:44080;
listen [::]:44443;
server_name localhost;
client_max_body_size 100M;
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/local/omc/etc/certs/omc-server.crt;
# ssl_certificate_key /usr/local/omc/etc/certs/omc-server.key;
# ssl_client_certificate /usr/local/omc/etc/certs/omc-ca.crt;
# ssl_verify_client on;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# OMC
location / {
root /usr/local/omc/htdocs/front;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api/rest/ {
proxy_pass http://127.0.0.1:33030/api/rest/;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="DataFile">
<xs:complexType>
<xs:sequence>
<xs:element name="FileHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="TimeStamp" type="xs:dateTime"/>
<xs:element name="TimeZone" type="xs:string"/>
<xs:element name="VendorName" type="xs:string" minOccurs="0"/>
<xs:element name="ElementType" type="xs:string" minOccurs="0"/>
<xs:element name="CmVersion" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Objects" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectType" type="xs:string"/>
<!--该字段必选-->
<xs:element name="FieldName">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="N">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FieldValue">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Object">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="V">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rmUID" type="xs:string" use="required"/>
<xs:attribute name="Dn" type="xs:string"/>
<!-- //无线、核心网专业该字段必选传输、IP专业、业务系统无该字段-->
<xs:attribute name="UserLabel" type="xs:string"/>
<!-- //无线、核心网专业该字段必选传输、IP专业、业务系统无该字段-->
<xs:attribute name="PVFlag" type="xs:string" use="required"/>
<!-- //必须-->
<xs:attribute name="VMID" type="xs:string"/>
<!-- //VNF网络或VNF和PNF混合组网虚拟网元必选物理网元无该字段-->
<xs:attribute name="VNFInstanceID" type="xs:string"/>
<!-- //VNF网络或VNF和PNF混合组网虚拟网元必选物理网元无该字段-->
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,221 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSLT will convert a PDML file, saved by Wireshark, into
HTML. The HTML page should look similar to Wireshark. See
https://gitlab.com/wireshark/wireshark/-/wikis/PDML for information
on how to generate such a HTML file from PDML.
For questions contact Dirk Jagdmann (doj@cubic.org).
Version: 2010-06-09
Wireshark - Network traffic analyzer
By Gerald Combs <gerald@wireshark.org>
Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
-->
<!-- set parameters of the HTML output -->
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="no" standalone="yes" indent="yes"/>
<!-- this matches the "field" tag -->
<xsl:template match="field">
&#160;&#160;&#160; <!-- indent with 3 non-breaking spaces -->
<!-- output either the "showname" or "show" attribute -->
<xsl:choose>
<xsl:when test="string-length(@showname)>0">
<xsl:value-of select="@showname"/><br/>
</xsl:when>
<xsl:otherwise>
<!--<xsl:value-of select="@name"/>:--> <xsl:value-of select="@show"/><br/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/> <!-- we expect to match "field" tags -->
</xsl:template>
<!-- this matches the "packet" tag -->
<xsl:template match="packet">
<!-- declare some variables for later use -->
<xsl:variable name="frame_num" select="proto[@name='frame']/field[@name='frame.number']/@show"/>
<xsl:variable name="frame_id" select="concat('f',$frame_num)"/>
<xsl:variable name="frame_c" select="concat($frame_id,'c')"/>
<!-- the "title" bar of the frame -->
<div width="100%" id="{$frame_id}">
<a href="javascript:toggle_node('{$frame_c}')">&#8658;</a> <!-- #8658 is a "rArr" (double right arrow) character -->
Frame <xsl:value-of select="$frame_num"/>:
<xsl:for-each select="proto[@name!='geninfo']">
<xsl:value-of select="@name"/>,
</xsl:for-each>
<small><a href="javascript:hide_node('{$frame_id}')">[X]</a></small>
</div>
<!-- the frame contents are stored in a div, so we can toggle it -->
<div width="100%" id="{$frame_c}" style="display:none">
<!-- loop through all proto tags, but skip the "geninfo" one -->
<xsl:for-each select="proto[@name!='geninfo']">
<xsl:variable name="proto" select="concat($frame_id,@name,count(preceding-sibling::proto)+1)"/>
<!-- the "title" bar of the proto -->
<div width="100%" style="background-color:#e5e5e5; margin-bottom: 2px">
&#160;<a href="javascript:toggle_node('{$proto}')">&#8658;</a>&#160;<xsl:value-of select="@showname"/>
<!-- print "proto" details inside another div -->
<div width="100%" id="{$proto}" style="display:none">
<xsl:apply-templates/> <!-- we expect to match "field" tags -->
</div>
</div>
</xsl:for-each>
</div>
<!-- use the javascript function set_node_color() to set the color
of the frame title bar. Defer colorization until the full page has
been loaded. If the browser would support the XPath function
replace() we could simply set the class attribute of the title bar div,
but for now we're stuck with class names from Wireshark's colorfilters
that contain spaces and we can't handle them in CSS. -->
<script type="text/javascript">
dojo.addOnLoad(function(){
set_node_color(
'<xsl:value-of select="$frame_id"/>',
'<xsl:value-of select="proto[@name='frame']/field[@name='frame.coloring_rule.name']/@show"/>'
);
});
</script>
</xsl:template>
<xsl:template match="pdml">
Capture Filename: <b><xsl:value-of select="@capture_file"/></b>
PDML created: <b><xsl:value-of select="@time"/></b>
<tt>
<xsl:apply-templates/> <!-- we expect to match the "packet" nodes -->
</tt>
</xsl:template>
<!-- this block matches the start of the PDML file -->
<xsl:template match="/">
<html>
<head>
<title>poor man's Wireshark</title>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js" type="text/javascript"></script>
<script type="text/javascript">
function set_node(node, str)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
node.style.display = str;
}
function toggle_node(node)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
set_node(node, (node.style.display != 'none') ? 'none' : 'block');
}
function hide_node(node)
{
set_node(node, 'none');
}
// this function was generated by colorfilters2js.pl
function set_node_color(node,colorname)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
var fg;
var bg;
if(colorname == 'Bad TCP') {
bg='#000000';
fg='#ff5f5f';
}
if(colorname == 'HSRP State Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'Spanning Tree Topology Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'OSPF State Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'ICMP errors') {
bg='#000000';
fg='#00ff0e';
}
if(colorname == 'ARP') {
bg='#d6e8ff';
fg='#000000';
}
if(colorname == 'ICMP') {
bg='#c2c2ff';
fg='#000000';
}
if(colorname == 'TCP RST') {
bg='#900000';
fg='#fff680';
}
if(colorname == 'TTL low or unexpected') {
bg='#900000';
fg='#ffffff';
}
if(colorname == 'Checksum Errors') {
bg='#000000';
fg='#ff5f5f';
}
if(colorname == 'SMB') {
bg='#fffa99';
fg='#000000';
}
if(colorname == 'HTTP') {
bg='#8dff7f';
fg='#000000';
}
if(colorname == 'IPX') {
bg='#ffe3e5';
fg='#000000';
}
if(colorname == 'DCERPC') {
bg='#c797ff';
fg='#000000';
}
if(colorname == 'Routing') {
bg='#fff3d6';
fg='#000000';
}
if(colorname == 'TCP SYN/FIN') {
bg='#a0a0a0';
fg='#000000';
}
if(colorname == 'TCP') {
bg='#e7e6ff';
fg='#000000';
}
if(colorname == 'UDP') {
bg='#70e0ff';
fg='#000000';
}
if(colorname == 'Broadcast') {
bg='#ffffff';
fg='#808080';
}
if(fg.length > 0)
node.style.color = fg;
if(bg.length > 0)
node.style.background = bg;
}
</script>
</head>
<body>
<xsl:apply-templates/> <!-- we expect to match the "pdml" node -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="PmFile">
<xs:complexType>
<xs:sequence>
<xs:element name="FileHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="TimeStamp" type="xs:dateTime" />
<xs:element name="TimeZone" type="xs:string" />
<xs:element name="Period" type="xs:integer" />
<xs:element name="VendorName" type="xs:string" />
<xs:element name="ElementType" type="xs:string" />
<xs:element name="PmVersion" type="xs:string" />
<xs:element name="StartTime" type="xs:dateTime" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Measurements" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectType" type="xs:string" />
<xs:element name="PmName">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="N">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PmData">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Object">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="V">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="CV">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="SN" type="xs:string" />
<xs:element name="SV" type="xs:string" />
</xs:sequence>
<xs:attribute name="i" type="xs:integer"
use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="rmUID" type="xs:string" use="required" />
<xs:attribute name="Dn" type="xs:string" use="required" />
<xs:attribute name="UserLabel" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,20 @@
SET FOREIGN_KEY_CHECKS = 0;
--
REPLACE INTO `sys_config` VALUES (6, 'config.sys.officialUrl', 'sys.officialUrl', 'https://www.agrandtech.com', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.officialUrlRemark');
REPLACE INTO `sys_config` VALUES (106, 'config.sys.title', 'sys.title', 'config.sys.titleValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.titleRemark');
REPLACE INTO `sys_config` VALUES (107, 'config.sys.copyright', 'sys.copyright', 'config.sys.copyrightValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.copyrightRemark');
REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 'true', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nOpenRemark');
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 千通科技', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 AGrandTech', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
UPDATE `sys_menu` SET `status` = '1' WHERE `menu_id` = 2122;
SET FOREIGN_KEY_CHECKS = 1;

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,20 @@
SET FOREIGN_KEY_CHECKS = 0;
--
REPLACE INTO `sys_config` VALUES (6, 'config.sys.officialUrl', 'sys.officialUrl', 'https://www.bluearcus.com', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.officialUrlRemark');
REPLACE INTO `sys_config` VALUES (106, 'config.sys.title', 'sys.title', 'config.sys.titleValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.titleRemark');
REPLACE INTO `sys_config` VALUES (107, 'config.sys.copyright', 'sys.copyright', 'config.sys.copyrightValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.copyrightRemark');
REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 'false', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nOpenRemark');
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
UPDATE `sys_menu` SET `status` = '0' WHERE `menu_id` = 2122;
SET FOREIGN_KEY_CHECKS = 1;

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,20 @@
SET FOREIGN_KEY_CHECKS = 0;
--
REPLACE INTO `sys_config` VALUES (6, 'config.sys.officialUrl', 'sys.officialUrl', '#', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.officialUrlRemark');
REPLACE INTO `sys_config` VALUES (106, 'config.sys.title', 'sys.title', 'config.sys.titleValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.titleRemark');
REPLACE INTO `sys_config` VALUES (107, 'config.sys.copyright', 'sys.copyright', 'config.sys.copyrightValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.copyrightRemark');
REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 'true', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nOpenRemark');
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'OMC', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'OMC', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
UPDATE `sys_menu` SET `status` = '1' WHERE `menu_id` = 2122;
SET FOREIGN_KEY_CHECKS = 1;

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,8 @@
Package: OMC
Version: 2.2410.2-YYYYMMDD-mt
Section: AGrandTech
Prioritt: optional
Architecture: amd64
Maintainer: Simon Zhangsz
Depends:
Description: OMC

168
debbuild/22.04/DEBIAN/postinst Executable file
View File

@@ -0,0 +1,168 @@
# !/bin/bash
OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
chmod +rx ${OMCRootDir}/bin/*
chmod +rx ${OMCRootDir}/*
chmod +rx ${UsrLocalBinDir}/*
chmod -R 755 ${OMCRootDir}/htdocs/front
for CFile in ${CFileList}; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
${OMCBinDir}/upgconf.sh
fi
fi
done
# # Install redis db if not exist /usr/local/db
# if [ ! -e "${RedisRootDir}/bin/kvdb-server" ]; then
# # if [ ! -e "${RedisRootDir}" ]; then
# # mkdir -p ${RedisRootDir}
# # fi
# # stop old adb service
# if [ -e "${RedisOldRootDir}/bin/redis-server" ] && [ -e "${SystemdRootDir}/adb.service" ]; then
# systemctl stop adb.service
# systemctl disable adb.service
# fi
# # stop adb service
# if [ -e "${UsrLocalBinDir}/adb-server" ] && [ -e "${SystemdRootDir}/adb.service" ]; then
# systemctl stop adb.service
# systemctl disable adb.service
# fi
# cp -rf ${DependsRootDir}/kvdb/* /
# chmod +rx ${RedisRootDir}/bin/kvdb*
# if [ ! -e "${RedisConfDir}/kvdb.conf" ]; then
# cp ${RedisConfDir}/default/kvdb.conf ${RedisConfDir}
# fi
# sed -i 's/replica-read-only yes/replica-read-only no/g' ${RedisConfDir}/kvdb.conf
# LINE="masterauth helloearth"
# FILE="${RedisConfDir}/kvdb.conf"
# # 检查文件中是否存在该行
# if ! grep -qxF "$LINE" "$FILE"; then
# # 如果不存在,将其添加到文件末尾
# echo "$LINE" >> "$FILE"
# fi
# # copy the old adb dump.rdb
# if [ -e "${RedisOldRootDir}/bin/conf/dump.rdb" ] && [ ! -e "${RedisRootDir}/etc/kvdb/dump.rdb" ]; then
# cp -f ${RedisOldRootDir}/bin/conf/dump.rdb ${RedisRootDir}/etc/kvdb/;
# mv -f ${RedisRootDir}/db ${RedisRootDir}/adb.old
# fi
# # copy the adb dump.rdb
# if [ -e "${RedisRootDir}/etc/adb/dump.rdb" ] && [ ! -e "${RedisRootDir}/etc/kvdb/dump.rdb" ]; then
# cp -f ${RedisRootDir}/etc/adb/dump.rdb ${RedisRootDir}/etc/kvdb/;
# mv -f ${RedisRootDir}/etc/adb ${RedisRootDir}/etc/adb.old
# fi
# # cp -f ${DependsRootDir}/systemd/kvdb.service ${SystemdRootDir}
# else
# if [ ! -e "${RedisConfDir}/kvdb.conf" ]; then
# cp ${RedisConfDir}/default/kvdb.conf ${RedisConfDir}
# fi
# sed -i 's/replica-read-only yes/replica-read-only no/g' ${RedisConfDir}/kvdb.conf
# LINE="masterauth helloearth"
# FILE="${RedisConfDir}/kvdb.conf"
# # 检查文件中是否存在该行
# if ! grep -qxF "$LINE" "$FILE"; then
# # 如果不存在,将其添加到文件末尾
# echo "$LINE" >> "$FILE"
# fi
# fi
if [ ! -e "${FERootDir}/config.js" ]; then
cp ${FERootDir}/default/config.js ${FERootDir};
fi
for LogoFile in ${LogoFileList}; do
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
if ! id -u omc >/dev/null 2>&1 ; then
useradd -d /opt/omc -m -s /bin/bash -pomc123 omc;
mkdir -p /opt/omc/ftp
else
echo "user omc exist";
fi
if [ ! -e "${NginxConfDir}/omc.conf" ]; then
mkdir -p ${NginxConfDir}
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
fi
systemctl daemon-reload
# disable auto upgrade
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
# read environment parameter and to do
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
echo "M parameter: $M_PARAM"
if [ -n "$C_PARAM" ]; then
echo "C parameter: $C_PARAM"
${OMCRootDir}/bin/setomc.sh -m $M_PARAM -c $C_PARAM
else
${OMCRootDir}/bin/setomc.sh -m $M_PARAM
fi
# exit while failed to run setomc.sh
if [ $? -ne 0 ]; then
echo "setomc.sh execution failed. Exiting."
exit 1
fi
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

31
debbuild/22.04/DEBIAN/postrm Executable file
View File

@@ -0,0 +1,31 @@
# !/bin/bash
X86Lib64Dir=/lib/x86_64-linux-gnu
rm -rf ${X86Lib64Dir}/libwireshark.so.15
rm -rf ${X86Lib64Dir}/libwireshark.so
rm -rf ${X86Lib64Dir}/libwiretap.so.12
rm -rf ${X86Lib64Dir}/libwiretap.so
rm -rf ${X86Lib64Dir}/libwsutil.so.13
rm -rf ${X86Lib64Dir}/libwsutil.so
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
rm -f /usr/local/bin/omcd
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

19
debbuild/22.04/DEBIAN/preinst Executable file
View File

@@ -0,0 +1,19 @@
# !/bin/bash
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
FERootDir=/usr/local/omc/htdocs/front
# apt-get install zip
# clear front-end old hash js files
rm -rf ${FERootDir}/assets
rm -rf ${FERootDir}/js
rm -rf ${FERootDir}/index.*.js

View File

@@ -0,0 +1,71 @@
server {
listen 44080;
listen 44443;
listen [::]:44080;
listen [::]:44443;
server_name localhost;
client_max_body_size 100M;
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/local/omc/etc/certs/omc-server.crt;
# ssl_certificate_key /usr/local/omc/etc/certs/omc-server.key;
# ssl_client_certificate /usr/local/omc/etc/certs/omc-ca.crt;
# ssl_verify_client on;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# OMC
location / {
root /usr/local/omc/htdocs/front;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api/rest/ {
proxy_pass http://127.0.0.1:33030/api/rest/;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,49 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
AmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
AmfGuamiList: ""
SnssaiList: ""
MaxUser: ""
RelativeCapacity: ""
MaxGnbNum: ""
EpRpDynN8Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN11Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN12Amf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,48 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
SmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
MaxPduSessions: ""
MaxQfi: ""
UpfList: ""
AddrPool:
Id: ""
UserLabel: ""
AddrType: "Static"
IpVersion: ""
AddrSegList: ""
EpRpDynN7Smf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN10Smf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,39 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
UdmFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
UdrFunction:
Id: ""
UserLabel: ""
AddrType: "Static"
IpVersion: ""
AddrSegList: ""
AusfFunction:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,141 @@
ManagedElement:
Id: ""
UserLabel: ""
VendorName: ""
ManagedBy: ""
ManagementIpAddress: ""
SwVersion: ""
PatchInfo: ""
AdministrativeState: ""
OperationalState: ""
InventoryUnitRack:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SbiServiceList: ""
MaxPduSessions: ""
MaxQfi: ""
UpfList: ""
InventoryUnitShelf:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
RackPosition: ""
InventoryUnitPack:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
PortsInformation: ""
PackPosition: ""
SlotsOccupied: ""
InventoryUnitHost:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
HostPosition: ""
NumberOfCpu: ""
MemSize: ""
HardDiskSize: ""
InventoryUnitAccessory:
Id: ""
UserLabel: ""
VendorUnitFamilyType: ""
VendorUnitTypeNumber: ""
VendorName: ""
SerialNumber: ""
VersionNumber: ""
DateOfManufacture: ""
DateOfLastService: ""
ManufacturerData: ""
AccessoryPosition: ""
AccessoryType: ""
AddtionalInformation: ""
UpfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
MaxQosFlows: ""
MaxThroughput: ""
EpRpDynN9Upf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
EpRpDynN3Upf:
Id: ""
UserLabel: ""
LocIpAddrList: ""
FarIpSubnetworkList: ""
AmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
SmfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
UdrFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
AusfFunction:
Id: ""
UserLabel: ""
AdministrativeState: ""
OperationalState: ""
VnfInstanceId: ""
Fqdn: ""
IPResource:
Id: ""
UserLabel: ""
InterfaceType: ""
LocIpV4AddrList: ""
LocIpV6AddrList: ""

View File

@@ -0,0 +1,71 @@
server {
listen 44080;
listen 44443;
listen [::]:44080;
listen [::]:44443;
server_name localhost;
client_max_body_size 100M;
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/local/omc/etc/certs/omc-server.crt;
# ssl_certificate_key /usr/local/omc/etc/certs/omc-server.key;
# ssl_client_certificate /usr/local/omc/etc/certs/omc-ca.crt;
# ssl_verify_client on;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# OMC
location / {
root /usr/local/omc/htdocs/front;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api/rest/ {
proxy_pass http://127.0.0.1:33030/api/rest/;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="DataFile">
<xs:complexType>
<xs:sequence>
<xs:element name="FileHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="TimeStamp" type="xs:dateTime"/>
<xs:element name="TimeZone" type="xs:string"/>
<xs:element name="VendorName" type="xs:string" minOccurs="0"/>
<xs:element name="ElementType" type="xs:string" minOccurs="0"/>
<xs:element name="CmVersion" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Objects" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectType" type="xs:string"/>
<!--该字段必选-->
<xs:element name="FieldName">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="N">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FieldValue">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Object">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="V">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rmUID" type="xs:string" use="required"/>
<xs:attribute name="Dn" type="xs:string"/>
<!-- //无线、核心网专业该字段必选传输、IP专业、业务系统无该字段-->
<xs:attribute name="UserLabel" type="xs:string"/>
<!-- //无线、核心网专业该字段必选传输、IP专业、业务系统无该字段-->
<xs:attribute name="PVFlag" type="xs:string" use="required"/>
<!-- //必须-->
<xs:attribute name="VMID" type="xs:string"/>
<!-- //VNF网络或VNF和PNF混合组网虚拟网元必选物理网元无该字段-->
<xs:attribute name="VNFInstanceID" type="xs:string"/>
<!-- //VNF网络或VNF和PNF混合组网虚拟网元必选物理网元无该字段-->
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,221 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSLT will convert a PDML file, saved by Wireshark, into
HTML. The HTML page should look similar to Wireshark. See
https://gitlab.com/wireshark/wireshark/-/wikis/PDML for information
on how to generate such a HTML file from PDML.
For questions contact Dirk Jagdmann (doj@cubic.org).
Version: 2010-06-09
Wireshark - Network traffic analyzer
By Gerald Combs <gerald@wireshark.org>
Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
-->
<!-- set parameters of the HTML output -->
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="no" standalone="yes" indent="yes"/>
<!-- this matches the "field" tag -->
<xsl:template match="field">
&#160;&#160;&#160; <!-- indent with 3 non-breaking spaces -->
<!-- output either the "showname" or "show" attribute -->
<xsl:choose>
<xsl:when test="string-length(@showname)>0">
<xsl:value-of select="@showname"/><br/>
</xsl:when>
<xsl:otherwise>
<!--<xsl:value-of select="@name"/>:--> <xsl:value-of select="@show"/><br/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/> <!-- we expect to match "field" tags -->
</xsl:template>
<!-- this matches the "packet" tag -->
<xsl:template match="packet">
<!-- declare some variables for later use -->
<xsl:variable name="frame_num" select="proto[@name='frame']/field[@name='frame.number']/@show"/>
<xsl:variable name="frame_id" select="concat('f',$frame_num)"/>
<xsl:variable name="frame_c" select="concat($frame_id,'c')"/>
<!-- the "title" bar of the frame -->
<div width="100%" id="{$frame_id}">
<a href="javascript:toggle_node('{$frame_c}')">&#8658;</a> <!-- #8658 is a "rArr" (double right arrow) character -->
Frame <xsl:value-of select="$frame_num"/>:
<xsl:for-each select="proto[@name!='geninfo']">
<xsl:value-of select="@name"/>,
</xsl:for-each>
<small><a href="javascript:hide_node('{$frame_id}')">[X]</a></small>
</div>
<!-- the frame contents are stored in a div, so we can toggle it -->
<div width="100%" id="{$frame_c}" style="display:none">
<!-- loop through all proto tags, but skip the "geninfo" one -->
<xsl:for-each select="proto[@name!='geninfo']">
<xsl:variable name="proto" select="concat($frame_id,@name,count(preceding-sibling::proto)+1)"/>
<!-- the "title" bar of the proto -->
<div width="100%" style="background-color:#e5e5e5; margin-bottom: 2px">
&#160;<a href="javascript:toggle_node('{$proto}')">&#8658;</a>&#160;<xsl:value-of select="@showname"/>
<!-- print "proto" details inside another div -->
<div width="100%" id="{$proto}" style="display:none">
<xsl:apply-templates/> <!-- we expect to match "field" tags -->
</div>
</div>
</xsl:for-each>
</div>
<!-- use the javascript function set_node_color() to set the color
of the frame title bar. Defer colorization until the full page has
been loaded. If the browser would support the XPath function
replace() we could simply set the class attribute of the title bar div,
but for now we're stuck with class names from Wireshark's colorfilters
that contain spaces and we can't handle them in CSS. -->
<script type="text/javascript">
dojo.addOnLoad(function(){
set_node_color(
'<xsl:value-of select="$frame_id"/>',
'<xsl:value-of select="proto[@name='frame']/field[@name='frame.coloring_rule.name']/@show"/>'
);
});
</script>
</xsl:template>
<xsl:template match="pdml">
Capture Filename: <b><xsl:value-of select="@capture_file"/></b>
PDML created: <b><xsl:value-of select="@time"/></b>
<tt>
<xsl:apply-templates/> <!-- we expect to match the "packet" nodes -->
</tt>
</xsl:template>
<!-- this block matches the start of the PDML file -->
<xsl:template match="/">
<html>
<head>
<title>poor man's Wireshark</title>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js" type="text/javascript"></script>
<script type="text/javascript">
function set_node(node, str)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
node.style.display = str;
}
function toggle_node(node)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
set_node(node, (node.style.display != 'none') ? 'none' : 'block');
}
function hide_node(node)
{
set_node(node, 'none');
}
// this function was generated by colorfilters2js.pl
function set_node_color(node,colorname)
{
if(dojo.isString(node))
node = dojo.byId(node);
if(!node) return;
var fg;
var bg;
if(colorname == 'Bad TCP') {
bg='#000000';
fg='#ff5f5f';
}
if(colorname == 'HSRP State Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'Spanning Tree Topology Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'OSPF State Change') {
bg='#000000';
fg='#fff600';
}
if(colorname == 'ICMP errors') {
bg='#000000';
fg='#00ff0e';
}
if(colorname == 'ARP') {
bg='#d6e8ff';
fg='#000000';
}
if(colorname == 'ICMP') {
bg='#c2c2ff';
fg='#000000';
}
if(colorname == 'TCP RST') {
bg='#900000';
fg='#fff680';
}
if(colorname == 'TTL low or unexpected') {
bg='#900000';
fg='#ffffff';
}
if(colorname == 'Checksum Errors') {
bg='#000000';
fg='#ff5f5f';
}
if(colorname == 'SMB') {
bg='#fffa99';
fg='#000000';
}
if(colorname == 'HTTP') {
bg='#8dff7f';
fg='#000000';
}
if(colorname == 'IPX') {
bg='#ffe3e5';
fg='#000000';
}
if(colorname == 'DCERPC') {
bg='#c797ff';
fg='#000000';
}
if(colorname == 'Routing') {
bg='#fff3d6';
fg='#000000';
}
if(colorname == 'TCP SYN/FIN') {
bg='#a0a0a0';
fg='#000000';
}
if(colorname == 'TCP') {
bg='#e7e6ff';
fg='#000000';
}
if(colorname == 'UDP') {
bg='#70e0ff';
fg='#000000';
}
if(colorname == 'Broadcast') {
bg='#ffffff';
fg='#808080';
}
if(fg.length > 0)
node.style.color = fg;
if(bg.length > 0)
node.style.background = bg;
}
</script>
</head>
<body>
<xsl:apply-templates/> <!-- we expect to match the "pdml" node -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="PmFile">
<xs:complexType>
<xs:sequence>
<xs:element name="FileHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="TimeStamp" type="xs:dateTime" />
<xs:element name="TimeZone" type="xs:string" />
<xs:element name="Period" type="xs:integer" />
<xs:element name="VendorName" type="xs:string" />
<xs:element name="ElementType" type="xs:string" />
<xs:element name="PmVersion" type="xs:string" />
<xs:element name="StartTime" type="xs:dateTime" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Measurements" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectType" type="xs:string" />
<xs:element name="PmName">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="N">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PmData">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Object">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="V">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="i" type="xs:integer" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="CV">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="SN" type="xs:string" />
<xs:element name="SV" type="xs:string" />
</xs:sequence>
<xs:attribute name="i" type="xs:integer"
use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="rmUID" type="xs:string" use="required" />
<xs:attribute name="Dn" type="xs:string" use="required" />
<xs:attribute name="UserLabel" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

8
debbuild/DEBIAN/control Normal file
View File

@@ -0,0 +1,8 @@
Package: OMC
Version: 2.2410.2-YYYYMMDD-mt
Section: AGrandTech
Prioritt: optional
Architecture: amd64
Maintainer: Simon Zhangsz
Depends:
Description: OMC

112
debbuild/DEBIAN/postinst Normal file
View File

@@ -0,0 +1,112 @@
# !/bin/bash
OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
chmod +rx ${OMCRootDir}/bin/*
chmod +rx ${OMCRootDir}/*
chmod +rx ${UsrLocalBinDir}/*
chmod -R 755 ${OMCRootDir}/htdocs/front
for CFile in ${CFileList}; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
${OMCBinDir}/upgconf.sh
fi
fi
done
if [ ! -e "${FERootDir}/config.js" ]; then
cp ${FERootDir}/default/config.js ${FERootDir};
fi
for LogoFile in ${LogoFileList}; do
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
if ! id -u omc >/dev/null 2>&1 ; then
useradd -d /opt/omc -m -s /bin/bash -pomc123 omc;
mkdir -p /opt/omc/ftp
else
echo "user omc exist";
fi
if [ ! -e "${NginxConfDir}/omc.conf" ]; then
mkdir -p ${NginxConfDir}
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
fi
systemctl daemon-reload
# disable auto upgrade
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
# read environment parameter and to do
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
echo "M parameter: $M_PARAM"
if [ -n "$C_PARAM" ]; then
echo "C parameter: $C_PARAM"
${OMCRootDir}/bin/setomc.sh -m $M_PARAM -c $C_PARAM
else
${OMCRootDir}/bin/setomc.sh -m $M_PARAM
fi
# exit while failed to run setomc.sh
if [ $? -ne 0 ]; then
echo "setomc.sh execution failed. Exiting."
exit 1
fi
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

31
debbuild/DEBIAN/postrm Normal file
View File

@@ -0,0 +1,31 @@
# !/bin/bash
X86Lib64Dir=/lib/x86_64-linux-gnu
rm -rf ${X86Lib64Dir}/libwireshark.so.15
rm -rf ${X86Lib64Dir}/libwireshark.so
rm -rf ${X86Lib64Dir}/libwiretap.so.12
rm -rf ${X86Lib64Dir}/libwiretap.so
rm -rf ${X86Lib64Dir}/libwsutil.so.13
rm -rf ${X86Lib64Dir}/libwsutil.so
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
rm -f /usr/local/bin/omcd
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

19
debbuild/DEBIAN/preinst Normal file
View File

@@ -0,0 +1,19 @@
# !/bin/bash
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
FERootDir=/usr/local/omc/htdocs/front
# apt-get install zip
# clear front-end old hash js files
rm -rf ${FERootDir}/assets
rm -rf ${FERootDir}/js
rm -rf ${FERootDir}/index.*.js

View File

@@ -0,0 +1,71 @@
server {
listen 44080;
listen 44443;
listen [::]:44080;
listen [::]:44443;
server_name localhost;
client_max_body_size 100M;
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/local/omc/etc/certs/omc-server.crt;
# ssl_certificate_key /usr/local/omc/etc/certs/omc-server.key;
# ssl_client_certificate /usr/local/omc/etc/certs/omc-ca.crt;
# ssl_verify_client on;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# OMC
location / {
root /usr/local/omc/htdocs/front;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api/rest/ {
proxy_pass http://127.0.0.1:33030/api/rest/;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More