Compare commits
128 Commits
2454fbf1d6
...
main-v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
458d8c9755 | ||
|
|
5a59f6547b | ||
|
|
b05211489e | ||
|
|
a546f1783d | ||
|
|
620dfe629f | ||
|
|
e07774bc57 | ||
|
|
707a0c0e0b | ||
|
|
2f6ad6cac0 | ||
|
|
9036324202 | ||
|
|
299b87d95b | ||
|
|
75c22c4d8e | ||
|
|
4aa0c545a1 | ||
|
|
f6203348bd | ||
|
|
1aa84000fe | ||
|
|
f925645b88 | ||
|
|
6ab25532e5 | ||
|
|
4c2bab63f2 | ||
|
|
b7a3aca364 | ||
|
|
1f11bf2bbc | ||
|
|
5518d0a8bf | ||
|
|
e986487579 | ||
|
|
551dfb3587 | ||
|
|
d103c3632c | ||
|
|
6e769c468d | ||
|
|
e279b75c49 | ||
|
|
2f5031cbd4 | ||
|
|
46bc90c2e4 | ||
|
|
ac23c3a9f1 | ||
|
|
ccad67ca7a | ||
|
|
0fe95af9c3 | ||
|
|
952e55140b | ||
|
|
b165562c2a | ||
|
|
ffe9c4c498 | ||
|
|
16189c51fa | ||
|
|
0f7ff2aca7 | ||
|
|
04eb36e899 | ||
|
|
7891d268cb | ||
|
|
bbbd5471c7 | ||
|
|
83c7603f91 | ||
|
|
1c96e28f38 | ||
|
|
8c94cf6bc0 | ||
|
|
1da05f7721 | ||
|
|
94481d36cd | ||
|
|
86c3a87b35 | ||
|
|
096989ad15 | ||
|
|
9ee596f01d | ||
|
|
38f6652301 | ||
|
|
fb021f4605 | ||
|
|
04a5f9052e | ||
|
|
7cac1e1249 | ||
|
|
23a51956ca | ||
|
|
471811c1ca | ||
|
|
80fb41ea51 | ||
|
|
4a0a341c4e | ||
|
|
ab2026523a | ||
|
|
29d1c41973 | ||
|
|
92e1d20e9f | ||
|
|
1f96e09a18 | ||
|
|
e5c496d0bb | ||
|
|
6fdc7738db | ||
|
|
79b1eb8364 | ||
|
|
874707cd00 | ||
|
|
e363529519 | ||
|
|
5160e85804 | ||
|
|
0aeb0673ee | ||
|
|
0f1aae7c9a | ||
|
|
f35c535a77 | ||
|
|
3655fb999a | ||
|
|
6c0e636f3c | ||
|
|
96f56939e3 | ||
|
|
691bb89829 | ||
|
|
3a9b4375f4 | ||
|
|
b2f867b86c | ||
|
|
f2e43b0fc4 | ||
|
|
6e4f2c7773 | ||
|
|
53e5717400 | ||
|
|
ca6b277c88 | ||
|
|
edc4ce7d48 | ||
|
|
ab59bd6869 | ||
|
|
8c115a418f | ||
|
|
c0c420dd4b | ||
|
|
6745c5e196 | ||
|
|
2bfc7887e3 | ||
|
|
645f223a2a | ||
|
|
66d3eaf79c | ||
|
|
9a41cbd736 | ||
|
|
f4c79abf83 | ||
|
|
542c9721ef | ||
|
|
e42d35c5e0 | ||
|
|
667f6b1987 | ||
|
|
6adf76b589 | ||
|
|
49f0ba4a7a | ||
|
|
27826e4523 | ||
|
|
1316629dc8 | ||
|
|
82a0d32f15 | ||
|
|
83ce21d2c3 | ||
|
|
1efc851b39 | ||
|
|
d9c16a616c | ||
|
|
a2800bed0d | ||
|
|
cf97351fc9 | ||
|
|
251284aa38 | ||
|
|
1fe4eddd33 | ||
|
|
6211a88f2e | ||
|
|
b73cd05af8 | ||
|
|
16d20fcad4 | ||
|
|
9f1a097e2a | ||
|
|
cfa0825e22 | ||
|
|
5bc958e911 | ||
|
|
e636f76506 | ||
|
|
1ca15477ca | ||
|
|
7ce96a7178 | ||
|
|
639107ba3d | ||
| dd0d67c0ea | |||
| 343e32735d | |||
| 37477ad9f1 | |||
| 1fb64561c4 | |||
| abb2a8a33d | |||
|
|
1dc143c062 | ||
| ff7973194f | |||
| c9277f1123 | |||
| b8c1740875 | |||
| 121cbea72e | |||
| 3e08ef0cc4 | |||
| 38dabd180d | |||
| cd6578f57c | |||
|
|
f403456185 | ||
| dbded5635f | |||
| 44fad7ae82 |
16
.gitignore
vendored
@@ -8,18 +8,14 @@
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Run temp file and dir
|
||||
docs/temp/
|
||||
.idea/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
*.log
|
||||
*.log
|
||||
*.bak
|
||||
*.exe
|
||||
|
||||
# build and release package
|
||||
build/
|
||||
# !build/usr/local/omc/etc/db
|
||||
debbuild/
|
||||
!debbuild/22.04/DEBIAN/
|
||||
!debbuild/DEBIAN/
|
||||
release/
|
||||
# Build Output
|
||||
tmp/*
|
||||
|
||||
35
README.md
@@ -4,23 +4,34 @@
|
||||
|
||||
OS: Ubuntu 18.04 / 22.04 (Recommendation)
|
||||
|
||||
Arch: amd64
|
||||
|
||||
Golang: go1.22.1 linux/amd64
|
||||
Golang: go1.24.2 (or above)
|
||||
|
||||
Database: 10.6.16-MariaDB, Redis server v=5.0.5 (or above)
|
||||
|
||||
node.js: v18.16.0 (or above)
|
||||
node.js: v20.18.0 (or above)
|
||||
|
||||
## Build Guide
|
||||
|
||||
### Pull Code
|
||||
|
||||
`pwd` default in `/root`
|
||||
|
||||
```bash
|
||||
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
|
||||
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
|
||||
```
|
||||
|
||||
BIN
bin/binWriter
164
build-docker.sh
Normal file
@@ -0,0 +1,164 @@
|
||||
#!/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
|
||||
510
build.sh
@@ -1,336 +1,188 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Default Version
|
||||
VERSION="1.0.0"
|
||||
# usage
|
||||
usage() {
|
||||
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
|
||||
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
|
||||
}
|
||||
# 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"
|
||||
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"
|
||||
|
||||
|
||||
# =================== 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
|
||||
}
|
||||
|
||||
pkgtype=""
|
||||
new_args=()
|
||||
# Traverse all parameters
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" ]]; then
|
||||
pkgtype=$arg
|
||||
else
|
||||
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$pkgtype" ]; then
|
||||
usage
|
||||
exit 1
|
||||
# =================== 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
|
||||
fi
|
||||
|
||||
# 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}-mt
|
||||
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
|
||||
# bash build.sh -v 2.2505.2
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
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
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
@@ -1 +0,0 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCjzE0MHy0P2sQmG1OKvArwLEzR77BwxPp+4N9NKBz8lEyNch4zoHvoLDaUJKPBMwTrScZnxhvRJNde6hz5Z0QVxZolVKV95fMfgb9YICzDfPF3Bphae5q/PBYUJNfrC9SAjQeHV4CCO6xk6LV8O/Nfw8uaXwtuN3yfpUWd5mRWKMc3GHV4vxerfKoIQZN6etLhIEYibAhCJ21P0uoWzZl7ceLmkG+6qrRSbyC0bCnrN3+wjN4bwtflrEFJk3XQGuRbVsYLzux+mMm9p22+CLPRl/FUPF3x4/wKCsqr7JDSxx80HSPhk4g/1nCTpDR9hAfF6A9ww2va/k8jMeYPBO8Owe7erLEZzvg5WQAR3Wj05eJpJD99BeC91S5KW6AFQDfDHxWWprSibd/Jj9dtct2pK2ZxW0ph9OJ49ftRhzT1iVi4UnJwnG5/qLfwl6Tnx+qnQ1If/9lY/99erCTATzFTMSImKrRz7CnuPlcw8WkzCYpWKKe0kJLkL2cRD5Qi4yk= simon@simonzhangsz
|
||||
@@ -1,38 +0,0 @@
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
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
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
@@ -1,49 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,48 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,39 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,141 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,182 +0,0 @@
|
||||
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
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
<?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>
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
<?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">
|
||||
    <!-- 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}')">⇒</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">
|
||||
 <a href="javascript:toggle_node('{$proto}')">⇒</a> <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>
|
||||
@@ -1,80 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,20 +0,0 @@
|
||||
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;
|
||||
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 48 KiB |
@@ -1,20 +0,0 @@
|
||||
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;
|
||||
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -1,20 +0,0 @@
|
||||
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;
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,8 +0,0 @@
|
||||
Package: OMC
|
||||
Version: 2.2410.2-YYYYMMDD-mt
|
||||
Section: AGrandTech
|
||||
Prioritt: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Simon Zhangsz
|
||||
Depends:
|
||||
Description: OMC
|
||||
@@ -1,168 +0,0 @@
|
||||
# !/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"
|
||||
@@ -1,31 +0,0 @@
|
||||
# !/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
|
||||
@@ -1,19 +0,0 @@
|
||||
# !/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
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,48 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,39 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,141 +0,0 @@
|
||||
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: ""
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
<?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>
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
<?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">
|
||||
    <!-- 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}')">⇒</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">
|
||||
 <a href="javascript:toggle_node('{$proto}')">⇒</a> <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>
|
||||
@@ -1,80 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,8 +0,0 @@
|
||||
Package: OMC
|
||||
Version: 2.2410.2-YYYYMMDD-mt
|
||||
Section: AGrandTech
|
||||
Prioritt: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Simon Zhangsz
|
||||
Depends:
|
||||
Description: OMC
|
||||
@@ -1,112 +0,0 @@
|
||||
# !/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"
|
||||
@@ -1,31 +0,0 @@
|
||||
# !/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
|
||||
@@ -1,19 +0,0 @@
|
||||
# !/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
|
||||
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,403 +0,0 @@
|
||||
# 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
|
||||
|
||||
软件安装
|
||||
|
||||
银河麒麟OS(CentOS)
|
||||
|
||||
```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服务(可选)
|
||||
|
||||
注意:非第一次安装或者全新安装请跳过此步骤
|
||||
|
||||
OMC Web服务可通过nginx代理进行访问,也可不需要代理进行访问
|
||||
|
||||
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软件包
|
||||
|
||||
```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
|
||||
│ ├── nehosts
|
||||
│ ├── omcsvc.sh
|
||||
│ ├── restagent
|
||||
│ └── tables.txt
|
||||
├── database
|
||||
├── etc
|
||||
│ ├── cm
|
||||
│ ├── crontask.yaml
|
||||
│ ├── db
|
||||
│ ├── default
|
||||
│ ├── 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=6379/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.yaml,trace级别的日志通常在调试系统时使用,正常运行级别为debug,如下配置项所示:
|
||||
|
||||
```yaml
|
||||
logger:
|
||||
file: /usr/local/omc/log/restagent.log
|
||||
level: debug
|
||||
duration: 24
|
||||
count: 90
|
||||
```
|
||||
|
||||
OMC crontask程序的配置文件在crontask.yaml,trace级别的日志通常在调试系统时使用,正常运行级别为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) (nginx代理模式)
|
||||
|
||||
或:http://192.168.0.229:8080 (非nginx代理模式)
|
||||
@@ -1,11 +0,0 @@
|
||||
# MySQL install guide
|
||||
|
||||
---
|
||||
|
||||
## 环境准备
|
||||
|
||||
硬件平台:辉腾arm服务器
|
||||
|
||||
操作系统:麒麟
|
||||
|
||||
MySQL:8.0.32
|
||||