Compare commits
93 Commits
05940359d8
...
nbi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b5e958113 | ||
|
|
0c3a264b24 | ||
|
|
c4e620d2a7 | ||
|
|
d38cf41630 | ||
|
|
e8059871d5 | ||
|
|
a666f177cc | ||
|
|
847d9ab781 | ||
|
|
16ef83f04b | ||
|
|
e4c0806468 | ||
|
|
e5b8df0753 | ||
|
|
1386f2aa41 | ||
|
|
d0d4efed93 | ||
|
|
1cda2618f3 | ||
|
|
9046f4daa7 | ||
|
|
c3eb9874a8 | ||
|
|
22d3f6f9fa | ||
|
|
efa3b6e627 | ||
|
|
c565a3ee8f | ||
|
|
1e1b8394a5 | ||
|
|
91ac4aa3ff | ||
|
|
3451f36ece | ||
|
|
c12c9d2f31 | ||
|
|
f1685db6ed | ||
|
|
17591b1705 | ||
|
|
5d9425c457 | ||
|
|
d8624c2fe9 | ||
|
|
cb8692cf44 | ||
|
|
cc45dd1be3 | ||
|
|
56d62831eb | ||
|
|
246fb027cd | ||
|
|
7818759109 | ||
|
|
48d5a0a783 | ||
|
|
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 | |||
| ec00a5fdec | |||
| f57e479e54 | |||
| ceb385bbc6 | |||
| fb6526e0a0 | |||
| 6ed5e0c425 | |||
| 109c8ad68a | |||
| 6a48f1182f | |||
| 8b4492153c | |||
| c659fa38d2 | |||
| 21ce1d667e | |||
| 136f00ab62 | |||
| b8e0dc30ac | |||
| c01c84e2e4 | |||
| 25bf25c459 | |||
|
|
6205a6c178 | ||
| 00aad81aab | |||
| b2333b119d | |||
|
|
3074d4a16a | ||
|
|
12fb46302a | ||
|
|
c17ba60b56 | ||
|
|
b83e486c36 |
14
.gitignore
vendored
@@ -12,9 +12,21 @@
|
|||||||
# Run temp file and dir
|
# Run temp file and dir
|
||||||
docs/temp/
|
docs/temp/
|
||||||
|
|
||||||
|
|
||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
*.bak
|
*.bak
|
||||||
|
# build files
|
||||||
|
build
|
||||||
|
debbuild/etc
|
||||||
|
debbuild/usr
|
||||||
|
debbuild/lib
|
||||||
|
debbuild/22.04/etc
|
||||||
|
debbuild/22.04/usr
|
||||||
|
debbuild/22.04/lib
|
||||||
|
release
|
||||||
|
rpmbuild/RPMS
|
||||||
|
rpmbuild/SOURCES
|
||||||
|
rpmbuild/BUILD
|
||||||
|
rpmbuild/BUILDROOT
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ node.js: v18.16.0 (or above)
|
|||||||
## Build Guide
|
## Build Guide
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://xxx@bitbucket.org/bluearcuscom/ems.git local.git
|
git clone https://xxx@bitbucket.org/bluearcuscom/ems.git omc.git
|
||||||
cd local.git
|
cd omc.git
|
||||||
git pull
|
git pull
|
||||||
cd fe.ems.vue3
|
cd fe.ems.vue3
|
||||||
npm install
|
npm install
|
||||||
|
|||||||
230
build.sh → bin/build.sh
Normal file → Executable file
@@ -1,12 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [OPTION] deb|rpm"
|
echo "Usage: $0 [OPTION] deb|badeb|rpm"
|
||||||
echo
|
echo
|
||||||
echo "Build omc package, option as follow:"
|
echo "Build omc package, option as follow:"
|
||||||
echo " deb|rpm, deb: ubuntu|debian package build by dpkg"
|
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 " rpm: centos/redhat package, build by rpmbuild"
|
||||||
echo " -r, =build root directory build root directory, default directory is $HOME/local.git"
|
echo " -r, =build root directory build root directory, default directory is $HOME/omc.git"
|
||||||
echo " -d dump SQL from database"
|
echo " -d dump SQL from database"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
@@ -15,7 +16,7 @@ pkgtype=""
|
|||||||
new_args=()
|
new_args=()
|
||||||
# Traverse all parameters
|
# Traverse all parameters
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then
|
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" ]]; then
|
||||||
pkgtype=$arg
|
pkgtype=$arg
|
||||||
else
|
else
|
||||||
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
|
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
|
||||||
@@ -30,7 +31,7 @@ fi
|
|||||||
# Use a new parameter list
|
# Use a new parameter list
|
||||||
set -- "${new_args[@]}"
|
set -- "${new_args[@]}"
|
||||||
|
|
||||||
GitLocalRoot=${HOME}/local.git
|
GitLocalRoot=${HOME}/omc.git
|
||||||
while getopts "r:d" option; do
|
while getopts "r:d" option; do
|
||||||
case $option in
|
case $option in
|
||||||
r)
|
r)
|
||||||
@@ -55,7 +56,7 @@ fi
|
|||||||
ProjectL=omc
|
ProjectL=omc
|
||||||
ProjectU=OMC
|
ProjectU=OMC
|
||||||
PROJECT=${ProjectL}
|
PROJECT=${ProjectL}
|
||||||
VERSION=2.2409.4
|
VERSION=2.2508.2
|
||||||
RelDate=`date +%Y%m%d`
|
RelDate=`date +%Y%m%d`
|
||||||
RelVer=${VERSION}-${RelDate}
|
RelVer=${VERSION}-${RelDate}
|
||||||
Ky10Arch=ky10.aarch64
|
Ky10Arch=ky10.aarch64
|
||||||
@@ -65,22 +66,27 @@ DebPkgName=${ProjectL}-r${RelVer}-ub*.deb
|
|||||||
EmsBEDir=${GitLocalRoot}/be.ems
|
EmsBEDir=${GitLocalRoot}/be.ems
|
||||||
EmsBuildRoot=${GitLocalRoot}/build.ems
|
EmsBuildRoot=${GitLocalRoot}/build.ems
|
||||||
RpmArch=`arch`
|
RpmArch=`arch`
|
||||||
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS/
|
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS
|
||||||
ReleaseDir=${EmsBuildRoot}/release
|
ReleaseDir=${EmsBuildRoot}/release
|
||||||
DumpToolDir=${EmsBEDir}/tools/misc
|
DumpToolDir=${EmsBEDir}/tools/misc
|
||||||
|
ProjectTag="nbi"
|
||||||
|
|
||||||
BuildDir=${EmsBuildRoot}/build
|
BuildDir=${EmsBuildRoot}/build
|
||||||
|
CustomizedDir=${EmsBuildRoot}/customized
|
||||||
BuildOMCDir=${BuildDir}/usr/local/omc
|
BuildOMCDir=${BuildDir}/usr/local/omc
|
||||||
BuildOMCBinDir=${BuildOMCDir}/bin
|
BuildOMCBinDir=${BuildOMCDir}/bin
|
||||||
BuildOMCEtcDir=${BuildOMCDir}/etc
|
BuildOMCEtcDir=${BuildOMCDir}/etc
|
||||||
BuildLibDir=${BuildDir}/lib
|
BuildLibDir=${BuildDir}/lib
|
||||||
BuildLibSystemDir=${BuildLibDir}/systemd/system
|
BuildLibSystemDir=${BuildLibDir}/systemd/system
|
||||||
DebBuildDir=${EmsBuildRoot}/debbuild
|
DebBuildDir=${EmsBuildRoot}/debbuild
|
||||||
DebFEBuildDir=${EmsBuildRoot}/debbuild/usr/local/omc/htdocs
|
DebBuildOMCDir=${EmsBuildRoot}/debbuild/usr/local/omc
|
||||||
|
DebFEBuildDir=${DebBuildOMCDir}/htdocs
|
||||||
DebBuild2204Dir=${EmsBuildRoot}/debbuild/22.04
|
DebBuild2204Dir=${EmsBuildRoot}/debbuild/22.04
|
||||||
DebFEBuild2204Dir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc/htdocs
|
DebBuild2204OMCDir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc
|
||||||
|
DebFEBuild2204Dir=${DebBuild2204OMCDir}/htdocs
|
||||||
RpmBuildDir=${EmsBuildRoot}/rpmbuild
|
RpmBuildDir=${EmsBuildRoot}/rpmbuild
|
||||||
RpmFEBuildDir=${RpmBuildDir}/BUILD/usr/local/omc/htdocs
|
RpmBuildOMCDir=${RpmBuildDir}/BUILD/usr/local/omc
|
||||||
|
RpmFEBuildDir=${RpmBuildOMCDir}/htdocs
|
||||||
OmcInstallDir=/usr/local/omc
|
OmcInstallDir=/usr/local/omc
|
||||||
ConfigEtcDir=${EmsBEDir}/config/etc
|
ConfigEtcDir=${EmsBEDir}/config/etc
|
||||||
ConfigSystemdDir=${EmsBEDir}/config/systemd
|
ConfigSystemdDir=${EmsBEDir}/config/systemd
|
||||||
@@ -88,36 +94,93 @@ EmsFEDir=${GitLocalRoot}/fe.ems
|
|||||||
EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist
|
EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist
|
||||||
LibDir=${EmsBEDir}/lib
|
LibDir=${EmsBEDir}/lib
|
||||||
RESTAGENT=restagent
|
RESTAGENT=restagent
|
||||||
CRONTASK=crontask
|
|
||||||
SshSvcBin=sshsvc
|
SshSvcBin=sshsvc
|
||||||
CapTraceBin=captrace
|
|
||||||
Data2htmlBin=data2html
|
|
||||||
NBI_ALARM=nbi_alarm
|
|
||||||
NBI_AGENT=nbi_agent
|
|
||||||
AAAA_AGENT=4a_agent
|
|
||||||
RestagentDir=${EmsBEDir}/${RESTAGENT}
|
RestagentDir=${EmsBEDir}/${RESTAGENT}
|
||||||
CrontaskDir=${EmsBEDir}/${CRONTASK}
|
|
||||||
SshSvcDir=${EmsBEDir}/${SshSvcBin}
|
SshSvcDir=${EmsBEDir}/${SshSvcBin}
|
||||||
CapTraceDir=${EmsBEDir}/${CapTraceBin}
|
|
||||||
Data2htmlDir=${EmsBEDir}/${Data2htmlBin}
|
|
||||||
DBSQLSrcDir=${EmsBEDir}/database
|
DBSQLSrcDir=${EmsBEDir}/database
|
||||||
MiscDir=${EmsBEDir}/misc
|
MiscDir=${EmsBEDir}/misc
|
||||||
FrontBuildDir=${BuildOMCDir}/htdocs
|
FrontBuildDir=${BuildOMCDir}/htdocs
|
||||||
FrontSrcDir=${EmsBEDir}/front
|
FrontSrcDir=${EmsBEDir}/front
|
||||||
CrontaskSize=27788951
|
|
||||||
RestagentSize=29525312
|
|
||||||
BinWriterDir=${HOME}/bin
|
BinWriterDir=${HOME}/bin
|
||||||
|
|
||||||
if [[ ${RpmArch} =~ "x86_64" ]];then
|
# Get the output of uname -a
|
||||||
|
UnameOutput=$(uname -a)
|
||||||
|
|
||||||
|
# Extract hardware architecture
|
||||||
|
if [[ $UnameOutput =~ "x86_64" ]]; then
|
||||||
RelArch=amd64
|
RelArch=amd64
|
||||||
elif [[ ${RpmArch} =~ "aarch64" ]];then
|
RpmArch=x86_64
|
||||||
|
elif [[ $UnameOutput =~ "aarch64" ]]; then
|
||||||
RelArch=arm64
|
RelArch=arm64
|
||||||
|
RpmArch=aarch64
|
||||||
|
else
|
||||||
|
echo "Unsupported hardware architecture"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
ReleasePkgDir=${ReleaseDir}/"${pkgtype}"s/${RelArch}
|
|
||||||
|
get_os_info() {
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
. /etc/os-release
|
||||||
|
echo $ID
|
||||||
|
else
|
||||||
|
echo "unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_os_version() {
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
. /etc/os-release
|
||||||
|
echo $VERSION_ID
|
||||||
|
else
|
||||||
|
echo "unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
OSVersion=$(get_os_version)
|
||||||
|
case $(get_os_info) in
|
||||||
|
ubuntu|debian)
|
||||||
|
ptype=deb
|
||||||
|
if [[ "$OSVersion" == "22.04" ]]; then
|
||||||
|
RelOS=ub22
|
||||||
|
DebBuildDir=${DebBuild2204Dir}
|
||||||
|
DebBuildOMCDir=${DebBuild2204OMCDir}
|
||||||
|
DebFEBuildDir=${DebFEBuild2204Dir}
|
||||||
|
elif [[ "$OSVersion" == "18.04" ]]; then
|
||||||
|
RelOS=ub18
|
||||||
|
else
|
||||||
|
echo "Unsupported Ubuntu version: $OSVersion"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
centos|rhel)
|
||||||
|
ptype=rpm
|
||||||
|
RelOS=ct8
|
||||||
|
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
||||||
|
;;
|
||||||
|
openEuler)
|
||||||
|
ptype=rpm
|
||||||
|
majorVersion=${OSVersion:0:2}
|
||||||
|
RelOS=oe${majorVersion}
|
||||||
|
RpmPkgName=${ProjectL}-${RelVer}.${RpmArch}.${ptype}
|
||||||
|
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
||||||
|
;;
|
||||||
|
kylin|anolis)
|
||||||
|
ptype=rpm
|
||||||
|
RelOS=ky
|
||||||
|
RpmPkgName=${ProjectL}-${RelVer}.${RpmArch}.${ptype}
|
||||||
|
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported OS"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
case "${pkgtype}" in
|
case "${pkgtype}" in
|
||||||
rpm)
|
rpm)
|
||||||
ProcList="restagent crontask sshsvc captrace data2html"
|
echo "Begin to make ${pkgtype} package ======>"
|
||||||
|
ReleasePkgDir=${ReleaseDir}/rpms/${RelArch}
|
||||||
|
ProcList="restagent sshsvc"
|
||||||
cd $EmsBEDir
|
cd $EmsBEDir
|
||||||
for procName in $ProcList;do
|
for procName in $ProcList;do
|
||||||
cd $EmsBEDir/$procName
|
cd $EmsBEDir/$procName
|
||||||
@@ -133,24 +196,15 @@ case "${pkgtype}" in
|
|||||||
rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/*
|
rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/*
|
||||||
|
|
||||||
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
|
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
|
||||||
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
|
|
||||||
cp -rf ${SshSvcDir}/${SshSvcBin} ${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}
|
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
|
||||||
# rm -rf ${BinDir2}/ne-hosts
|
# rm -rf ${BinDir2}/ne-hosts
|
||||||
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
|
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
|
||||||
rm -rf ${BuildOMCEtcDir}/db/*
|
rm -rf ${BuildOMCEtcDir}/db/*
|
||||||
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
|
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
|
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
|
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
|
|
||||||
#Get SQL from database, overwrite from git
|
#Get SQL from database, overwrite from git
|
||||||
if [ "$dumpdb" = "yes" ]; then
|
if [ "$dumpdb" = "yes" ]; then
|
||||||
cd ${DumpToolDir}
|
cd ${DumpToolDir}
|
||||||
@@ -162,21 +216,27 @@ case "${pkgtype}" in
|
|||||||
mkdir -p ${FrontBuildDir}/front
|
mkdir -p ${FrontBuildDir}/front
|
||||||
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
|
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
|
||||||
chmod 755 ${BuildOMCBinDir}/*
|
chmod 755 ${BuildOMCBinDir}/*
|
||||||
# chmod 755 ${BinDir2}/*
|
|
||||||
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
|
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
|
||||||
#cp -rf ${BuildDir}/nginx ${RpmBuildDir}/BUILD/etc/
|
cp -rf ${CustomizedDir}/agt.d ${RpmBuildOMCDir}/static
|
||||||
#cp -rf ${BuildDir}/systemd ${RpmBuildDir}/BUILD/lib/
|
cp -rf ${CustomizedDir}/omc.d ${RpmBuildOMCDir}/static
|
||||||
cd ${RpmBuildDir}
|
cd ${RpmBuildDir}
|
||||||
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
|
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
|
||||||
|
|
||||||
|
if [ ! ProjectTag = "" ]; then
|
||||||
|
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-${ProjectTag}.${ptype}
|
||||||
|
fi
|
||||||
|
|
||||||
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
|
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
|
||||||
cd ${ReleasePkgDir}
|
cd ${ReleasePkgDir}
|
||||||
rm -f omc-md5sum.txt
|
rm -f omc-md5sum.txt
|
||||||
# rpm --addsign *.rpm
|
# rpm --addsign *.rpm
|
||||||
md5sum $RpmPkgRename >omc-md5sum.txt
|
md5sum $RpmPkgRename >omc-md5sum.txt
|
||||||
|
echo "Finish to make ${pkgtype} package <======"
|
||||||
;;
|
;;
|
||||||
deb)
|
deb)
|
||||||
ProcList="restagent crontask sshsvc captrace data2html"
|
echo "Begin to make ${pkgtype} package ======>"
|
||||||
|
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
|
||||||
|
ProcList="restagent sshsvc"
|
||||||
cd $EmsBEDir
|
cd $EmsBEDir
|
||||||
for procName in $ProcList;do
|
for procName in $ProcList;do
|
||||||
cd $EmsBEDir/$procName
|
cd $EmsBEDir/$procName
|
||||||
@@ -184,18 +244,10 @@ case "${pkgtype}" in
|
|||||||
make
|
make
|
||||||
done
|
done
|
||||||
|
|
||||||
VersionID=`grep VERSION_ID /etc/os-release`
|
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
||||||
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
|
if [ ! $ProjectTag = "" ]; then
|
||||||
DebBuildDir=${DebBuild2204Dir}
|
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-${ProjectTag}.${ptype}
|
||||||
DebFEBuildDir=${DebFEBuild2204Dir}
|
fi
|
||||||
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
|
|
||||||
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22.deb
|
|
||||||
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
|
|
||||||
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18.deb
|
|
||||||
else
|
|
||||||
echo "Invalid OS release: ${VersionID}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${EmsBEDir}
|
cd ${EmsBEDir}
|
||||||
|
|
||||||
@@ -204,19 +256,17 @@ case "${pkgtype}" in
|
|||||||
rm -rf ${FrontBuildDir}/front/*
|
rm -rf ${FrontBuildDir}/front/*
|
||||||
rm -rf ${DebFEBuildDir}/front/*
|
rm -rf ${DebFEBuildDir}/front/*
|
||||||
rm -rf ${DebBuildDir}/usr/local/omc/etc/db/*
|
rm -rf ${DebBuildDir}/usr/local/omc/etc/db/*
|
||||||
|
rm -rf ${DebBuildOMCDir}/static/*
|
||||||
|
|
||||||
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
|
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
|
||||||
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
|
|
||||||
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
|
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
|
||||||
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
|
|
||||||
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
|
|
||||||
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
|
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
|
||||||
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
|
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
|
||||||
rm -rf ${BuildOMCEtcDir}/db/*
|
rm -rf ${BuildOMCEtcDir}/db/*
|
||||||
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
|
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
|
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
|
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
|
||||||
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
|
|
||||||
#Get SQL from database, overwrite from git
|
#Get SQL from database, overwrite from git
|
||||||
if [ "${dumpdb}" = "yes" ]; then
|
if [ "${dumpdb}" = "yes" ]; then
|
||||||
cd ${DumpToolDir}
|
cd ${DumpToolDir}
|
||||||
@@ -230,18 +280,82 @@ case "${pkgtype}" in
|
|||||||
chmod 755 ${DebBuildDir}/DEBIAN/postinst
|
chmod 755 ${DebBuildDir}/DEBIAN/postinst
|
||||||
chmod 755 ${DebBuildDir}/DEBIAN/postrm
|
chmod 755 ${DebBuildDir}/DEBIAN/postrm
|
||||||
cp -rf ${BuildDir}/* ${DebBuildDir}/
|
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}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
|
||||||
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
|
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
|
||||||
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
|
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
|
||||||
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
|
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
|
||||||
|
sed -i "s/Architecture: amd64/Architecture: ${RelArch}/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
|
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}
|
dpkg -b ${DebBuildDir} ${ReleasePkgDir}/${DebPkgFile}
|
||||||
|
|
||||||
cd ${ReleasePkgDir}
|
cd ${ReleasePkgDir}
|
||||||
rm -f omc-md5sum.txt
|
rm -f omc-md5sum.txt
|
||||||
# rpm --addsign *.rpm
|
# rpm --addsign *.rpm
|
||||||
md5sum ${DebPkgName} >omc-md5sum.txt
|
md5sum ${DebPkgName} >omc-md5sum.txt
|
||||||
|
echo "Finish to make ${pkgtype} package <======="
|
||||||
;;
|
;;
|
||||||
|
badeb)
|
||||||
|
echo "Begin to make ${pkgtype} package ======>"
|
||||||
|
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
|
||||||
|
ProcList="restagent sshsvc"
|
||||||
|
cd $EmsBEDir
|
||||||
|
for procName in $ProcList;do
|
||||||
|
cd $EmsBEDir/$procName
|
||||||
|
echo "Make $procName ..."
|
||||||
|
make
|
||||||
|
done
|
||||||
|
|
||||||
|
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-ba.deb
|
||||||
|
|
||||||
|
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 ${SshSvcDir}/${SshSvcBin} ${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
|
||||||
|
|
||||||
|
#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
|
||||||
|
sed -i "s/Architecture: amd64/Architecture: ${RelArch}/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
|
||||||
|
echo "Finish to make ${pkgtype} package <======"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
exit 4
|
exit 4
|
||||||
48
makepkg.sh → bin/makepkg.sh
Normal file → Executable file
@@ -6,11 +6,12 @@ usage() {
|
|||||||
echo "Make omc package, option as follow:"
|
echo "Make omc package, option as follow:"
|
||||||
echo " deb|rpm, deb: ubuntu|debian package build by dpkg"
|
echo " deb|rpm, deb: ubuntu|debian package build by dpkg"
|
||||||
echo " rpm: centos/redhat package, build by rpmbuild"
|
echo " rpm: centos/redhat package, build by rpmbuild"
|
||||||
echo " -r, =build root directory build root directory, default directory is $HOME/local.git"
|
echo " -r, =build root directory build root directory, default directory is $HOME/omc.git"
|
||||||
echo " -d dump SQL from database"
|
echo " -d dump SQL from database"
|
||||||
echo " -m, =be|fe|all be: only process back-end code, default if non input"
|
echo " -m, =be|fe|all be: only process back-end code, default if non input"
|
||||||
echo " fe: only process front-end code"
|
echo " fe: only process front-end code"
|
||||||
echo " all: process all include be and fe"
|
echo " all: process all include be and fe"
|
||||||
|
echo " -c, =ba ba: customized for BA OMC"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgtype=""
|
pkgtype=""
|
||||||
@@ -34,9 +35,9 @@ fi
|
|||||||
# Use a new parameter list
|
# Use a new parameter list
|
||||||
set -- "${new_args[@]}"
|
set -- "${new_args[@]}"
|
||||||
|
|
||||||
rootdir=${HOME}/local.git
|
rootdir=${HOME}/omc.git
|
||||||
m_arg="*"
|
m_arg="*"
|
||||||
while getopts "m:r:d" option; do
|
while getopts "m:r:c:d" option; do
|
||||||
case $option in
|
case $option in
|
||||||
m)
|
m)
|
||||||
m_arg=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
m_arg=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -48,6 +49,13 @@ while getopts "m:r:d" option; do
|
|||||||
d)
|
d)
|
||||||
be_args+=("-d")
|
be_args+=("-d")
|
||||||
;;
|
;;
|
||||||
|
c)
|
||||||
|
c_arg=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [ "${c_arg}" == "ba" ]; then
|
||||||
|
pkgtype="badeb"
|
||||||
|
be_args+=("${pkgtype}")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
usage
|
usage
|
||||||
@@ -62,18 +70,44 @@ if [ ! -d ${rootdir} ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
bedir=${rootdir}/be.ems
|
bedir=${rootdir}/be.ems
|
||||||
fedir=${rootdir}/fe.ems.vue3
|
|
||||||
builddir=${rootdir}/build.ems
|
builddir=${rootdir}/build.ems
|
||||||
|
buildcustomized=${builddir}/customized
|
||||||
|
customizeddir=${buildcustomized}/${c_arg}.d
|
||||||
|
|
||||||
|
fedir=${rootdir}/fe.ems.vue3
|
||||||
|
feassetsdir=${fedir}/src/assets
|
||||||
|
felocalesdir=${fedir}/src/i18n/locales
|
||||||
|
feconstantsdir=${fedir}/src/constants
|
||||||
|
fehooksdir=${fedir}/src/hooks
|
||||||
|
|
||||||
makefe() {
|
makefe() {
|
||||||
cd ${fedir}
|
cd ${fedir}
|
||||||
|
git checkout ${feassetsdir}
|
||||||
|
git checkout ${felocalesdir}
|
||||||
|
git checkout ${feconstantsdir}
|
||||||
|
git checkout ${fehooksdir}
|
||||||
git pull
|
git pull
|
||||||
npm install --registry https://registry.npmmirror.com
|
if [ "${pkgtype}" == "badeb" ]; then
|
||||||
npm run build
|
cp -rf ${customizeddir}/images/* ${feassetsdir}
|
||||||
|
cp -rf ${customizeddir}/locales/* ${felocalesdir}
|
||||||
|
find "${feconstantsdir}" -type f -name '*.ts' -exec sed -i 's/[一-龥()“”,。?!]~·]//g' {} +
|
||||||
|
find "${fehooksdir}" -type f -name '*.ts' -exec sed -i 's/[一-龥()“”,。?!]~·]//g' {} +
|
||||||
|
fi
|
||||||
|
npm install --force --registry https://registry.npmmirror.com
|
||||||
|
echo -n "Building front-end vue ... "
|
||||||
|
npm run build 1>/dev/null
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
echo "done"
|
||||||
|
fi
|
||||||
|
git checkout ${feassetsdir}
|
||||||
|
git checkout ${felocalesdir}
|
||||||
|
git checkout ${feconstantsdir}
|
||||||
|
git checkout ${fehooksdir}
|
||||||
}
|
}
|
||||||
|
|
||||||
makebe() {
|
makebe() {
|
||||||
cd ${builddir}
|
cd ${builddir}/bin
|
||||||
#chmod +x mkpkg.sh
|
#chmod +x mkpkg.sh
|
||||||
chmod +x build.sh
|
chmod +x build.sh
|
||||||
./build.sh ${be_args[@]}
|
./build.sh ${be_args[@]}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# file: log file name
|
|
||||||
# level: /trace/debug/info/warn/error/fatal, default: debug
|
|
||||||
# duration: saved days, default is 30 days
|
|
||||||
logger:
|
|
||||||
file: /usr/local/omc/log/crontask.log
|
|
||||||
level: trace
|
|
||||||
duration: 24
|
|
||||||
count: 90
|
|
||||||
|
|
||||||
omc:
|
|
||||||
name: RJ_OMC_S001
|
|
||||||
hosturi: http://127.0.0.1:3030
|
|
||||||
hostno: S001
|
|
||||||
province: BJ
|
|
||||||
netabbr: HX
|
|
||||||
vendor: RJ
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
file: /usr/local/omc/etc/tasks.yaml
|
|
||||||
|
|
||||||
database:
|
|
||||||
type: mysql
|
|
||||||
user: root
|
|
||||||
password: 1000omc@kp!
|
|
||||||
host: 127.0.0.1
|
|
||||||
port: 33066
|
|
||||||
name: omc_db
|
|
||||||
backup: /usr/local/omc/database
|
|
||||||
|
|
||||||
# northbound interface, cm/pm
|
|
||||||
# duration(day): saved days
|
|
||||||
# zipPeriods(day): periods of zip pm data file
|
|
||||||
northbound:
|
|
||||||
cm:
|
|
||||||
cfgfiledir: /usr/local/omc/etc/cm
|
|
||||||
xmlfiledir: /opt/omc/ftp/cm
|
|
||||||
version: V1.0.1
|
|
||||||
duration: 30
|
|
||||||
pm:
|
|
||||||
cfgfiledir: /usr/local/omc/etc/pm
|
|
||||||
xmlfiledir: /opt/omc/ftp/pm
|
|
||||||
version: V1.0.1
|
|
||||||
duration: 30
|
|
||||||
zipPeriods: 1
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
# file: log file name
|
|
||||||
# level: /trace/debug/info/warn/error/fatal, default: debug
|
|
||||||
# duration: rotation time with xx hours, example: 1/12/24 hours
|
|
||||||
# count: rotation count of log, default is 30 rotation
|
|
||||||
logger:
|
|
||||||
file: /usr/local/omc/log/restagent.log
|
|
||||||
level: debug
|
|
||||||
duration: 24
|
|
||||||
count: 90
|
|
||||||
|
|
||||||
# rest agent listen ipv4/v6 and port, support multiple routines
|
|
||||||
# ip: 0.0.0.0 or ::0, support IPv4/v6
|
|
||||||
rest:
|
|
||||||
- ipv4: 0.0.0.0
|
|
||||||
ipv6:
|
|
||||||
port: 3030
|
|
||||||
- ipv4:
|
|
||||||
ipv6: ::0
|
|
||||||
port: 6060
|
|
||||||
|
|
||||||
database:
|
|
||||||
type: mysql
|
|
||||||
user: root
|
|
||||||
password: 1000omc@kp!
|
|
||||||
host: 127.0.0.1
|
|
||||||
port: 33066
|
|
||||||
name: omc_db
|
|
||||||
backup: /usr/loal/omc/database
|
|
||||||
|
|
||||||
mml:
|
|
||||||
port: 4100
|
|
||||||
sleep: 200
|
|
||||||
user: admin
|
|
||||||
password: admin
|
|
||||||
|
|
||||||
ne:
|
|
||||||
user: root
|
|
||||||
etcdir: /usr/local/etc
|
|
||||||
bindir: /usr/local/bin
|
|
||||||
omcdir: /usr/local/omc
|
|
||||||
licensedir: /usr/local/etc/{neType}/license
|
|
||||||
|
|
||||||
# chk2ne: true/false, if put OmcNeConfig parameters to NE
|
|
||||||
omc:
|
|
||||||
uriPrefix: /api/rest/oam
|
|
||||||
neType: OMC
|
|
||||||
neId: 001
|
|
||||||
rmUID: 1100RJHX1OMC001
|
|
||||||
neName: OMC
|
|
||||||
province: BJ
|
|
||||||
vendor: RJ
|
|
||||||
dn: 4600
|
|
||||||
chk2ne: false
|
|
||||||
sn: 13750650
|
|
||||||
checksign: false
|
|
||||||
backup: /usr/local/omc/backup
|
|
||||||
upload: /usr/local/omc/upload
|
|
||||||
frontUpload: /usr/local/omc/htdocs/front/upload
|
|
||||||
software: /usr/local/omc/software
|
|
||||||
license: /usr/local/omc/license
|
|
||||||
gtpUri: gtp:192.168.2.119:2152
|
|
||||||
checkContentType: false
|
|
||||||
testMode: true
|
|
||||||
rbacMode: true
|
|
||||||
|
|
||||||
# Alarm module setting
|
|
||||||
# Forward interface:
|
|
||||||
# email/sms
|
|
||||||
alarm:
|
|
||||||
forwardAlarm: true
|
|
||||||
email:
|
|
||||||
smtp: smtp@ruijie.com.cn
|
|
||||||
port: 25
|
|
||||||
user: smtpuser
|
|
||||||
password: smtpuser@omc
|
|
||||||
sms:
|
|
||||||
apiURL: http://smsc.ruijie.com.cn/
|
|
||||||
accessKeyID: xxxx
|
|
||||||
accessKeySecret: xxxx
|
|
||||||
signName: Ruijie SMSC
|
|
||||||
templateCode: 1000
|
|
||||||
|
|
||||||
#User authorized information
|
|
||||||
# crypt: mysql/md5/bcrypt
|
|
||||||
# token: true/false to check accessToken
|
|
||||||
# expires for session, unit: second
|
|
||||||
# Support single/multiple session of user
|
|
||||||
auth:
|
|
||||||
crypt: bcrypt
|
|
||||||
token: true
|
|
||||||
expires: 1800
|
|
||||||
session: multiple
|
|
||||||
|
|
||||||
# Parameter for limit number
|
|
||||||
# rmuid_maxnum: the max number of rmUID, default: 50
|
|
||||||
# alarmid_maxnum: the max number of AlarmID, default: 50
|
|
||||||
# pmid_maxnum: the max number of pmID, default: 50
|
|
||||||
# subid_maxnum: the max number of subscription ID, default: 20
|
|
||||||
# uri_maxlen: the max length of uri, default: 8192
|
|
||||||
# rmuid_regexp: regexp pattern of rmUID
|
|
||||||
params:
|
|
||||||
rmuidmaxnum: 50
|
|
||||||
alarmidmaxnum: 50
|
|
||||||
pmidmaxnum: 50
|
|
||||||
subidmaxnum: 20
|
|
||||||
urimaxlen: 2100000
|
|
||||||
rmuidregexp: "[0-9]{4}[A-Z]{2}[A-Z]{2}[0-9A-Z]{1}[0-9A-Z]{3}[0-9A-Z]{1,16}"
|
|
||||||
|
|
||||||
testConfig:
|
|
||||||
enabled: true
|
|
||||||
file: /usr/local/omc/etc/testconfig.yaml
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# count: rotation count of log, default is 30 rotation
|
# count: rotation count of log, default is 30 rotation
|
||||||
logger:
|
logger:
|
||||||
file: /usr/local/omc/log/sshsvc.log
|
file: /usr/local/omc/log/sshsvc.log
|
||||||
level: debug
|
level: warn
|
||||||
duration: 24
|
duration: 24
|
||||||
count: 30
|
count: 30
|
||||||
|
|
||||||
@@ -23,12 +23,48 @@ logmml:
|
|||||||
# session: single/multiple session for one user
|
# session: single/multiple session for one user
|
||||||
sshd:
|
sshd:
|
||||||
listenAddr: 0.0.0.0
|
listenAddr: 0.0.0.0
|
||||||
listenPort: 2222
|
listenPort: 32222
|
||||||
privateKey: /usr/local/omc/.ssh/id_rsa
|
privateKey: /usr/local/omc/.ssh/id_rsa
|
||||||
maxConnNum: 20
|
maxConnNum: 2
|
||||||
timeout: 1800
|
timeout: 1800
|
||||||
session: multiple
|
session: multiple
|
||||||
|
mmlHome: /usr/local/omc/mmlhome
|
||||||
|
userName: manager
|
||||||
|
password: pass123
|
||||||
|
authType: local
|
||||||
|
tagNE: omc
|
||||||
|
|
||||||
|
# authType: local/omc
|
||||||
|
telnetServer:
|
||||||
|
listenAddr: 0.0.0.0
|
||||||
|
listenPort: 32323
|
||||||
|
maxConnNum: 2
|
||||||
|
timeout: 1800
|
||||||
|
session: multiple
|
||||||
|
mmlHome: /usr/local/omc/mmlhome
|
||||||
|
userName: manager
|
||||||
|
password: pass123
|
||||||
|
authType: local
|
||||||
|
tagNE: omc
|
||||||
|
|
||||||
|
# authproto: NoAuth/MD5/SHA
|
||||||
|
# privProto: NoPriv/DES/AES/AES192/AES256
|
||||||
|
snmpServer:
|
||||||
|
listenAddr: '[::]'
|
||||||
|
listenPort: 34957
|
||||||
|
userName: manager
|
||||||
|
authPass: pass123
|
||||||
|
authproto: MD5
|
||||||
|
privPass: "3F2A1B4C5D6E7F8A9B0C1D2E3F4A5B6C7D8E9F0A1B2C3D4E"
|
||||||
|
privProto: DES
|
||||||
|
engineID: "8000000004323030313a6462383a3a39313636"
|
||||||
|
trapPort: 34958
|
||||||
|
trapListen: false
|
||||||
|
trapBool: false
|
||||||
|
trapTick: 60
|
||||||
|
timeOut: 5
|
||||||
|
trapTarget: ""
|
||||||
|
|
||||||
database:
|
database:
|
||||||
type: mysql
|
type: mysql
|
||||||
user: root
|
user: root
|
||||||
@@ -36,9 +72,10 @@ database:
|
|||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 33066
|
port: 33066
|
||||||
name: omc_db
|
name: omc_db
|
||||||
|
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
||||||
|
|
||||||
omc:
|
omc:
|
||||||
httpUri: http://127.0.0.1:3030
|
httpUri: http://127.0.0.1:33030
|
||||||
userCrypt: bcrypt
|
userCrypt: bcrypt
|
||||||
|
|
||||||
ne:
|
ne:
|
||||||
|
|||||||
@@ -1,171 +0,0 @@
|
|||||||
# example:
|
|
||||||
# tasks:
|
|
||||||
# - name: test # task comment
|
|
||||||
# uri: # restful uri
|
|
||||||
# params: # params of url
|
|
||||||
# interval: 30 # do sometion in the interval
|
|
||||||
# unit: Seconds #Seconds/Minutes/Hours/Days/Weeks, Monday/Tuesday/.../Sunday,
|
|
||||||
# at: 00:10:00 # do at time such as xx:xx:xx
|
|
||||||
# do: HelloWorldTask # (Do what: callback function)
|
|
||||||
#
|
|
||||||
# Attention: must restart crontask after modified this file
|
|
||||||
#
|
|
||||||
tasks:
|
|
||||||
- name: test # task comment
|
|
||||||
status: Active #active/inactive
|
|
||||||
uri: # restful uri
|
|
||||||
params: # params of http url
|
|
||||||
body: # body of http request
|
|
||||||
interval: 60 # do sometion in the interval
|
|
||||||
unit: Seconds #Seconds/Minutes/Hours/Days/Weeks, Monday/Tuesday/.../Sunday,
|
|
||||||
at: 00:10:00 # do at time such as xx:xx:xx when unit such as Day/Days/Mondays...
|
|
||||||
do: TaskHelloWorld # (Do what: callback function)
|
|
||||||
- name: clear expired history alarm
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/alarm
|
|
||||||
params: WHERE=now()+>+ADDDATE(event_time,+interval+(SELECT+`value`+FROM+config+WHERE+config_tag='historyDuration')+day)+and+alarm_status='0'
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:10:00
|
|
||||||
do: TaskDeleteExpiredRecord
|
|
||||||
- name: clear deleted custom pm kpi
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/pm_custom_title
|
|
||||||
params: WHERE=now()+>+ADDDATE(update_time,+interval+(SELECT+`value`+FROM+config+WHERE+config_tag='keepPMCKpi')+day)+and+status='Deleted'
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:15:00
|
|
||||||
do: TaskDeleteExpiredRecord
|
|
||||||
- name: update expired user session
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/session
|
|
||||||
params: WHERE=NOW()+>+ADDDATE(shake_time,+interval+expires+second)+and+status='online'
|
|
||||||
body: '{"session":{"status":"offline"}}'
|
|
||||||
interval: 30
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskUpdateTable
|
|
||||||
- name: clear expired log
|
|
||||||
uri:
|
|
||||||
params:
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:50:00
|
|
||||||
do: TaskDeleteExpiredRecord
|
|
||||||
- name: Backup measure data
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/measure_data
|
|
||||||
params: SQL=select+*+into+outfile+'%s'+fields+terminated+by+','+escaped+by+''+optionally+enclosed+by+''+lines+terminated+by+'\n'+from+(select+'id','date','task_id','ne_name','rm_uid','ne_type','granul_option','kpi_code','kpi_id','kpi_ext','start_time','end_time','value','timestamp'+union+select+id,date,task_id,ne_name,rm_uid,ne_type,granul_option,kpi_code,kpi_id,kpi_ext,start_time,end_time,value,timestamp+from+measure_data)+b
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:20:00
|
|
||||||
do: TaskDBBackupCSVGetBySQL
|
|
||||||
- name: Backup operation log
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/operation_log
|
|
||||||
params: SQL=select+*+into+outfile+'%s'+fields+terminated+by+','+escaped+by+''+optionally+enclosed+by+''+lines+terminated+by+'\n'+from+(select+'op_id','account_name','op_ip','subsys_tag','op_type','op_content','op_result','begin_time','end_time','vnf_flag','log_time'+union+select+op_id,account_name,op_ip,subsys_tag,op_type,op_content,op_result,begin_time,end_time,vnf_flag,log_time+from+operation_log)+b
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:26:00
|
|
||||||
do: TaskDBBackupCSVGetBySQL
|
|
||||||
- name: Backup security log
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/security_log
|
|
||||||
params: SQL=select+*+into+outfile+'%s'+fields+terminated+by+','+escaped+by+''+optionally+enclosed+by+''+lines+terminated+by+'\n'+from+(select+'id','account_name','account_type','op_ip','op_type','op_content','op_result','op_time'+union+select+id,account_name,account_type,op_ip,op_type,op_content,op_result,op_time+from+security_log)+b
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:28:00
|
|
||||||
do: TaskDBBackupCSVGetBySQL
|
|
||||||
- name: Backup alarm log
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/alarm_log
|
|
||||||
params: SQL=select+*+into+outfile+'%s'+fields+terminated+by+','+escaped+by+''+optionally+enclosed+by+''+lines+terminated+by+'\n'+from+(select+'id','ne_type','ne_id','alarm_seq','alarm_id','alarm_code','alarm_status','event_time','log_time'+union+select+id,ne_type,ne_id,alarm_seq,alarm_id,alarm_code,alarm_status,event_time,log_time+from+alarm_log)+b
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:30:00
|
|
||||||
do: TaskDBBackupCSVGetBySQL
|
|
||||||
- name: handshake to NF
|
|
||||||
status: Active
|
|
||||||
uri: /api/rest/systemManagement/v1/elementType/%s/objectType/systemState
|
|
||||||
params:
|
|
||||||
interval: 10
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskHandShakeToNF
|
|
||||||
- name: Export CM from NF
|
|
||||||
uri: /api/rest/systemManagement/v1/elementType/%s/objectType/cm
|
|
||||||
params: ne_id=%s
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:15
|
|
||||||
do: TaskExportCmFromNF
|
|
||||||
- name: Generate NRM xml file
|
|
||||||
uri:
|
|
||||||
params:
|
|
||||||
interval: 1
|
|
||||||
unit: Day
|
|
||||||
at: 00:00,06:00,12:00,18:00
|
|
||||||
do: GenCmXmlFile
|
|
||||||
- name: Task of Generate measure threshold alarm
|
|
||||||
status: Active
|
|
||||||
uri: /api/rest/faultManagement/v1/elementType/%s/objectType/alarms
|
|
||||||
params: RJHXEMSPM10200
|
|
||||||
interval: 10
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskGenMeasureThresholdAlarm
|
|
||||||
- name: Task of Generate license alarm
|
|
||||||
status: Inactive
|
|
||||||
uri: /api/rest/faultManagement/v1/elementType/%s/objectType/alarms
|
|
||||||
params: RJHXEMSCM10100
|
|
||||||
interval: 1
|
|
||||||
unit: Days
|
|
||||||
at: 00:30
|
|
||||||
do: TaskGenLicenseAlarm
|
|
||||||
- name: Task of Generate NE system state alarm
|
|
||||||
status: Active
|
|
||||||
uri: /api/rest/faultManagement/v1/elementType/%s/objectType/alarms
|
|
||||||
params: RJHXEMSSM10000
|
|
||||||
interval: 5
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskGenNeStateAlarm
|
|
||||||
- name: Task of Generate Measure Report Timeout
|
|
||||||
status: Active
|
|
||||||
uri: /api/rest/faultManagement/v1/elementType/%s/objectType/alarms
|
|
||||||
params: RJHXEMSPM10201
|
|
||||||
interval: 10
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskGenMeasureReportTimeoutAlarm
|
|
||||||
- name: Monitor proces list and write system log
|
|
||||||
uri: /api/rest/databaseManagement/v1/omc_db/system_log
|
|
||||||
params:
|
|
||||||
body:
|
|
||||||
interval: 10
|
|
||||||
unit: Seconds
|
|
||||||
at:
|
|
||||||
do: TaskWriteSystemLog
|
|
||||||
- name: Copy log to /opt/omc/ftp/log
|
|
||||||
uri:
|
|
||||||
params: cp -rf /usr/local/omc/database/*.csv /opt/omc/ftp/log
|
|
||||||
interval: 10
|
|
||||||
unit: Minutes
|
|
||||||
at:
|
|
||||||
do: TaskRunShellCommand
|
|
||||||
# - name: Import CM to NF
|
|
||||||
# uri: /api/rest/systemManagement/v1/elementType/udm/objectType/cm
|
|
||||||
# params: ne_id=SZ_01
|
|
||||||
# interval: 15
|
|
||||||
# unit: Seconds
|
|
||||||
# at:
|
|
||||||
# do: TaskImportCmToNF
|
|
||||||
crontab:
|
|
||||||
# - name: 每隔1分钟执行
|
|
||||||
# tab: 0 */1 * * * ? // crontab: rule like linux crontab
|
|
||||||
# do: CronHelloWorldTask // function name to call
|
|
||||||
# params:
|
|
||||||
- name: Generate PM xml file
|
|
||||||
status: Active
|
|
||||||
tab: 5,20,35,50 * * * *
|
|
||||||
do: GenPmXmlFile
|
|
||||||
uri: this is uri
|
|
||||||
params: Generating PM xml file
|
|
||||||
# - name: Import CM to NF
|
|
||||||
# tab: 0 * * * * *
|
|
||||||
# do: TaskImportCmToNF
|
|
||||||
# uri: /api/rest/systemManagement/v1/elementType/udm/objectType/cm
|
|
||||||
# params: ne_id=SZ_01
|
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -9,9 +9,9 @@ REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.defau
|
|||||||
|
|
||||||
--
|
--
|
||||||
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 (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 ©2023 千通科技', '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 (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 ©2023 AGrandTech', '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
|
-- set internationalization switching to ON
|
||||||
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
||||||
BIN
customized/agt.d/images/background_dark.jpg
Normal file
|
After Width: | Height: | Size: 114 B |
BIN
customized/agt.d/images/background_light.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
0
customized/agt.d/locales/.gitkeep
Normal file
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
@@ -9,9 +9,9 @@ REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.defau
|
|||||||
|
|
||||||
--
|
--
|
||||||
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 (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 ©2023 BlueArcus', '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 (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 ©2023 BlueArcus', '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
|
-- set internationalization switching to ON
|
||||||
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
||||||
BIN
customized/ba.d/images/background_dark.jpg
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
customized/ba.d/images/background_light.jpg
Normal file
|
After Width: | Height: | Size: 216 KiB |
2
customized/ba.d/locales/zh-CN.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export default {
|
||||||
|
};
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
20
customized/omc.d/db/customized.sql
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
--
|
||||||
|
REPLACE INTO `sys_config` VALUES (6, 'config.sys.officialUrl', 'sys.officialUrl', '#', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.officialUrlRemark');
|
||||||
|
REPLACE INTO `sys_config` VALUES (106, 'config.sys.title', 'sys.title', 'config.sys.titleValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.titleRemark');
|
||||||
|
REPLACE INTO `sys_config` VALUES (107, 'config.sys.copyright', 'sys.copyright', 'config.sys.copyrightValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.copyrightRemark');
|
||||||
|
REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 'true', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nOpenRemark');
|
||||||
|
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
||||||
|
|
||||||
|
--
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'OMC', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'OMC', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|
||||||
|
-- set internationalization switching to ON
|
||||||
|
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
||||||
|
UPDATE `sys_menu` SET `status` = '1' WHERE `menu_id` = 2122;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
BIN
customized/omc.d/doc/en_doc.pdf
Normal file
BIN
customized/omc.d/doc/zh_doc.pdf
Normal file
BIN
customized/omc.d/images/background_dark.jpg
Normal file
|
After Width: | Height: | Size: 114 B |
BIN
customized/omc.d/images/background_light.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
0
customized/omc.d/locales/.gitkeep
Normal file
BIN
customized/omc.d/logo/en_brand.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
customized/omc.d/logo/en_icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
customized/omc.d/logo/zh_brand.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
customized/omc.d/logo/zh_icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
@@ -1,5 +1,5 @@
|
|||||||
Package: OMC
|
Package: OMC
|
||||||
Version: 2.2409.4-YYYYMMDD
|
Version: 2.2508.2-YYYYMMDD
|
||||||
Section: AGrandTech
|
Section: AGrandTech
|
||||||
Prioritt: optional
|
Prioritt: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
30
debbuild/22.04/DEBIAN/postinst
Normal file → Executable file
@@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc
|
|||||||
SystemdRootDir=/lib/systemd/system
|
SystemdRootDir=/lib/systemd/system
|
||||||
OMCEtcDir=${OMCRootDir}/etc
|
OMCEtcDir=${OMCRootDir}/etc
|
||||||
FERootDir=${OMCRootDir}/htdocs/front
|
FERootDir=${OMCRootDir}/htdocs/front
|
||||||
X86Lib64Dir=/lib/x86_64-linux-gnu
|
|
||||||
OmcBinDir=${OMCRootDir}/bin
|
OmcBinDir=${OMCRootDir}/bin
|
||||||
OMCStaticDir=${OMCRootDir}/static
|
OMCStaticDir=${OMCRootDir}/static
|
||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
OmcDaemon=omcd
|
OmcDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
NginxConfDir=${NginxEtcDir}/conf.d
|
NginxConfDir=${NginxEtcDir}/conf.d
|
||||||
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
|
CFileList=$(ls ${OMCEtcDir}/default)
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "* To start/stop/restart/status omc service, please run:"
|
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 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 sshsvc.service"
|
||||||
echo " sudo systemctl start/stop/restart/status captrace.service"
|
|
||||||
echo " or run: "
|
echo " or run: "
|
||||||
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
|
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
|
||||||
echo ""
|
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}
|
cd ${UsrLocalBinDir}
|
||||||
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
|
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
|
||||||
|
|
||||||
@@ -45,9 +32,12 @@ chmod -R 755 ${OMCRootDir}/htdocs/front
|
|||||||
for CFile in ${CFileList}; do
|
for CFile in ${CFileList}; do
|
||||||
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
||||||
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
# else
|
else
|
||||||
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
||||||
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
|
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
|
||||||
|
${OMCBinDir}/upgconf.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -73,13 +63,13 @@ if [ ! -e "${NginxConfDir}/omc.conf" ]; then
|
|||||||
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
|
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
# disable auto upgrade
|
# disable auto upgrade
|
||||||
systemctl disable --now unattended-upgrades
|
systemctl disable --now unattended-upgrades
|
||||||
|
|
||||||
systemctl enable restagent.service
|
systemctl enable restagent.service
|
||||||
systemctl enable crontask.service
|
|
||||||
systemctl enable sshsvc.service
|
systemctl enable sshsvc.service
|
||||||
systemctl enable captrace.service
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
@@ -100,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Starting OMC service ... "
|
echo -n "Starting OMC service ... "
|
||||||
systemctl start crontask.service
|
|
||||||
systemctl start sshsvc.service
|
systemctl start sshsvc.service
|
||||||
systemctl start captrace.service
|
|
||||||
systemctl start restagent.service
|
systemctl start restagent.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
12
debbuild/22.04/DEBIAN/postrm
Normal file → Executable file
@@ -1,13 +1,5 @@
|
|||||||
# !/bin/bash
|
# !/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 /usr/local/omc
|
||||||
rm -rf /etc/nginx/conf.d/omc.conf
|
rm -rf /etc/nginx/conf.d/omc.conf
|
||||||
rm -f /usr/local/bin/omcd
|
rm -f /usr/local/bin/omcd
|
||||||
@@ -17,15 +9,11 @@ systemctl daemon-reload
|
|||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping OMC service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop crontask.service
|
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
systemctl stop captrace.service
|
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl disable restagent.service
|
systemctl disable restagent.service
|
||||||
systemctl disable crontask.service
|
|
||||||
systemctl disable sshsvc.service
|
systemctl disable sshsvc.service
|
||||||
systemctl disable captrace.service
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
2
debbuild/22.04/DEBIAN/preinst
Normal file → Executable file
@@ -4,9 +4,7 @@ systemctl daemon-reload
|
|||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping OMC service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop crontask.service
|
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
systemctl stop captrace.service
|
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -69,17 +69,19 @@ redis:
|
|||||||
# sleep: time delay for after write buffer (millisecond)
|
# sleep: time delay for after write buffer (millisecond)
|
||||||
# deadLine: timeout for io read and write (second)
|
# deadLine: timeout for io read and write (second)
|
||||||
mml:
|
mml:
|
||||||
port: 4100
|
|
||||||
port2: 5002
|
|
||||||
sleep: 200
|
sleep: 200
|
||||||
deadLine: 10
|
deadLine: 10
|
||||||
sizeRow: 600
|
sizeRow: 600
|
||||||
sizeCol: 128
|
sizeCol: 128
|
||||||
bufferSize: 65535
|
bufferSize: 65535
|
||||||
user: admin
|
|
||||||
password: admin
|
|
||||||
mmlHome: ./mmlhome
|
mmlHome: ./mmlhome
|
||||||
|
|
||||||
|
# Tracking configuration
|
||||||
|
trace:
|
||||||
|
enabled: true
|
||||||
|
host: "172.16.5.100" # Fill in the specific IP address
|
||||||
|
port: 33033
|
||||||
|
|
||||||
# NE config
|
# NE config
|
||||||
ne:
|
ne:
|
||||||
user: omcuser
|
user: omcuser
|
||||||
@@ -126,28 +128,36 @@ omc:
|
|||||||
|
|
||||||
# Alarm module setting
|
# Alarm module setting
|
||||||
# Forward interface:
|
# Forward interface:
|
||||||
# email/sms/smsc
|
# TLS Skip verify: true/false
|
||||||
|
# email/sms
|
||||||
|
# smProxy: sms(Short Message Service)/smsc(SMS Centre)
|
||||||
|
# dataCoding: 0:GSM7BIT, 1:ASCII, 2:BINARY8BIT1, 3:LATIN1,
|
||||||
|
# 4:BINARY8BIT2, 6:CYRILLIC, 7:HEBREW, 8:UCS2
|
||||||
alarm:
|
alarm:
|
||||||
forwardAlarm: true
|
alarmEmailForward:
|
||||||
email:
|
enable: true
|
||||||
smtp: smtp.xxx.com
|
emailList:
|
||||||
|
smtp: mail.smtp.com
|
||||||
port: 25
|
port: 25
|
||||||
user: smtpuser@xxx.com
|
user: smtpext@smtp.com
|
||||||
password: xxxxxx
|
password: "1000smtp@omc!"
|
||||||
# TLS skip verify: true/false
|
|
||||||
tlsSkipVerify: true
|
tlsSkipVerify: true
|
||||||
smProxy: smsc
|
alarmSMSForward:
|
||||||
sms:
|
enable: true
|
||||||
apiURL: http://smsc.xxx.com
|
mobileList:
|
||||||
accessKeyID: xxx
|
smscAddr: "192.168.13.114:2775"
|
||||||
accessKeySecret: xxx
|
systemID: "omc"
|
||||||
signName: XXX SMSC
|
|
||||||
templateCode: 1000
|
|
||||||
smsc:
|
|
||||||
addr: "192.168.13.114:2775"
|
|
||||||
systemID: "alarmsmsfw"
|
|
||||||
password: "omc123"
|
password: "omc123"
|
||||||
systemType: ""
|
systemType: "UTRAN"
|
||||||
|
dataCoding: 0
|
||||||
|
serviceNumber: "OMC"
|
||||||
|
sms:
|
||||||
|
apiURL: http://smsc.xxx.com/
|
||||||
|
accessKeyID: xxxx
|
||||||
|
accessKeySecret: xxxx
|
||||||
|
signName: xxx SMSC
|
||||||
|
templateCode: 1000
|
||||||
|
smProxy: smsc
|
||||||
|
|
||||||
# User authorized information
|
# User authorized information
|
||||||
# crypt: mysql/md5/bcrypt
|
# crypt: mysql/md5/bcrypt
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Package: OMC
|
Package: OMC
|
||||||
Version: 2.2409.4-YYYYMMDD
|
Version: 2.2508.2-YYYYMMDD
|
||||||
Section: AGrandTech
|
Section: AGrandTech
|
||||||
Prioritt: optional
|
Prioritt: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
@@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc
|
|||||||
SystemdRootDir=/lib/systemd/system
|
SystemdRootDir=/lib/systemd/system
|
||||||
OMCEtcDir=${OMCRootDir}/etc
|
OMCEtcDir=${OMCRootDir}/etc
|
||||||
FERootDir=${OMCRootDir}/htdocs/front
|
FERootDir=${OMCRootDir}/htdocs/front
|
||||||
X86Lib64Dir=/lib/x86_64-linux-gnu
|
|
||||||
OmcBinDir=${OMCRootDir}/bin
|
OmcBinDir=${OMCRootDir}/bin
|
||||||
OMCStaticDir=${OMCRootDir}/static
|
OMCStaticDir=${OMCRootDir}/static
|
||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
OmcDaemon=omcd
|
OmcDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
NginxConfDir=${NginxEtcDir}/conf.d
|
NginxConfDir=${NginxEtcDir}/conf.d
|
||||||
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
|
CFileList=$(ls ${OMCEtcDir}/default)
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "* To start/stop/restart/status omc service, please run:"
|
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 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 sshsvc.service"
|
||||||
echo " sudo systemctl start/stop/restart/status captrace.service"
|
|
||||||
echo " or run: "
|
echo " or run: "
|
||||||
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
|
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
|
||||||
echo ""
|
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}
|
cd ${UsrLocalBinDir}
|
||||||
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
|
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
|
||||||
|
|
||||||
@@ -45,9 +32,12 @@ chmod -R 755 ${OMCRootDir}/htdocs/front
|
|||||||
for CFile in ${CFileList}; do
|
for CFile in ${CFileList}; do
|
||||||
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
||||||
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
# else
|
else
|
||||||
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
||||||
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
|
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
|
||||||
|
${OMCBinDir}/upgconf.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -73,13 +63,13 @@ if [ ! -e "${NginxConfDir}/omc.conf" ]; then
|
|||||||
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
|
cp -f ${OMCEtcDir}/nginx/omc.conf ${NginxConfDir};
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
# disable auto upgrade
|
# disable auto upgrade
|
||||||
systemctl disable --now unattended-upgrades
|
systemctl disable --now unattended-upgrades
|
||||||
|
|
||||||
systemctl enable restagent.service
|
systemctl enable restagent.service
|
||||||
systemctl enable crontask.service
|
|
||||||
systemctl enable sshsvc.service
|
systemctl enable sshsvc.service
|
||||||
systemctl enable captrace.service
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
@@ -100,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Starting OMC service ... "
|
echo -n "Starting OMC service ... "
|
||||||
systemctl start crontask.service
|
|
||||||
systemctl start sshsvc.service
|
systemctl start sshsvc.service
|
||||||
systemctl start captrace.service
|
|
||||||
systemctl start restagent.service
|
systemctl start restagent.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
# !/bin/bash
|
# !/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 /usr/local/omc
|
||||||
rm -rf /etc/nginx/conf.d/omc.conf
|
rm -rf /etc/nginx/conf.d/omc.conf
|
||||||
rm -f /usr/local/bin/omcd
|
rm -f /usr/local/bin/omcd
|
||||||
@@ -17,15 +9,11 @@ systemctl daemon-reload
|
|||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping OMC service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop crontask.service
|
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
systemctl stop captrace.service
|
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl disable restagent.service
|
systemctl disable restagent.service
|
||||||
systemctl disable crontask.service
|
|
||||||
systemctl disable sshsvc.service
|
systemctl disable sshsvc.service
|
||||||
systemctl disable captrace.service
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ systemctl daemon-reload
|
|||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping OMC service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop crontask.service
|
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
systemctl stop captrace.service
|
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
BIN
docs/nbi/cm/AMF-NRM(V1.1.5)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/cm/PCF-NRM(V1.1.4)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/cm/SMF-NRM(V1.2.1)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/cm/UDM-NRM(V1.2.2)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/cm/UPF-NRM(V1.2.1)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/pm/AMF-PM(V1.1.5)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/pm/PCF-PM(V1.1.4)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/pm/SMF-PM(V1.2.1)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/pm/UDM-PM(V1.2.2)-Company-Version00.xlsx
Executable file
BIN
docs/nbi/pm/UPF-PM(V1.2.1)-Company-Version00.xlsx
Executable file
175
docs/nbi/pm/generate_ne_pm.py
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import pandas as pd
|
||||||
|
import json
|
||||||
|
import random
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
|
||||||
|
def generate_pm_json(excel_file_path, output_file_path):
|
||||||
|
"""
|
||||||
|
从 Excel 文件中提取英文名称和空间粒度,生成 PM JSON 文件
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
# 检查文件是否存在
|
||||||
|
if not os.path.exists(excel_file_path):
|
||||||
|
print(f"错误:文件 {excel_file_path} 不存在")
|
||||||
|
return False
|
||||||
|
|
||||||
|
print(f"正在读取 Excel 文件: {excel_file_path}")
|
||||||
|
|
||||||
|
# 读取 Excel 文件的所有工作表
|
||||||
|
excel_data = pd.read_excel(excel_file_path, sheet_name=None)
|
||||||
|
|
||||||
|
# 使用字典按 granularity 分组
|
||||||
|
granularity_groups = {}
|
||||||
|
processed_sheets = 0
|
||||||
|
|
||||||
|
# 遍历所有工作表,查找包含"英文名称"列的表格
|
||||||
|
for sheet_name, df in excel_data.items():
|
||||||
|
print(f" 处理工作表: {sheet_name}")
|
||||||
|
|
||||||
|
# 检查是否包含"英文名称"列
|
||||||
|
if '英文名称' in df.columns:
|
||||||
|
processed_sheets += 1
|
||||||
|
print(f" - 找到英文名称列,共 {len(df)} 行数据")
|
||||||
|
|
||||||
|
# 检查是否有空间粒度列
|
||||||
|
granularity_col = None
|
||||||
|
for col in df.columns:
|
||||||
|
if '空间粒度' in str(col) or '粒度' in str(col):
|
||||||
|
granularity_col = col
|
||||||
|
break
|
||||||
|
|
||||||
|
# 用于记录当前sheet中最后一个不为空的空间粒度
|
||||||
|
last_valid_granularity = "DefaultFunction"
|
||||||
|
|
||||||
|
for index, row in df.iterrows():
|
||||||
|
english_name = row['英文名称']
|
||||||
|
|
||||||
|
# 跳过空值和非字符串值
|
||||||
|
if pd.notna(english_name) and str(english_name).strip() and str(english_name) != 'nan':
|
||||||
|
english_name = str(english_name).strip()
|
||||||
|
|
||||||
|
# 获取空间粒度信息
|
||||||
|
current_granularity = None
|
||||||
|
if granularity_col and pd.notna(row[granularity_col]):
|
||||||
|
current_granularity = str(row[granularity_col]).strip()
|
||||||
|
if current_granularity: # 确保不是空字符串
|
||||||
|
last_valid_granularity = current_granularity
|
||||||
|
|
||||||
|
# 如果当前行的空间粒度为空,使用最后一个有效的空间粒度
|
||||||
|
granularity = last_valid_granularity
|
||||||
|
|
||||||
|
# 生成随机值
|
||||||
|
random_value = random.randint(0, 16)
|
||||||
|
|
||||||
|
kpi = {
|
||||||
|
"KPIID": english_name,
|
||||||
|
"KPIValues": [
|
||||||
|
{
|
||||||
|
"Name": "Total",
|
||||||
|
"Value": random_value
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# 按 granularity 分组
|
||||||
|
if granularity not in granularity_groups:
|
||||||
|
granularity_groups[granularity] = []
|
||||||
|
|
||||||
|
granularity_groups[granularity].append(kpi)
|
||||||
|
|
||||||
|
# 显示使用的粒度信息
|
||||||
|
granularity_info = ""
|
||||||
|
if current_granularity:
|
||||||
|
granularity_info = f" (当前: {granularity})"
|
||||||
|
else:
|
||||||
|
granularity_info = f" (继承: {granularity})"
|
||||||
|
|
||||||
|
print(f" 添加 KPI: {english_name} = {random_value}{granularity_info}")
|
||||||
|
else:
|
||||||
|
print(f" - 跳过(无英文名称列)")
|
||||||
|
|
||||||
|
# 生成最终的 JSON 结构
|
||||||
|
result = []
|
||||||
|
for granularity, kpis in granularity_groups.items():
|
||||||
|
result.append({
|
||||||
|
"ObjectType": granularity,
|
||||||
|
"KPIs": kpis
|
||||||
|
})
|
||||||
|
|
||||||
|
# 写入文件
|
||||||
|
with open(output_file_path, 'w', encoding='utf-8') as f:
|
||||||
|
json.dump(result, f, indent=4, ensure_ascii=False)
|
||||||
|
|
||||||
|
print(f" 成功生成文件: {output_file_path}")
|
||||||
|
print(f" 处理了 {processed_sheets} 个工作表")
|
||||||
|
print(f" 生成了 {len(granularity_groups)} 个对象类型")
|
||||||
|
for granularity, kpis in granularity_groups.items():
|
||||||
|
print(f" - {granularity}: {len(kpis)} 个 KPI")
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"错误: {str(e)}")
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
|
return False
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("PM JSON 批量生成器")
|
||||||
|
print("=" * 60)
|
||||||
|
|
||||||
|
# 定义要处理的文件列表
|
||||||
|
pm_files = [
|
||||||
|
"AMF-PM(V1.1.5)-Company-Version00.xlsx",
|
||||||
|
"PCF-PM(V1.1.4)-Company-Version00.xlsx",
|
||||||
|
"SMF-PM(V1.2.1)-Company-Version00.xlsx",
|
||||||
|
"UDM-PM(V1.2.2)-Company-Version00.xlsx",
|
||||||
|
"UPF-PM(V1.2.1)-Company-Version00.xlsx"
|
||||||
|
]
|
||||||
|
|
||||||
|
# 也可以自动发现当前目录下的所有 PM Excel 文件
|
||||||
|
# pm_files = glob.glob("*-PM(*)-Company-Version*.xlsx")
|
||||||
|
|
||||||
|
successful_files = 0
|
||||||
|
failed_files = 0
|
||||||
|
|
||||||
|
for excel_file in pm_files:
|
||||||
|
print(f"\n处理文件: {excel_file}")
|
||||||
|
print("-" * 50)
|
||||||
|
|
||||||
|
# 检查文件是否存在
|
||||||
|
if not os.path.exists(excel_file):
|
||||||
|
print(f" 警告:文件 {excel_file} 不存在,跳过")
|
||||||
|
failed_files += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
# 生成输出文件名
|
||||||
|
base_name = os.path.splitext(excel_file)[0]
|
||||||
|
output_file = f"{base_name}-generated.json"
|
||||||
|
|
||||||
|
# 处理文件
|
||||||
|
if generate_pm_json(excel_file, output_file):
|
||||||
|
successful_files += 1
|
||||||
|
else:
|
||||||
|
failed_files += 1
|
||||||
|
|
||||||
|
# 汇总结果
|
||||||
|
print("\n" + "=" * 60)
|
||||||
|
print("批量处理完成!")
|
||||||
|
print(f"成功处理: {successful_files} 个文件")
|
||||||
|
print(f"失败/跳过: {failed_files} 个文件")
|
||||||
|
print(f"总计: {successful_files + failed_files} 个文件")
|
||||||
|
|
||||||
|
if successful_files > 0:
|
||||||
|
print("\n生成的文件列表:")
|
||||||
|
for excel_file in pm_files:
|
||||||
|
if os.path.exists(excel_file):
|
||||||
|
base_name = os.path.splitext(excel_file)[0]
|
||||||
|
output_file = f"{base_name}-generated.json"
|
||||||
|
if os.path.exists(output_file):
|
||||||
|
print(f" - {output_file}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
225
docs/nbi/pm/pm_generator.go
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// KPIValue 表示单个 KPI 值
|
||||||
|
type KPIValue struct {
|
||||||
|
Name string `json:"Name"`
|
||||||
|
Value int `json:"Value"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// KPI 表示单个 KPI 项
|
||||||
|
type KPI struct {
|
||||||
|
KPIID string `json:"KPIID"`
|
||||||
|
KPIValues []KPIValue `json:"KPIValues"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// PMObject 表示性能管理对象
|
||||||
|
type PMObject struct {
|
||||||
|
ObjectType string `json:"ObjectType"`
|
||||||
|
KPIs []KPI `json:"KPIs"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// PMData 表示完整的性能管理数据
|
||||||
|
type PMData []PMObject
|
||||||
|
|
||||||
|
// generateRandomValue 生成 0-16 之间的随机数
|
||||||
|
func generateRandomValue() int {
|
||||||
|
return rand.Intn(17) // 0-16
|
||||||
|
}
|
||||||
|
|
||||||
|
// generatePMDataFromSchema 从 schema 文件生成随机数据
|
||||||
|
func generatePMDataFromSchema(schemaFile string, outputFile string) error {
|
||||||
|
// 读取 schema 文件
|
||||||
|
schemaData, err := os.ReadFile(schemaFile)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("读取 schema 文件失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析 JSON
|
||||||
|
var pmSchema PMData
|
||||||
|
if err := json.Unmarshal(schemaData, &pmSchema); err != nil {
|
||||||
|
return fmt.Errorf("解析 JSON 失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成新的随机数据
|
||||||
|
var newPMData PMData
|
||||||
|
for _, pmObj := range pmSchema {
|
||||||
|
newObj := PMObject{
|
||||||
|
ObjectType: pmObj.ObjectType,
|
||||||
|
KPIs: make([]KPI, len(pmObj.KPIs)),
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, kpi := range pmObj.KPIs {
|
||||||
|
newKPI := KPI{
|
||||||
|
KPIID: kpi.KPIID,
|
||||||
|
KPIValues: make([]KPIValue, len(kpi.KPIValues)),
|
||||||
|
}
|
||||||
|
|
||||||
|
for j, kpiVal := range kpi.KPIValues {
|
||||||
|
newKPI.KPIValues[j] = KPIValue{
|
||||||
|
Name: kpiVal.Name,
|
||||||
|
Value: generateRandomValue(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newObj.KPIs[i] = newKPI
|
||||||
|
}
|
||||||
|
|
||||||
|
newPMData = append(newPMData, newObj)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入新文件
|
||||||
|
outputData, err := json.MarshalIndent(newPMData, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("序列化 JSON 失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.WriteFile(outputFile, outputData, 0644); err != nil {
|
||||||
|
return fmt.Errorf("写入文件失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("成功生成随机数据文件: %s\n", outputFile)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// generatePMDataFromMultipleSchemas 批量处理多个 schema 文件
|
||||||
|
func generatePMDataFromMultipleSchemas(schemaDir string) error {
|
||||||
|
// 查找所有 *-generated.json 文件
|
||||||
|
pattern := filepath.Join(schemaDir, "*-generated.json")
|
||||||
|
schemaFiles, err := filepath.Glob(pattern)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("查找 schema 文件失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(schemaFiles) == 0 {
|
||||||
|
return fmt.Errorf("未找到任何 schema 文件 (pattern: %s)", pattern)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("找到 %d 个 schema 文件\n", len(schemaFiles))
|
||||||
|
|
||||||
|
successCount := 0
|
||||||
|
failCount := 0
|
||||||
|
|
||||||
|
for _, schemaFile := range schemaFiles {
|
||||||
|
// 生成输出文件名:将 "-generated.json" 替换为 "-random.json"
|
||||||
|
outputFile := strings.Replace(schemaFile, "-generated.json", "-random.json", 1)
|
||||||
|
|
||||||
|
fmt.Printf("\n处理文件: %s\n", filepath.Base(schemaFile))
|
||||||
|
fmt.Printf("输出文件: %s\n", filepath.Base(outputFile))
|
||||||
|
|
||||||
|
if err := generatePMDataFromSchema(schemaFile, outputFile); err != nil {
|
||||||
|
fmt.Printf("错误: %v\n", err)
|
||||||
|
failCount++
|
||||||
|
} else {
|
||||||
|
successCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("\n处理完成! 成功: %d, 失败: %d\n", successCount, failCount)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// printPMDataSummary 打印 PM 数据摘要信息
|
||||||
|
func printPMDataSummary(file string) error {
|
||||||
|
data, err := os.ReadFile(file)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var pmData PMData
|
||||||
|
if err := json.Unmarshal(data, &pmData); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("\n文件: %s\n", filepath.Base(file))
|
||||||
|
fmt.Printf("对象类型数量: %d\n", len(pmData))
|
||||||
|
|
||||||
|
totalKPIs := 0
|
||||||
|
for _, obj := range pmData {
|
||||||
|
fmt.Printf(" - %s: %d 个 KPI\n", obj.ObjectType, len(obj.KPIs))
|
||||||
|
totalKPIs += len(obj.KPIs)
|
||||||
|
}
|
||||||
|
fmt.Printf("总 KPI 数量: %d\n", totalKPIs)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 示例用法函数
|
||||||
|
func main() {
|
||||||
|
// 设置随机种子
|
||||||
|
// rand.Seed(time.Now().UnixNano())
|
||||||
|
|
||||||
|
if len(os.Args) < 2 {
|
||||||
|
fmt.Println("用法:")
|
||||||
|
fmt.Println(" go run pm_generator.go <command> [args]")
|
||||||
|
fmt.Println("")
|
||||||
|
fmt.Println("命令:")
|
||||||
|
fmt.Println(" batch <directory> - 批量处理目录下的所有 *-generated.json 文件")
|
||||||
|
fmt.Println(" single <input> <output> - 处理单个文件")
|
||||||
|
fmt.Println(" summary <file> - 显示文件摘要信息")
|
||||||
|
fmt.Println("")
|
||||||
|
fmt.Println("示例:")
|
||||||
|
fmt.Println(" go run pm_generator.go batch .")
|
||||||
|
fmt.Println(" go run pm_generator.go single AMF-PM-generated.json AMF-PM-random.json")
|
||||||
|
fmt.Println(" go run pm_generator.go summary AMF-PM-random.json")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
command := os.Args[1]
|
||||||
|
|
||||||
|
switch command {
|
||||||
|
case "batch":
|
||||||
|
dir := "."
|
||||||
|
if len(os.Args) > 2 {
|
||||||
|
dir = os.Args[2]
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("PM 数据随机生成器 - 批量模式")
|
||||||
|
fmt.Println(strings.Repeat("=", 50))
|
||||||
|
|
||||||
|
if err := generatePMDataFromMultipleSchemas(dir); err != nil {
|
||||||
|
fmt.Printf("错误: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
case "single":
|
||||||
|
if len(os.Args) < 4 {
|
||||||
|
fmt.Println("用法: go run pm_generator.go single <input_file> <output_file>")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
inputFile := os.Args[2]
|
||||||
|
outputFile := os.Args[3]
|
||||||
|
|
||||||
|
fmt.Printf("处理单个文件: %s -> %s\n", inputFile, outputFile)
|
||||||
|
|
||||||
|
if err := generatePMDataFromSchema(inputFile, outputFile); err != nil {
|
||||||
|
fmt.Printf("错误: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
case "summary":
|
||||||
|
if len(os.Args) < 3 {
|
||||||
|
fmt.Println("用法: go run pm_generator.go summary <file>")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
file := os.Args[2]
|
||||||
|
if err := printPMDataSummary(file); err != nil {
|
||||||
|
fmt.Printf("错误: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
fmt.Printf("未知命令: %s\n", command)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
47
docs/nbi/pm/protocol.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# OMC->北向通信协议 基于redis stream消息队列实现
|
||||||
|
|
||||||
|
## 告警关联关系数据上报变更
|
||||||
|
|
||||||
|
alarm_relation告警新增时
|
||||||
|
|
||||||
|
* streamkey和数据格式
|
||||||
|
|
||||||
|
```json
|
||||||
|
alarm_relation
|
||||||
|
{
|
||||||
|
"payload": "{\"ids\":[\"871847\",\"557903\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
1、871847,557903为alarm_relation表主键,至少一个数据
|
||||||
|
|
||||||
|
## 资源数据上报变更
|
||||||
|
|
||||||
|
nbi_cm表新增时
|
||||||
|
|
||||||
|
* streamkey和数据格式
|
||||||
|
|
||||||
|
```json
|
||||||
|
nbi_cm
|
||||||
|
{
|
||||||
|
"payload": "{\"ids\":[\"642470\",\"105633\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
1、642470,105633为nbi_cm表主键ID,ID支持多个
|
||||||
|
|
||||||
|
## 1分钟性能订阅上报数据
|
||||||
|
|
||||||
|
kpi_report_*表新增时
|
||||||
|
|
||||||
|
* 数据格式
|
||||||
|
|
||||||
|
```json
|
||||||
|
nbi_pm
|
||||||
|
{
|
||||||
|
"payload": "{\"neType\":\"AMF\",\"id\":\"606538\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
1、AMF、PCF等为具体对应的网元
|
||||||
|
2、606538为kpi_report_amf、kpi_report_pcf等表主键ID,ID支持一个
|
||||||
66
docs/reference/gen-rand-cdr.sql
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
-- 1. 建辅助数字表
|
||||||
|
DROP TABLE IF EXISTS tmp_num_100;
|
||||||
|
CREATE TABLE tmp_num_100 (n TINYINT UNSIGNED PRIMARY KEY);
|
||||||
|
INSERT INTO tmp_num_100(n)
|
||||||
|
SELECT a.n + b.n AS n FROM (
|
||||||
|
SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4
|
||||||
|
UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9
|
||||||
|
) a
|
||||||
|
CROSS JOIN (
|
||||||
|
SELECT 0 n UNION ALL SELECT 10 UNION ALL SELECT 20 UNION ALL SELECT 30 UNION ALL SELECT 40
|
||||||
|
UNION ALL SELECT 50 UNION ALL SELECT 60 UNION ALL SELECT 70 UNION ALL SELECT 80 UNION ALL SELECT 90
|
||||||
|
) b
|
||||||
|
ORDER BY a.n + b.n;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tmp_num_500;
|
||||||
|
CREATE TABLE tmp_num_500 (n SMALLINT UNSIGNED PRIMARY KEY);
|
||||||
|
INSERT INTO tmp_num_500(n)
|
||||||
|
SELECT t.n FROM (
|
||||||
|
SELECT @r:=@r+1 n
|
||||||
|
FROM (SELECT 0 FROM tmp_num_100) a,
|
||||||
|
(SELECT 0 FROM tmp_num_100) b,
|
||||||
|
(SELECT @r:=-1) init
|
||||||
|
LIMIT 500
|
||||||
|
) t;
|
||||||
|
|
||||||
|
-- 2. 目标表(若未建)
|
||||||
|
-- CREATE TABLE cdr_event_smsc (
|
||||||
|
-- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
-- ne_type VARCHAR(16),
|
||||||
|
-- ne_name VARCHAR(64),
|
||||||
|
-- rm_uid VARCHAR(64),
|
||||||
|
-- `timestamp` BIGINT,
|
||||||
|
-- cdr_json JSON,
|
||||||
|
-- created_at DATETIME,
|
||||||
|
-- tenant_id VARCHAR(64)
|
||||||
|
-- ) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
-- 3. 关闭一些约束提高插入速度(可选)
|
||||||
|
SET autocommit = 0;
|
||||||
|
SET unique_checks = 0;
|
||||||
|
SET foreign_key_checks = 0;
|
||||||
|
|
||||||
|
-- 4. 插入 500 万(100 * 100 * 500)
|
||||||
|
-- 随机时间:过去一年内的任意秒(不均匀)
|
||||||
|
SET @start_ts = UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 365 DAY));
|
||||||
|
SET @range_sec = 365 * 24 * 3600;
|
||||||
|
|
||||||
|
INSERT INTO cdr_event_smsc
|
||||||
|
(ne_type, ne_name, rm_uid, `timestamp`, cdr_json, created_at)
|
||||||
|
SELECT
|
||||||
|
'SMSC' AS ne_type,
|
||||||
|
'SMSC_001' AS ne_name,
|
||||||
|
'4400HXSMSC001' AS rm_uid,
|
||||||
|
@start_ts + FLOOR(RAND()*@range_sec) AS `timestamp`,
|
||||||
|
'{\"calledParty\":\"15731123455\",\"callerParty\":\"18165338055\",\"cause\":28,\"recordType\":\"MTSM\",\"result\":0,\"serviceType\":\"Normal\",\"updateTime\":\"2025-08-18T11:09:52.703Z\"}' AS cdr_json,
|
||||||
|
NOW() AS created_at
|
||||||
|
FROM tmp_num_100 a
|
||||||
|
CROSS JOIN tmp_num_100 b
|
||||||
|
CROSS JOIN tmp_num_500 c;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
-- 5. 恢复
|
||||||
|
SET unique_checks = 1;
|
||||||
|
SET foreign_key_checks = 1;
|
||||||
|
SET autocommit = 1;
|
||||||
@@ -67,10 +67,10 @@ sed -i "s/FREETYPE2_CONFIG --libs/FREETYPE2_CONFIG freetype2 --cflags/g" ./confi
|
|||||||
|
|
||||||
|
|
||||||
# 导入参数配置文件
|
# 导入参数配置文件
|
||||||
D:\local.git\ems.agt\tools\loadpconf> go run .\loadpconf.go .\load.go .\db.go -p ..\..\config\param\udm_param_config.yaml
|
D:\omc.git\ems.agt\tools\loadpconf> go run .\loadpconf.go .\load.go .\db.go -p ..\..\config\param\udm_param_config.yaml
|
||||||
# 导入mml配置文件
|
# 导入mml配置文件
|
||||||
# 需配置load
|
# 需配置load
|
||||||
D:\local.git\ems.agt\tools\loadmconf> go run .\loadmconf.go .\load.go .\db.go -m ..\..\config\mml\system\mme_sys_mml_config.yaml
|
D:\omc.git\ems.agt\tools\loadmconf> go run .\loadmconf.go .\load.go .\db.go -m ..\..\config\mml\system\mme_sys_mml_config.yaml
|
||||||
|
|
||||||
# ssh信任关系绑定出错时,执行
|
# ssh信任关系绑定出错时,执行
|
||||||
ssh-keygen -f "/root/.ssh/known_hosts" -R "20.15.0.190"
|
ssh-keygen -f "/root/.ssh/known_hosts" -R "20.15.0.190"
|
||||||
|
|||||||
6
package-lock.json
generated
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "build.ems",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
@@ -6,9 +6,10 @@
|
|||||||
%define project_lname omc
|
%define project_lname omc
|
||||||
%define project_Uname OMC
|
%define project_Uname OMC
|
||||||
|
|
||||||
|
|
||||||
Name: %{project_lname}
|
Name: %{project_lname}
|
||||||
Summary: 5GC OMC
|
Summary: 5GC OMC
|
||||||
Version: 2.2409.4
|
Version: 2.2508.2
|
||||||
Release: %{release_date}
|
Release: %{release_date}
|
||||||
Vendor: omc
|
Vendor: omc
|
||||||
URL: https://www.omc.com/
|
URL: https://www.omc.com/
|
||||||
@@ -28,33 +29,40 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/local/bin/*
|
|||||||
chmod +x ${RPM_BUILD_ROOT}/usr/local/omc/htdocs/front
|
chmod +x ${RPM_BUILD_ROOT}/usr/local/omc/htdocs/front
|
||||||
chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
|
chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
|
||||||
|
|
||||||
|
# 安装前执行
|
||||||
|
%pre
|
||||||
|
echo -n "Stopping OMC service ... "
|
||||||
|
systemctl stop restagent.service
|
||||||
|
systemctl stop sshsvc.service
|
||||||
|
echo "done"
|
||||||
|
|
||||||
# 安装完成后执行
|
# 安装完成后执行
|
||||||
%post
|
%post
|
||||||
OMCRootDir=/usr/local/omc
|
OMCRootDir=/usr/local/omc
|
||||||
OMCEtcDir=${OMCRootDir}/etc
|
OMCEtcDir=${OMCRootDir}/etc
|
||||||
FERootDir=${OMCRootDir}/htdocs/front
|
FERootDir=${OMCRootDir}/htdocs/front
|
||||||
UsrLib64Dir=/usr/lib64
|
|
||||||
OMCBinDir=${OMCRootDir}/bin
|
OMCBinDir=${OMCRootDir}/bin
|
||||||
OMCStaticDir=${OMCRootDir}/static
|
OMCStaticDir=${OMCRootDir}/static
|
||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
OMCDaemon=omcd
|
OMCDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
|
CFileList=$(ls ${OMCEtcDir}/default)
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
echo -n "Stopping OMC service ... "
|
# echo -n "Stopping OMC service ... "
|
||||||
systemctl stop restagent.service
|
# systemctl stop restagent.service
|
||||||
systemctl stop crontask.service
|
# systemctl stop sshsvc.service
|
||||||
systemctl stop sshsvc.service
|
# echo "done"
|
||||||
systemctl stop captrace.service
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
for CFile in ${CFileList}; do
|
for CFile in ${CFileList}; do
|
||||||
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
||||||
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
else
|
#else
|
||||||
mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
|
||||||
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
||||||
|
#if [ -e "${OMCBinDir}/upgconf.sh" ]; then
|
||||||
|
# ${OMCBinDir}/upgconf.sh
|
||||||
|
#fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -67,28 +75,24 @@ done
|
|||||||
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
|
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
|
||||||
mkdir -p /opt/omc/ftp
|
mkdir -p /opt/omc/ftp
|
||||||
mkdir -p /opt/omc/ftp/log
|
mkdir -p /opt/omc/ftp/log
|
||||||
cd ${UsrLib64Dir}
|
|
||||||
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
|
if [ ! -e ${UsrLocalBinDir}/${OMCDaemon} ]; then
|
||||||
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
|
echo -n "Creating symbolic link ${UsrLocalBinDir}/${OMCDaemon} ... "
|
||||||
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
|
ln -s ${OMCBinDir}/omcsvc.sh ${UsrLocalBinDir}/${OMCDaemon};
|
||||||
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
|
echo "done"
|
||||||
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
|
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
|
|
||||||
|
|
||||||
# setting firewall
|
# setting firewall
|
||||||
PortList="80 443 44080 44443 33030 22222"
|
port_list="80 443 44080 44443 33030 33443 33066 6379 22222"
|
||||||
for Port in ${PortList}; do
|
for Port in ${port_list}; do
|
||||||
|
echo -n "firewall-cmd add port ${Port} ... "
|
||||||
firewall-cmd --zone=public --add-port=${Port}/tcp --permanent
|
firewall-cmd --zone=public --add-port=${Port}/tcp --permanent
|
||||||
done
|
done
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable restagent.service
|
systemctl enable restagent.service
|
||||||
systemctl enable crontask.service
|
|
||||||
systemctl enable sshsvc.service
|
systemctl enable sshsvc.service
|
||||||
systemctl enable captrace.service
|
|
||||||
|
|
||||||
# read environment parameter and to do
|
# read environment parameter and to do
|
||||||
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
||||||
@@ -106,55 +110,40 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Starting OMC service ... "
|
# echo -n "Starting OMC service ... "
|
||||||
systemctl start captrace.service
|
# systemctl start sshsvc.service
|
||||||
systemctl start sshsvc.service
|
# systemctl start restagent.service
|
||||||
systemctl start crontask.service
|
# echo "done"
|
||||||
systemctl start restagent.service
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
# 卸载时执行
|
# 卸载时执行
|
||||||
%postun
|
%postun
|
||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
UsrLib64Dir=/usr/lib64
|
OMCDaemon=omcd
|
||||||
cd ${UsrLib64Dir}
|
|
||||||
rm libwireshark.so.15
|
|
||||||
rm libwireshark.so
|
|
||||||
rm libwiretap.so.12
|
|
||||||
rm libwiretap.so
|
|
||||||
rm libwsutil.so.13
|
|
||||||
rm libwsutil.so
|
|
||||||
rm -f ${UsrLocalBinDir}/omcd
|
|
||||||
|
|
||||||
# setting firewall
|
|
||||||
PortList="80 443 44080 44443 33030 22222"
|
|
||||||
for Port in ${PortList}; do
|
|
||||||
firewall-cmd --zone=public --remove-port=${Port}/tcp --permanent
|
|
||||||
done
|
|
||||||
firewall-cmd --reload
|
|
||||||
|
|
||||||
if [ "$1" = "0" ] ; then
|
if [ "$1" = "0" ] ; then
|
||||||
sudo systemctl stop restagent.service
|
sudo systemctl stop restagent.service
|
||||||
sudo systemctl stop crontask.service
|
|
||||||
sudo systemctl stop sshsvc.service
|
sudo systemctl stop sshsvc.service
|
||||||
sudo systemctl stop captrace.service
|
|
||||||
#rm -rf /usr/local/omc
|
#rm -rf /usr/local/omc
|
||||||
rm -rf /etc/nginx/conf.d/omc.conf
|
rm -rf /etc/nginx/conf.d/omc.conf
|
||||||
sudo systemctl disable restagent.service
|
sudo systemctl disable restagent.service
|
||||||
sudo systemctl disable crontask.service
|
|
||||||
sudo systemctl disable sshsvc.service
|
sudo systemctl disable sshsvc.service
|
||||||
sudo systemctl disable captrace.service
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
|
# setting firewall
|
||||||
|
port_list="80 443 44080 44443 33030 33443 33066 6379 22222"
|
||||||
|
for Port in ${port_list}; do
|
||||||
|
echo -n "firewall-cmd remove port ${Port} ... "
|
||||||
|
firewall-cmd --zone=public --remove-port=${Port}/tcp --permanent
|
||||||
|
done
|
||||||
|
firewall-cmd --reload
|
||||||
|
rm -f ${UsrLocalBinDir}/${OMCDaemon}
|
||||||
else
|
else
|
||||||
|
echo -n "Starting OMC service ... "
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl stop restagent.service
|
sudo systemctl stop restagent.service
|
||||||
sudo systemctl stop crontask.service
|
|
||||||
sudo systemctl stop sshsvc.service
|
sudo systemctl stop sshsvc.service
|
||||||
sudo systemctl stop captrace.service
|
|
||||||
sudo systemctl start crontask.service
|
|
||||||
sudo systemctl start sshsvc.service
|
sudo systemctl start sshsvc.service
|
||||||
sudo systemctl start captrace.service
|
|
||||||
sudo systemctl start restagent.service
|
sudo systemctl start restagent.service
|
||||||
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 规定那些文件必须放入安装程序中,如果没有就报错
|
# 规定那些文件必须放入安装程序中,如果没有就报错
|
||||||
@@ -176,11 +165,7 @@ fi
|
|||||||
/usr/local/omc/static
|
/usr/local/omc/static
|
||||||
#/etc/nginx/conf.d/omc.conf
|
#/etc/nginx/conf.d/omc.conf
|
||||||
/lib/systemd/system/restagent.service
|
/lib/systemd/system/restagent.service
|
||||||
/lib/systemd/system/crontask.service
|
|
||||||
/lib/systemd/system/sshsvc.service
|
/lib/systemd/system/sshsvc.service
|
||||||
/lib/systemd/system/captrace.service
|
|
||||||
/usr/lib64/libwireshark.so.15.0.12
|
|
||||||
/usr/lib64/libwiretap.so.12.0.12
|
|
||||||
/usr/lib64/libwsutil.so.13.1.0
|
|
||||||
/usr/local/bin/tshark
|
|
||||||
|
|
||||||
|
|||||||