1
0

77 Commits

Author SHA1 Message Date
zhangsz
d2d6e4792c chore: control update 2025-08-08 11:53:21 +08:00
zhangsz
60f5d5331b chore: package name change 2025-08-08 11:15:03 +08:00
zhangsz
ea9b35e6b0 chore: release 1.2508.1 2025-08-08 10:41:58 +08:00
zhangsz
caacd242a8 fix: control version date 2025-07-22 15:27:21 +08:00
zhangsz
e402a5cc2b feat: msd data example 2025-07-11 19:11:01 +08:00
zhangsz
f4230d1809 release 1.2506.2 2025-07-08 17:19:19 +08:00
zhangsz
1ba62fb7c1 fix: add psap.yaml default config file 2025-07-02 17:44:08 +08:00
zhangsz
f2ac091e62 fix: ... 2025-07-02 17:35:12 +08:00
zhangsz
b73aff3a91 fix: build 2025-06-21 12:06:44 +08:00
zhangsz
e594a5f19a fix: build shell 2025-06-21 12:06:27 +08:00
zhangsz
9bf9ac6479 release 1.2506.2 2025-06-20 19:11:50 +08:00
zhangsz
ff0f52efac fix: ... 2025-06-17 09:57:45 +08:00
zhangsz
b758a21bab fix: ... 2025-06-16 16:52:38 +08:00
zhangsz
aa974c21dc fix: ... 2025-06-16 16:50:33 +08:00
zhangsz
6affa5f93e fix: ... 2025-06-16 16:33:15 +08:00
zhangsz
1b531f3556 fix: changed omcd to psapd 2025-06-16 16:22:18 +08:00
zhangsz
4ebbbbf1f3 fix: change OMC to PSAP 2025-06-16 14:17:59 +08:00
zhangsz
f0688a4273 db name changed 2025-06-16 14:10:05 +08:00
zhangsz
e3319048ea release r1.2506.1 2025-06-16 11:42:56 +08:00
zhangsz
0f90394faa feat: ... 2025-06-16 11:41:54 +08:00
zhangsz
79c5378bc3 fix: icon update 2025-05-17 18:02:43 +08:00
zhangsz
e1cc70a0b8 for psap 2025-04-23 17:27:49 +08:00
zhangsz
1d29e002f3 fix: ... 2025-04-15 15:14:09 +08:00
zhangsz
fdcf8be579 feat: psap r1.2504.1 2025-04-15 12:04:21 +08:00
zhangsz
e2ee082cb8 fix:... 2025-04-15 11:48:09 +08:00
zhangsz
150d7aadbc feat: psap portal 2025-04-15 11:42:08 +08:00
zhangsz
4215a73c8c feat: psap portal 2025-04-15 11:33:33 +08:00
zhangsz
e1f4eb6267 feat: psap init 2025-04-14 16:05:39 +08:00
TsMask
17591b1705 chore: 更新版本号 2.2503.5 2025-04-12 10:11:01 +08:00
TsMask
5d9425c457 chore: 更新版本号 2.2503.4 2025-03-31 20:06:01 +08:00
TsMask
d8624c2fe9 chore: 更新版本号 2.2503.3 2025-03-21 15:36:13 +08:00
TsMask
cb8692cf44 chore: 更新版本号 2.2503.2 2025-03-14 11:04:59 +08:00
TsMask
cc45dd1be3 chore: 更新版本号 2.2503.1 2025-03-08 11:11:18 +08:00
TsMask
56d62831eb fix: badeb 中文字符串替换 2025-03-04 18:09:37 +08:00
TsMask
246fb027cd fix: badeb 中文字符串替换 2025-03-04 16:13:51 +08:00
TsMask
7818759109 chore: 更新版本号 2.2502.4 2025-02-28 19:56:37 +08:00
TsMask
48d5a0a783 feat: 添加kylin|anolis打包rpm 2025-02-24 16:36:32 +08:00
TsMask
e42d35c5e0 chore: 更新版本号 2.2502.3 2025-02-21 21:11:29 +08:00
zhangsz
667f6b1987 fix: ... 2025-02-21 19:39:40 +08:00
zhangsz
6adf76b589 fix: build arm /amd 2025-02-21 19:38:51 +08:00
zhangsz
49f0ba4a7a fix: ... 2025-02-20 21:20:04 +08:00
zhangsz
27826e4523 fix: ... 2025-02-20 21:16:25 +08:00
zhangsz
1316629dc8 fix:... 2025-02-20 21:06:47 +08:00
zhangsz
82a0d32f15 fix: git ignore 2025-02-20 20:42:35 +08:00
zhangsz
83ce21d2c3 fix: ... 2025-02-20 20:39:35 +08:00
zhangsz
1efc851b39 fix: support openEuler build 2025-02-20 19:50:18 +08:00
TsMask
d9c16a616c chore: 更新版本号 2.2502.2 2025-02-14 19:41:46 +08:00
TsMask
a2800bed0d chore: 更新版本号 2.2502.1 2025-02-08 19:47:04 +08:00
TsMask
cf97351fc9 chore: 更新版本号 2.2501.4 2025-01-24 20:42:17 +08:00
TsMask
251284aa38 chore: 更新版本号 2.2501.3 2025-01-17 18:43:50 +08:00
TsMask
1fe4eddd33 del: 移除程序打包service错误 2025-01-11 11:37:40 +08:00
TsMask
6211a88f2e del: 移除captrace/data2html/crontask程序 2025-01-11 10:17:20 +08:00
TsMask
b73cd05af8 chore: 更新版本号 2.2501.2 2025-01-10 19:41:54 +08:00
TsMask
16d20fcad4 chore: 更新版本号 2.2501.1 2025-01-03 21:51:22 +08:00
TsMask
9f1a097e2a chore: 更新版本号 2.2412.4 2024-12-28 10:56:29 +08:00
TsMask
cfa0825e22 chore: 更新版本号 2.2412.3 2024-12-20 18:55:56 +08:00
TsMask
5bc958e911 chore: 更新版本号 2.2412.2 2024-12-13 21:23:58 +08:00
TsMask
e636f76506 chore: 更新版本号 2.2412.1 2024-12-09 09:58:32 +08:00
TsMask
1ca15477ca chore: 更新版本号 2.2411.4 2024-11-30 17:14:23 +08:00
TsMask
7ce96a7178 chore: 更新版本号 2.2411.3 2024-11-23 16:38:37 +08:00
TsMask
639107ba3d chore: 更新版本号 2.2411.2 2024-11-15 18:17:41 +08:00
dd0d67c0ea update spec for ky10 arm build 2024-11-12 09:24:50 +08:00
343e32735d update spec for build 2024-11-08 19:39:40 +08:00
37477ad9f1 update spec for build 2024-11-08 19:25:56 +08:00
1fb64561c4 update spec for build 2024-11-08 19:15:39 +08:00
abb2a8a33d update spec for build 2024-11-08 19:11:31 +08:00
TsMask
1dc143c062 chore: 更新版本号 2.2411.1 2024-11-08 17:56:57 +08:00
ff7973194f update makepkg.sh 2024-11-07 16:40:44 +08:00
c9277f1123 shell to sed fe src/hooks 2024-11-07 15:16:15 +08:00
b8c1740875 update make package shell 2024-11-07 14:57:42 +08:00
121cbea72e update make package sh 2024-11-07 14:46:21 +08:00
3e08ef0cc4 update build package shell script 2024-11-07 14:37:00 +08:00
38dabd180d support customized images and locales for FE 2024-11-07 11:47:18 +08:00
cd6578f57c update npm install --force 2024-11-05 18:02:49 +08:00
TsMask
f403456185 chore: 更新版本号 2.2410.4 2024-11-02 15:35:36 +08:00
dbded5635f update git ignore list 2024-11-01 17:29:25 +08:00
44fad7ae82 Optimize the packaging process 2024-11-01 17:24:37 +08:00
47 changed files with 1347 additions and 880 deletions

30
.gitignore vendored
View File

@@ -12,26 +12,20 @@
# Run temp file and dir
docs/temp/
# Built Visual Studio Code Extensions
*.vsix
*.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
build/usr/local/omc/bin/captrace
build/usr/local/omc/bin/crontask
build/usr/local/omc/bin/data2html
build/usr/local/omc/bin/restagent
build/usr/local/omc/bin/sshsvc
debbuild/22.04/usr/local/omc/bin/captrace
debbuild/22.04/usr/local/omc/bin/crontask
debbuild/22.04/usr/local/omc/bin/data2html
debbuild/22.04/usr/local/omc/bin/restagent
debbuild/22.04/usr/local/omc/bin/sshsvc
# release package
build/usr/local/omc/htdocs
debbuild/22.04/usr/local/omc/htdocs
debbuild/usr/local/omc/htdocs
build/
debbuild/
release/

View File

@@ -1,14 +1,17 @@
#!/bin/bash
usage() {
echo "Usage: $0 [OPTION] deb|badeb|rpm"
echo "Usage: $0 [OPTION] deb|badeb|rpm|psapdeb"
echo
echo "Build omc package, option as follow:"
echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg"
echo " badeb: ubuntu|debian package build by dpkg"
echo " rpm: centos/redhat package, build by rpmbuild"
echo " psapdeb psap package, build by dpkg"
echo
echo " -r, =build root directory build root directory, default directory is $HOME/omc.git"
echo " -d dump SQL from database"
echo " -h, --help display this help and exit"
echo
}
@@ -16,7 +19,7 @@ pkgtype=""
new_args=()
# Traverse all parameters
for arg in "$@"; do
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" ]]; then
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" || "$arg" == "psapdeb" ]]; then
pkgtype=$arg
else
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
@@ -31,7 +34,7 @@ fi
# Use a new parameter list
set -- "${new_args[@]}"
GitLocalRoot=${HOME}/omc.git
GitLocalRoot=${HOME}/${ProjectL}.git
while getopts "r:d" option; do
case $option in
r)
@@ -56,7 +59,7 @@ fi
ProjectL=omc
ProjectU=OMC
PROJECT=${ProjectL}
VERSION=2.2410.3
VERSION=1.2508.1
RelDate=`date +%Y%m%d`
RelVer=${VERSION}-${RelDate}
Ky10Arch=ky10.aarch64
@@ -66,9 +69,10 @@ DebPkgName=${ProjectL}-r${RelVer}-ub*.deb
EmsBEDir=${GitLocalRoot}/be.ems
EmsBuildRoot=${GitLocalRoot}/build.ems
RpmArch=`arch`
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS/
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS
ReleaseDir=${EmsBuildRoot}/release
DumpToolDir=${EmsBEDir}/tools/misc
ProjectTag=""
BuildDir=${EmsBuildRoot}/build
CustomizedDir=${EmsBuildRoot}/customized
@@ -79,12 +83,13 @@ BuildLibDir=${BuildDir}/lib
BuildLibSystemDir=${BuildLibDir}/systemd/system
DebBuildDir=${EmsBuildRoot}/debbuild
DebBuildOMCDir=${EmsBuildRoot}/debbuild/usr/local/omc
DebFEBuildDir=${EmsBuildRoot}/debbuild/usr/local/omc/htdocs
DebFEBuildDir=${DebBuildOMCDir}/htdocs
DebBuild2204Dir=${EmsBuildRoot}/debbuild/22.04
DebBuild2204OMCDir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc
DebFEBuild2204Dir=${EmsBuildRoot}/debbuild/22.04/usr/local/omc/htdocs
DebFEBuild2204Dir=${DebBuild2204OMCDir}/htdocs
RpmBuildDir=${EmsBuildRoot}/rpmbuild
RpmFEBuildDir=${RpmBuildDir}/BUILD/usr/local/omc/htdocs
RpmBuildOMCDir=${RpmBuildDir}/BUILD/usr/local/omc
RpmFEBuildDir=${RpmBuildOMCDir}/htdocs
OmcInstallDir=/usr/local/omc
ConfigEtcDir=${EmsBEDir}/config/etc
ConfigSystemdDir=${EmsBEDir}/config/systemd
@@ -92,36 +97,92 @@ EmsFEDir=${GitLocalRoot}/fe.ems
EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist
LibDir=${EmsBEDir}/lib
RESTAGENT=restagent
CRONTASK=crontask
SshSvcBin=sshsvc
CapTraceBin=captrace
Data2htmlBin=data2html
NBI_ALARM=nbi_alarm
NBI_AGENT=nbi_agent
AAAA_AGENT=4a_agent
RestagentDir=${EmsBEDir}/${RESTAGENT}
CrontaskDir=${EmsBEDir}/${CRONTASK}
SshSvcDir=${EmsBEDir}/${SshSvcBin}
CapTraceDir=${EmsBEDir}/${CapTraceBin}
Data2htmlDir=${EmsBEDir}/${Data2htmlBin}
DBSQLSrcDir=${EmsBEDir}/database
MiscDir=${EmsBEDir}/misc
FrontBuildDir=${BuildOMCDir}/htdocs
FrontSrcDir=${EmsBEDir}/front
CrontaskSize=27788951
RestagentSize=29525312
BinWriterDir=${HOME}/bin
if [[ ${RpmArch} =~ "x86_64" ]];then
# Get the output of uname -a
UnameOutput=$(uname -a)
# Extract hardware architecture
if [[ $UnameOutput =~ "x86_64" ]]; then
RelArch=amd64
elif [[ ${RpmArch} =~ "aarch64" ]];then
RpmArch=x86_64
elif [[ $UnameOutput =~ "aarch64" ]]; then
RelArch=arm64
RpmArch=aarch64
else
echo "Unsupported hardware architecture"
exit 1
fi
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
RelOS=oe20
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
rpm)
echo "Begin to make ${pkgtype} package ======>"
ReleasePkgDir=${ReleaseDir}/rpms/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
ProcList="restagent sshsvc"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
@@ -137,24 +198,15 @@ case "${pkgtype}" in
rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${RESTAGENT} ${RestagentSize}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${CRONTASK} ${CrontaskSize}
# cp -rf ${MiscDir}/ne-hosts ${BuildOMCBinDir}
# cp -rf ./nbi/${NBI_ALARM}/bin/${NBI_ALARM} ${BinDir2}
# cp -rf ./nbi/${NBI_AGENT}/bin/${NBI_AGENT} ${BinDir2}
# cp -rf ./${4A_AGENT}/bin/${4A_AGENT} ${BinDir2}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
# rm -rf ${BinDir2}/ne-hosts
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
#Get SQL from database, overwrite from git
if [ "$dumpdb" = "yes" ]; then
cd ${DumpToolDir}
@@ -166,22 +218,23 @@ case "${pkgtype}" in
mkdir -p ${FrontBuildDir}/front
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
chmod 755 ${BuildOMCBinDir}/*
# chmod 755 ${BinDir2}/*
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
#cp -rf ${BuildDir}/nginx ${RpmBuildDir}/BUILD/etc/
#cp -rf ${BuildDir}/systemd ${RpmBuildDir}/BUILD/lib/
cp -rf ${CustomizedDir}/agt.d ${RpmBuildOMCDir}/static
cp -rf ${CustomizedDir}/psap.d ${RpmBuildOMCDir}/static
cd ${RpmBuildDir}
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
rm -f ${ProjectL}-md5sum.txt
# rpm --addsign *.rpm
md5sum $RpmPkgRename >omc-md5sum.txt
md5sum $RpmPkgRename >${ProjectL}-md5sum.txt
echo "Finish to make ${pkgtype} package <======"
;;
deb)
echo "Begin to make ${pkgtype} package ======>"
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
ProcList="restagent sshsvc"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
@@ -189,19 +242,10 @@ case "${pkgtype}" in
make
done
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22.deb
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18.deb
else
echo "Invalid OS release: ${VersionID}"
exit 1
fi
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-${ProjectTag}.${ptype}
fi
cd ${EmsBEDir}
@@ -213,17 +257,14 @@ case "${pkgtype}" in
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
@@ -238,22 +279,25 @@ case "${pkgtype}" in
chmod 755 ${DebBuildDir}/DEBIAN/postrm
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/agt.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/omc.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/psap.d ${DebBuildOMCDir}/static
#cp -rf ${BuildDir}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
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
# 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 crontask sshsvc captrace data2html"
ProcList="restagent sshsvc"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
@@ -261,19 +305,7 @@ case "${pkgtype}" in
make
done
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22-ba.deb
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18-ba.deb
else
echo "Invalid OS release: ${VersionID}"
exit 1
fi
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-ba.deb
cd ${EmsBEDir}
@@ -285,17 +317,15 @@ case "${pkgtype}" in
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
@@ -311,16 +341,80 @@ case "${pkgtype}" in
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' {} +
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
md5sum ${DebPkgName} >omc-md5sum.txt
echo "Finish to make ${pkgtype} package <======"
;;
psapdeb)
ProjectL="omc"
ProjectU="OMC"
ProjectTag="psap"
echo "Begin to make ${pkgtype} package ======>"
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-${ProjectTag}.${ptype}
fi
cd ${EmsBEDir}
#make deb
# clear build cache
rm -rf ${FrontBuildDir}/front/*
rm -rf ${DebFEBuildDir}/front/*
rm -rf ${DebBuildDir}/usr/local/omc/etc/db/*
rm -rf ${DebBuildOMCDir}/static/*
for procName in $ProcList;do
cd $EmsBEDir/$procName
cp -rf ${procName} ${BuildOMCBinDir}
done
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
cp -rf ${ConfigSystemdDir}/* ${BuildLibSystemDir}
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
chmod 755 ${BuildOMCBinDir}/*
chmod 755 ${DebBuildDir}/DEBIAN/preinst
chmod 755 ${DebBuildDir}/DEBIAN/postinst
chmod 755 ${DebBuildDir}/DEBIAN/postrm
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/agt.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/psap.d ${DebBuildOMCDir}/static
#cp -rf ${BuildDir}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
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

View File

@@ -11,11 +11,19 @@ usage() {
echo " -m, =be|fe|all be: only process back-end code, default if non input"
echo " fe: only process front-end code"
echo " all: process all include be and fe"
echo " -c, =ba|psap ba: customized for BA OMC, psap: customized for PSAP Portal"
}
pkgtype=""
new_args=()
be_args=()
handle_invalid_option() {
echo "Invalid option: -$1" >&2
usage
exit 2
}
# Traverse all parameters
for arg in "$@"; do
if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then
@@ -34,7 +42,7 @@ fi
# Use a new parameter list
set -- "${new_args[@]}"
rootdir=${HOME}/omc.git
rootdir=${HOME}/psap.git
m_arg="*"
while getopts "m:r:c:d" option; do
case $option in
@@ -49,13 +57,19 @@ while getopts "m:r:c:d" option; do
be_args+=("-d")
;;
c)
pkgtype="badeb"
be_args+=("$pkgtype")
c_arg=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
if [ "${c_arg}" == "ba" ]; then
pkgtype="badeb"
be_args+=("${pkgtype}")
elif [ "${c_arg}" == "psap" ]; then
pkgtype="psapdeb"
be_args+=("${pkgtype}")
else
handle_invalid_option "$OPTARG"
fi
;;
\?)
echo "Invalid option: -$OPTARG" >&2
usage
exit 2
handle_invalid_option "$OPTARG"
;;
esac
done
@@ -66,36 +80,66 @@ if [ ! -d ${rootdir} ]; then
fi
bedir=${rootdir}/be.ems
fedir=${rootdir}/fe.ems.vue3
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() {
cd ${fedir}
git checkout ${feassetsdir}
git checkout ${felocalesdir}
git checkout ${feconstantsdir}
git checkout ${fehooksdir}
git pull
npm install --registry https://registry.npmmirror.com
if [ "${pkgtype}" == "badeb" ]; then
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() {
cd ${builddir}
cd ${builddir}/bin
#chmod +x mkpkg.sh
chmod +x build.sh
./build.sh ${be_args[@]}
}
post_makepkg() {
cd ${builddir}
git checkout debbuild/DEBIAN/
git checkout debbuild/22.04/DEBIAN/
}
case "${m_arg}" in
fe)
makefe
;;
all)
makefe
makebe
makebe
post_makepkg
;;
be | *)
makebe
makebe
post_makepkg
;;
esac

View File

@@ -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: warn
duration: 24
count: 90
omc:
name: OMC01
hosturi: http://127.0.0.1:33030
hostno: A001
province: ""
netabbr: HX
vendor: ""
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
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
# northbound interface, cm/pm
# duration(day): saved days
# zipPeriods(day): periods of zip pm data file
nbi:
cm:
cfgfiledir: /usr/local/omc/etc/cm
xmlfiledir: /opt/omc/ftp
version: V1.0.1
duration: 30
pm:
cfgfiledir: /usr/local/omc/etc/pm
xmlfiledir: /opt/omc/ftp
version: V1.0.1
duration: 30
zipPeriods: 1

View File

@@ -1,193 +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: warn
duration: 24
count: 90
# rest agent listen ipv4/v6 and port, support multiple routines
# ip: 0.0.0.0 or ::0, support IPv4/v6
# clientAuthType: 0:NoClientCert (default), 1:RequestClientCert, 2:RequireAnyClientCert,
# 3:VerifyClientCertIfGiven, 4:RequireAndVerifyClientCerts
rest:
- ipv4: 0.0.0.0
ipv6:
port: 33030
- ipv4: 0.0.0.0
ipv6:
port: 33443
schema: https
clientAuthType: 0
caFile: /usr/local/omc/etc/certs/omc-ca.crt
certFile: /usr/local/omc/etc/certs/omc-server.crt
keyFile: /usr/local/omc/etc/certs/omc-server.key
webServer:
enabled: true
rootDir: /usr/local/omc/htdocs/front
listen:
- addr: :80
schema: http
- addr: :443
schema: https
clientAuthType: 0
caFile: /usr/local/omc/etc/certs/omc-ca.crt
certFile: /usr/local/omc/etc/certs/omc-server.crt
keyFile: /usr/local/omc/etc/certs/omc-server.key
database:
type: mysql
user: root
password: 1000omc@kp!
host: 127.0.0.1
port: 33066
name: omc_db
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
backup: /usr/local/omc/database
# Redis data cache
redis:
dataSource:
# OMC system db
default:
port: 6379 # Redis port
host: "127.0.0.1" # Redis host
password: "helloearth"
db: 10 # Redis db_num
# UDM sub/auth db
udmuser:
port: 6379 # Redis port
host: "127.0.0.1"
password: "helloearth"
db: 0 # Redis db_num
# used to specify the default data source for multiple data resourece
defaultDataSourceName: "default"
# sleep: time delay for after write buffer (millisecond)
# deadLine: timeout for io read and write (second)
mml:
sleep: 200
deadLine: 10
sizeRow: 600
sizeCol: 128
bufferSize: 65535
mmlHome: ./mmlhome
# Tracking configuration
trace:
enabled: true
host: "172.16.5.100" # Fill in the specific IP address
port: 33033
# NE config
ne:
user: omcuser
etcdir: /usr/local/etc
bindir: /usr/local/bin
omcdir: /usr/local/omc
scpdir: /tmp
licensedir: /usr/local/etc/{neType}/license
# backup etc list of IMS, does not contain spaces
etcListIMS: '{*.yaml,mmtel,vars.cfg}'
etcListDefault: '{*.yaml,*.conf,*.cfg}'
# true/false to overwrite config file when dpkg ne software
dpkgOverwrite: false
# dpkg timeout (second)
dpkgTimeout: 180
# chk2ne: true/false, if put OmcNeConfig parameters to NE
omc:
uriPrefix: "/omc/rest"
neType: OMC
neId: 001
rmUID: 4400HX101
neName: OMC
province: ""
vendor: ""
dn: ""
chk2ne: false
sn: "-"
checksign: false
rootDir: /usr/local/omc
binDir: /usr/local/omc/bin
backup: /usr/local/omc/backup
upload: /usr/local/omc/upload
frontUpload: /usr/local/omc/htdocs/front/upload
frontTraceDir: /usr/local/omc/htdocs/front/trace
software: /usr/local/omc/software
license: /usr/local/omc/license
gtpUri: gtp:192.168.2.119:32152
checkContentType: false
testMode: false
rbacMode: true
runDir: /usr/local/omc/run
cmdTimeout: 120
# Alarm module setting
# Forward interface:
# 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:
alarmEmailForward:
enable: true
emailList:
smtp: mail.smtp.com
port: 25
user: smtpext@smtp.com
password: "1000smtp@omc!"
tlsSkipVerify: true
alarmSMSForward:
enable: true
mobileList:
smscAddr: "192.168.13.114:2775"
systemID: "omc"
password: "omc123"
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
# 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
publicKey: /usr/local/omc/etc/certs/omc
privateKey: /usr/local/omc/etc/certs/omc
# 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: false
file: /usr/local/omc/etc/testconfig.yaml

View File

@@ -71,7 +71,7 @@ database:
password: 1000omc@kp!
host: 127.0.0.1
port: 33066
name: omc_db
name: psap_db
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
omc:

View File

@@ -1,183 +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
status: Inactive
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 expired history gold_kpi
status: Inactive
uri: /api/rest/databaseManagement/v1/omc_db/gold_kpi
params: WHERE=now()+>+ADDDATE(`date`,+interval+IFNULL((SELECT+`value`+FROM+config+WHERE+config_tag='goldKpiDuration'),7)+day)
interval: 1
unit: Days
at: 00:12: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
status: Inactive
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
status: Inactive
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
status: Inactive
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: 10200
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: 10100 #alarm_code
interval: 1
unit: Days
at: 00:30
do: TaskGenLicenseAlarm
- name: Task of Generate NE system state alarm
status: Inactive
uri: /api/rest/faultManagement/v1/elementType/%s/objectType/alarms
params: 10000
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: 10201
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

View File

@@ -8,10 +8,10 @@ REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', '
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 千通科技', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 AGrandTech', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'AGrand PSAP', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2025 千通科技', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'AGrand PSAP', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2025 AGrandTech', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

View File

@@ -8,10 +8,10 @@ REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', '
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);
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'PSAP', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 PSAP', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'PSAP', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 PSAP', '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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,8 +1,12 @@
Package: OMC
Version: 2.2410.3-YYYYMMDD
Package: omc
Version: 1.2508.1-YYYYMMDD
Section: AGrandTech
Prioritt: optional
Architecture: amd64
Priority: optional
Architecture: amd64
Maintainer: Simon Zhangsz
Depends:
Description: OMC
Description: PSAP Operations Management Center
PSAP (Public Safety Answering Point) Operations Management Center
provides comprehensive management and monitoring capabilities for
emergency communication systems

View File

@@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OmcBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OmcDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList=$(find ${OMCEtcDir}/default -maxdepth 1 -type f \( -name "*.yaml" -o -name "*.conf" \) -exec basename {} \;)
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
@@ -60,7 +47,7 @@ fi
for LogoFile in ${LogoFileList}; do
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
@@ -82,9 +69,7 @@ systemctl daemon-reload
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
@@ -104,9 +89,7 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
echo -n "Starting PSAP service ... "
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

View File

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

View File

@@ -2,11 +2,9 @@
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
echo -n "Stopping PSAP service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi

View File

@@ -1,193 +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: warn
duration: 24
count: 90
# rest agent listen ipv4/v6 and port, support multiple routines
# ip: 0.0.0.0 or ::0, support IPv4/v6
# clientAuthType: 0:NoClientCert (default), 1:RequestClientCert, 2:RequireAnyClientCert,
# 3:VerifyClientCertIfGiven, 4:RequireAndVerifyClientCerts
rest:
- ipv4: 0.0.0.0
ipv6:
port: 33030
- ipv4: 0.0.0.0
ipv6:
port: 33443
schema: https
clientAuthType: 0
caFile: /usr/local/omc/etc/certs/omc-ca.crt
certFile: /usr/local/omc/etc/certs/omc-server.crt
keyFile: /usr/local/omc/etc/certs/omc-server.key
webServer:
enabled: true
rootDir: /usr/local/omc/htdocs/front
listen:
- addr: :80
schema: http
- addr: :443
schema: https
clientAuthType: 0
caFile: /usr/local/omc/etc/certs/omc-ca.crt
certFile: /usr/local/omc/etc/certs/omc-server.crt
keyFile: /usr/local/omc/etc/certs/omc-server.key
database:
type: mysql
user: root
password: 1000omc@kp!
host: 127.0.0.1
port: 33066
name: omc_db
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
backup: /usr/local/omc/database
# Redis data cache
redis:
dataSource:
# OMC system db
default:
port: 6379 # Redis port
host: "127.0.0.1" # Redis host
password: "helloearth"
db: 10 # Redis db_num
# UDM sub/auth db
udmuser:
port: 6379 # Redis port
host: "127.0.0.1"
password: "helloearth"
db: 0 # Redis db_num
# used to specify the default data source for multiple data resourece
defaultDataSourceName: "default"
# sleep: time delay for after write buffer (millisecond)
# deadLine: timeout for io read and write (second)
mml:
sleep: 200
deadLine: 10
sizeRow: 600
sizeCol: 128
bufferSize: 65535
mmlHome: ./mmlhome
# Tracking configuration
trace:
enabled: true
host: "172.16.5.100" # Fill in the specific IP address
port: 33033
# NE config
ne:
user: omcuser
etcdir: /usr/local/etc
bindir: /usr/local/bin
omcdir: /usr/local/omc
scpdir: /tmp
licensedir: /usr/local/etc/{neType}/license
# backup etc list of IMS, does not contain spaces
etcListIMS: '{*.yaml,mmtel,vars.cfg}'
etcListDefault: '{*.yaml,*.conf,*.cfg}'
# true/false to overwrite config file when dpkg ne software
dpkgOverwrite: false
# dpkg timeout (second)
dpkgTimeout: 180
# chk2ne: true/false, if put OmcNeConfig parameters to NE
omc:
uriPrefix: "/omc/rest"
neType: OMC
neId: 001
rmUID: 4400HX101
neName: OMC
province: ""
vendor: ""
dn: ""
chk2ne: false
sn: "-"
checksign: false
rootDir: /usr/local/omc
binDir: /usr/local/omc/bin
backup: /usr/local/omc/backup
upload: /usr/local/omc/upload
frontUpload: /usr/local/omc/htdocs/front/upload
frontTraceDir: /usr/local/omc/htdocs/front/trace
software: /usr/local/omc/software
license: /usr/local/omc/license
gtpUri: gtp:192.168.2.119:32152
checkContentType: false
testMode: false
rbacMode: true
runDir: /usr/local/omc/run
cmdTimeout: 120
# Alarm module setting
# Forward interface:
# 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:
alarmEmailForward:
enable: true
emailList:
smtp: mail.smtp.com
port: 25
user: smtpext@smtp.com
password: "1000smtp@omc!"
tlsSkipVerify: true
alarmSMSForward:
enable: true
mobileList:
smscAddr: "192.168.13.114:2775"
systemID: "omc"
password: "omc123"
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
# 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
publicKey: /usr/local/omc/etc/certs/omc
privateKey: /usr/local/omc/etc/certs/omc
# 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: false
file: /usr/local/omc/etc/testconfig.yaml

View File

@@ -1,8 +1,11 @@
Package: OMC
Version: 2.2410.3-YYYYMMDD
Package: omc
Version: 1.2508.1-YYYYMMDD
Section: AGrandTech
Prioritt: optional
Architecture: amd64
Priority: optional
Architecture: amd64
Maintainer: Simon Zhangsz
Depends:
Description: OMC
Description: PSAP Operations Management Center
PSAP (Public Safety Answering Point) Operations Management Center
provides comprehensive management and monitoring capabilities for
emergency communication systems

View File

@@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OmcBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OmcDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList=$(find ${OMCEtcDir}/default -maxdepth 1 -type f \( -name "*.yaml" -o -name "*.conf" \) -exec basename {} \;)
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
@@ -60,7 +47,7 @@ fi
for LogoFile in ${LogoFileList}; do
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
@@ -82,9 +69,7 @@ systemctl daemon-reload
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
@@ -104,9 +89,7 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
echo -n "Starting PSAP service ... "
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

View File

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

View File

@@ -2,11 +2,9 @@
systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
echo -n "Stopping PSAP service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi

View File

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

View File

@@ -0,0 +1,35 @@
{
"控制": {
"自动激活": true,
"位置可信": true,
"测试呼叫": false,
"车辆类型": "passengerVehicleCategoryM1"
},
"消息标识符": 1,
"乘员数量": 2,
"最近车辆位置N1": {
"纬度增量": 0,
"经度增量": 10
},
"最近车辆位置N2": {
"纬度增量": 0,
"经度增量": 30
},
"时间戳": 1579992331,
"车辆行驶方向": 45,
"车辆识别号码": {
"世界制造商标识": "ECA",
"车辆描述段": "LLEXAM",
"车辆标识段年份": "P",
"车辆标识段序列工厂": "LE02020"
},
"车辆位置": {
"位置纬度": 187996428,
"位置经度": 18859320
},
"车辆推进存储类型": {
"柴油罐存在": false,
"电力储能": true,
"汽油罐存在": true
}
}

View File

@@ -0,0 +1,35 @@
{
"Control": {
"Automatic Activation": true,
"Position Can Be Trusted": true,
"Test Call": false,
"Vehicle Type": "passengerVehicleCategoryM1"
},
"Message Identifier": 1,
"Number Of Occupants": 2,
"Recent Vehicle Location N1": {
"Latitude Delta": 0,
"Longitude Delta": 10
},
"Recent Vehicle Location N2": {
"Latitude Delta": 0,
"Longitude Delta": 30
},
"Timestamp": 1579992331,
"Vehicle Direction": 45,
"Vehicle Identification Number": {
"World Manufacturer Identifier": "ECA",
"Vehicle Descriptor Section": "LLEXAM",
"Vehicle Identifier Section Year": "P",
"Vehicle Identifier Section Serial Factory": "LE02020"
},
"Vehicle Location": {
"Position Latitude": 187996428,
"Position Longitude": 18859320
},
"Vehicle Propulsion Storage Type": {
"Diesel Tank Present": false,
"Electric Energy Storage": true,
"Gasoline Tank Present": true
}
}

View File

@@ -0,0 +1,35 @@
{
"control": {
"automaticActivation": true,
"positionCanBeTrusted": true,
"testCall": false,
"vehicleType": "passengerVehicleCategoryM1"
},
"messageIdentifier": 1,
"numberOfOccupants": 2,
"recentVehicleLocationN1": {
"latitudeDelta": 0,
"longitudeDelta": 10
},
"recentVehicleLocationN2": {
"latitudeDelta": 0,
"longitudeDelta": 30
},
"timestamp": 1579992331,
"vehicleDirection": 45,
"vehicleIdentificationNumber": {
"isovds": "LLEXAM",
"isovisModelyear": "P",
"isovisSeqPlant": "LE02020",
"isowmi": "ECA"
},
"vehicleLocation": {
"positionLatitude": 187996428,
"positionLongitude": 18859320
},
"vehiclePropulsionStorageType": {
"dieselTankPresent": false,
"electricEnergyStorage": true,
"gasolineTankPresent": true
}
}

556
docs/reference/msd_详解.txt Executable file
View File

@@ -0,0 +1,556 @@
A.1 ASN.1 definition of MSD
This module definition is appropriate for transmission of MSD via Pan-European eCall (via any means ofcommunication, see before)
and may be used for transmission of MSD via EN 16102 (Operatingrequirements for third party support).
MSDASN1Module
-- Definition of the eCall related MSD message in ASN.1
-- Any MSD message will encoded using this scheme, following the
-- UPER encoding rules.
-- The MsD message is defined in CEN standard EN 15722.Comments in this definition are taken from that standard. In
-- case of inconsistency in the comment,the text of EN 15722 prevails.
DEFINITIONS
AUTOMATIC TAGS ::=
BEGIN
-- Version of this ASN.l MD specification
-- (inclusion of this element allows software developers to
-- automatically read out the current version number from the ASN.1
-- compilation for automatic inclusion into the msdVersion parameter
-- of the MsD message,i.e. can reduce the chance of using an ASN.1
-- description ofone version but saying it is another)
CurrentVersion::INTEGER(3)
-- ECallMessage is the top level information element
-- The ECallMessage structure supports only one message type (msd)
-- Extendibility at this level is not allowed, thus ensuring that the
-- msdVersion (message format version) can be extracted directly.
-- Elements :
-- msdVersion: MSD format version
-- The format described in this document carries version 3
-- msd: Minimum Set Of Data uplink from vehicle
-- The OCTET STRING(CONTAINING ,..)construct is used to ensure that any
-- implementation can extract the msdVersion value from any version,
-- without decoding errors.
ECallMessage::SEQUENCEmsdVersionINTEGER {
msdVersion INTEGER(0 .. 255)
msd OCTET STRING(CONTAINING MMessage)
}
-- The main uplink msd message from the vehicle
-- Elements:
-- msdStructure: The main MSD strueture
-- optionalAdditionalData: Additional data
-- Extendable in future versions at this level e.g. to add extra data
--
MSDMessage ::= SEQUENCE {
msdStructure MSDStructure
optionalAdditionalData AdditionalData OPTIONAL,
...
}
-- The main MSD structure, excluding additional data
-- Elements:
-- messageIdentifier: Message identifier, starting with l for each
-- new eCall session and to be incremented with
-- every application layer MSD retransmission
-- control: see ControlType
-- vehicleIdentificationNumber: see VIN
-- vehiclePropulsionStorageType: see VehiclePropulsionStorageType
-- timestamp: Timestamp of incident event
-- As seconds elapsed since midnight January lst,1970 UTC
-- Failure value for time stamp set to "0"
-- vehicleLocation: see VehicleLocation
-- vehicleDirection: Direction of travel
-- in 2 degrees steps from either magnetic or
-- geographical north(0-358clockwise)
-- If direction of travel is invalid or unknown
-- the value 255 shall be used
-- Only values from 0 to 179 and 255 are valid
-- recentVehiclelocationNl: location delta with respect to vehicleLocation
-- recentVehicleLocationN2: location delta with respect to recentVehicleLocationN1, see VehicleLocationDelta
-- numberOfOccupants: Number of occupants in the vehicle according to available information.
-- If no information about the number of occupants is availablethis parameter needs to be omitted or set to 255.
MSDStructure ::= SEQUENCE {
messageldentifier INTEGER(0 .. 255)
control ControlType
vehicleldentificationNumber VIN,
vehiclePropulsionStorageType VehiclePropulsionstorageType,
timestamp INTEGER(0 .. 4294967295)
vehicleLocation VehicleLocation
vehicleDirection INTEGER(0 .. 179 | 255)
recentVehicleLocationN1 VehicleLocationDelta,
recentVehicleLocationN2 VehicleLocationDelta,
numberOfOccupants INTEGER(0 .. 255) OPTIONAL,
...
}
-- The ControlType is a collection of the following elements:
-- Elements:
automaticActivation: true = Automatic activation,
false = Manual activation
-- testCall: true = Test call,false=Emergency
-- positionCanBeTrusted: true = Position can be trusted
false = low confidence in position
-- NOTE "Low confidence in position"
shall mean that there is less than 95%
confidence that exact position is within the limits of a radius of +150m(-150m)
of reported position
-- vehicleType : see VehicleType
ControlType ::= SEQUENCE {
automaticAetivation BOOLEAN
testCal1 BOOLEAN
positionCanBeTrusted BOOLEAN
vehicleType VehicleType
}
-- Definition of the vehicle type reporting the incident.
-- NOTE: Vehicle definitions category M,N according directive 2007/46/EC;
category l according directive 2002/24/EC,other categories
according tO UNECE UNECE TRANS/WP.29/78/Rev.4(2016) World Forum for
Harmonization of Vehicle Regulations; Consolidated Resolution on the Construction of Vehicles(R.E.3)
-- NOTE: The normal encoding of the MSD is ASN. 1 UPER in which case the
numerical values specified below are ignored
-- Extendable in future versions for new vehicle types. Implementations should anticipate on receiving an unknown value.
VehicleType ::= ENUMERATED {
passengerVehicleCategoryM1 (1),
busesAndCoachesCategoryM2 (2),
busesAndCoachesCategoryM3 (3),
lightCommercialVehiclesN1 (4),
heavyDutyVehiclesCategoryN2 (5),
heavyDutyVehiclesCategoryN3 (6),
motorcyclesCategoryL1e (7),
motorcyclesCategoryL2e (8),
motorcyclesCategoryL3e (9),
motorcyclesCategoryL4e (10),
motorcyclesCategoryL5e (11),
motorcyclesCategoryL6e (12),
motorcyclesCategoryL7e (13),
trailersCategory0 (14),
agriVehiclesCategoryR (15),
agriVehiclesCategoryS (16),
agriVehiclesCategoryT (17),
offRoadVehiclesCategoryG (18),
specialPurposeMotorCaravanCategorySA (19),
specialPurposeArmouredVehicleCategorysB(20),
specialPurposeAmbulanceCategorySC (21),
specialPurposeHearseCategorySD (22),
otherVehicleCategory(23),
...
}
-- VIN ( vehicle identification number ) according ISO 3779
-- isowmi: World Manufacturer Index (WMI)
-- isovds: Vehicle Type Descriptor(VDS)
-- Vehicle Identifier Section (VIS) consisting of
-- isovisModelyear: Modelyear from Vehicle Identifier Section (VIS)
-- isovisSeqPlant: Plant code + sequential number from Vehicle Identifier Section (VIS)
VIN ::= SEQUENCE {
isowmi PrintableString(SIZE(3))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
isovds PrintableString(SIZE(6))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
isovisModelyear PrintableString(SIZE(1))
(FROM("A".."H"|"J".."N"|"P"|"R".."Z"|"0".."9")),
isovisSeqPlant PrintableString(SIZE(7))
(FROM("A".."H"|"J".."N"|"P"I"R".."Z"|"0".."9"))
}
-- VehiclePropulsionStorageType is a collection of elements
-- that contain information about the presence of propulsion
-- storage inside the vehicle sending the MSD.
--
-- For each storage type the following coding applies:
-- false = indicates a type of storage not present
-- true = indicates type of storage which is present
-- The following storage types are supported:
-- Gasoline tank
-- Diesel tank
-- Compressed natural gas (CNG)
-- Liquid propane gas(LPG)
-- Electric energy storage (vehicle has electric propulsion and associated batteries)
-- Hydrogen storage
-- other storage
-- If the type of energy storage is unknown, then all elements
-- shall be set to false.
-- Extendible in future versions for new fuel storage types
VehiclePropulsionStorageType ::= SEQUENCE {
gasolineTankPresent BOOLEAN DEFAULT FALSE,
dieselTankPresent BOOLEAN DEFAULT FALSE,
compressedNaturalGas BOOLEAN DEFAULT FALSE,
liquidPropaneGas BOOLEAN DEFAULT FALSE,
electricEnergyStorage BOOLEAN DEFAULT FALSE,
hydrogenStorage BOOLEAN DEFAULT FALSE,
otherStorage BOOLEAN DEFAULT FALSE,
...
}
-- VehicleLocation:
-- The current location of the vehicle
-- Elements:
-- Position latitude (WGS84) in milliarcsec
-- Position longitude (WGS84) in milliarcsec
-- 32 bits (4 octets) allocated to make signed value handling easier
--
-- If latitude and/or longitude is invalid or unknown,
-- the representation of value 2147483647 shall be transmitted.
VehicleLocation ::= SEQUENCE {
-- Actual valid value range (-324000000 to 324000000)
positionLatitude INTEGER(-2147483648..2147483647),
-- Actual valid value range(-648000000 to 648000000)
positionLongitude INTEGER(-2147483648..2147483647)
}
-- VehicleLocationDelta:
-- Description of (the delta of) a recent vehicle location
-- before the incident
-- Latitude Delta (+ for North and - for South)
-- Longitude Delta(+ for East and - for West)
-- both with respect to a previous location.
-- 1 Unit = 100 miliarcseconds, which is approximately 3m
VehicleLocationDelta ::= SEQUENCE {
latitudeDelta INTEGER(-512..511),
longitudeDelta INTEGER(-512..511)
}
-- AdditionalData:
-- Further additional bytes of data encoded as in a
-- seperate ASN.1 definition
-- Elements:
-- oid: Object identifier which uniquely identifies the format
and meaning of the data which follows.
-- data:Transparent optional additional data,
according to the format referenced by the oid
The user must ensure that the size of this element
is restricted to ensure that the total ECallMessage is
small enough for the relevant transmission medium.
AdditionalData ::= SEQUENCE {
oid RELATIVE-OID,
data OCTET STRING
}
-- Several of the elements above are "extendable"
-- according to the ASN.1 standard to facilitate future extensions
-- whilst also maintaining backwards compatibility. Implementations must provision for such extensions
END
A.2 Syntax check of ASN.1 definition of MSD
ASN.1 Studio Version 9.0
Copyright (C) 2018 OSS Nokalva,Inc. All rights reserved.
This product is licensed for use by "Cheiron IT bv,Leiden,Holland - Standards Editor",
License "66410E", only for project "CEN TC278 WG15 related standards work"
ASN.1 syntax check result: cO043I: 0 error messages, 0 warning messages and 0 informatory messages issued.
MSDv3: Compilation summary: The project MSDv3 includes 3 PDUs and 0 ASN.1 values.
A.3 Examples of ASN.1 encoded MSD
The example below is shown in ASN.1 value encoding(plain text):
value ECallMessage ::=
{
msdVersion 3,
msd
CONTAINING
{
msdStructure
{
messageIdentifier 1,
control
{
automaticActivation TRUE,
testCall FALSE,
positionCanBeTrusted TRUE,
vehicleType passengerVehicleCategoryM1
},
vehicleIdentificationNumber
{
isowmi "ECA",
isovds "LLEXAM",
isovisModelyear "P",
isovisSeqPlant "LE02020"
},
vehiclePropulsionStorageType
{
gasolineTankPresent TRUE,
electricEnergyStorage TRUE
},
timestamp 1579992331,
vehicleLocation
{
positionLatitude 187996428,
positionLongitude 18859320
},
vehicleDirection 45,
recentVehicleLocationN1
{
latitudeDelta 0,
longitudeDelta 10
},
recentVehicleLocationN2
{
latitudeDelta 0,
longitudeDelta 30
},
numberOfOccupants 2
}
}
}
{
msdVersion 3,
msd
CONTAINING
{
msdStructure
{
messageIdentifier 1,
control
{
automaticActivation TRUE,
testCall FALSE,
positionCanBeTrusted TRUE,
vehicleType passengerVehicleCategoryM1
},
vehicleIdentificationNumber
{
isowmi "ECA",
isovds "LLEXAM",
isovisModelyear "P",
isovisSeqPlant "LE02020"
},
vehiclePropulsionStorageType
{
gasolineTankPresent TRUE,
electricEnergyStorage TRUE
},
timestamp 1579992331,
vehicleLocation
{
positionLatitude 187996428,
positionLongitude 18859320
},
vehicleDirection 45,
recentVehicleLocationN1
{
latitudeDelta 0,
longitudeDelta 10
},
recentVehicleLocationN2
{
latitudeDelta 0,
longitudeDelta 30
},
numberOfOccupants 2
}
}
}
The same example encoded in UPER (hexadecimal representation,38 bytes):
0324101A 01C614A2873C52AB A870010010089AF166285C59 A4C86408 FE29C16C 01054010 F010
Annex B
(informative)
ASN.1 Data representation PER and BER explained
B.1 What is ASN.1
NOTE This introduction was inspired by the information found in http://www.w3.org/Protocols/HTTP-NG/asn1.html.Definitions,examples and encoding traces were created using OSS Nokalva ASN.1 Studio.
ASN.1 is a notation for describing data structures;it is very much like a type declaration in Cor C++.
One of the key components of ASN.1 are Procotol Data Units (PDUs).Let's take a look at the ASN.1 definition for the MSD.
It contains the PDU ECallMessage',which is defined like so:
ECallMessage ::=SEQUENCE {
msdVersion INTEGER(0 .. 255),
msd MSDMessage
}
This defines EcallMessage as an object with two members:
-- msdVersion, which content is an integer value between 0 and 255,and msd,which is a complex object of type MSDMessage,defined later on
Hence ASN.1 offers means of defining the type (i.e.INTEGER), the range (i.e.0.255) and more complex constructions.
Further down the definition one can find additional functionality that ASN.1 had to offer:
-- optional element: some elements can be declared optional, and thus be left out of a data encoding(see MSDStructure.recentVehicleLocationN1);
-- enumeration: an element can contain enumerated data, in such a way that the encoding is very efficient without losing content (see VehicleType);
—- strict range checking: not only ranges like 0 .. 255 are possible,but combined ranges as well(see VIN)
The ASN.1 definition is used to encode and decode data content.Several encoding rules exist,among which:
-- Basic Encoding Rules (BER):the original rules for taking an ASN.1 data type, and turning it into a sequence of bits and bytes;
-- Packed Encoding Rules (PER): instead of using a generic style of encoding that encodes all types in a
uniform way,the PER specialise the encoding based on the data type to generate much more compact representations;
-- XML Encoding Rules (XER):an encoding using XML
B.2 Encoding data using ASN.1
The main purpose of any ASN.1 definition is to encode and decode data. This paragraph describes some of the basic procedures.
The Basic Encoding Rules (BER) were the original rules for taking an ASN.1 data type,
and turning it into a sequence of bits and bytes.BER uses a form of encoding commonly known as Tag-Length-Value.
Each item is encoded as a tag,indicating what type it is,a length indicating the size of the object,and a value,
which contains the actual contents of the object.
Tags are reasonably simple-in there simplest form they consist of a single byte;
the highest two bits indicate the tag class:whether the tag is an official ISO tag,
an application wide tag,a private tag,or a tag that only has meaning for this particular structure.
The next bit is a flag to indicate whether the tagged object is a simple type,such as a number or a string,
or a compound type made up from a bunch of other types.The remaining 5 bits are used to represent the tag number.
If the tag is too big to fit in 5 bits,then these bits are set to all ones,
and the tag number is encoded in the following bytes as a sequence of seven bit bytes.
The high bit of these bytes is used as a flag to indicate whether there's more tag available.
Lengths are also quite simple.There are two ways of encoding lengths - the definite form, and the indefinite form.
For the definite form, if the length is less than 128, you just use a single byte,with the high bit set to zero.
Otherwise the high bit is set to one,and the low seven bits set to the length of length.
The length is then encoded in that many bytes.The indefinite form is encoded by sending a length field with a length of length of O-i.e.[1000|0000].
The objectis ended by sending two zero bytes.
DER is a restricted variant of BER for producing unequivocal transfer syntax for data structures described by ASN.1.
DER is the same thing as BER with allbut one sender's options removed.It provides for exactly one way to encode an ASN.1 value.
DER is intended for situations when a unique encodingis needed,such as in cryptography,
and ensures that a data structure that needs to be digitally signed produces a unique serialized representation.
DER can be considered a canonical form of BER. For example, in BER a Boolean value of true can be encoded as any of 255 non-zero byte values,
while in DER there is only one way to encode a Boolean value of true.
The most significant DER encoding constraints are:
-Length encoding shall use the definite form. Additionally,the shortest possible length encoding shall be used.
-Bitstring,octetstring,and restricted character strings shall use the primitive encoding
—Elements of a Set are encoded in sorted order,based on their tag value.
The packed encoding rules use a different style of encoding.Instead of using a generic style of encoding that encodes all types in a uniform way,
the PER specialise the encoding based on the data type to generate much more compact representations.
Packed encoding rules have particular value for messages of known data structure (such as the MSD)
PER only generates tags when they are needed to prevent ambiguity this only occurs when ASN.1's version of union (CHOICE) is used.
PER also only generates lengths when the size of an object can vary. Even then,PER tries to represent the lengths in the most compact form possible.
The presence of optional elements in a sequence is indicated by a list of single bit flags placed at the start of a sequence-if the bit is set,then the option is present.
PER encodings are not always aligned on byte boundaries-if the'aligned'variant of the rules is used,then strings *will*be aligned.
The unaligned variant(UPER)treats the encoding as a string of bits, allowing things like booleans and small integers to be squished together in one byte.
Data can obviously also be encoded into an XML representation. Apart from XER,the 'basic XML encoding', one can choose to use the Canonical or the Extended XML encoding rules (CXER or EXER).
B.3 Examples
This paragraph shows in depth examples using ASN.1 encoding rules.For clarity a basic example(source: https://en.wikipedia.org/wiki/ASN.1) is used,examples of MSD encodings are found elsewhere.
The examples in this appendix will use the following definition:
FooProtocol
DEFINITIONS::=BEGIN
FooQuestion ::=SEQUENCE {
trackingNumber INTEGER,
question PrintableString
}
FooAnswer ::=SEQUENCE {
questionNumber INTEGER,
answer BOOLEAN
}
END
This definition gives us two PDU's:FooQuestion and FooAnswer. We'll create an instance of both:
myQuestion FooQuestion ::= {
trackingNumber 5,
question "Anybody there?"
}
theirAnswer FoOAnswer ::= {
questionNumber 5,
answer TRUE
}
In the remainder we will find out how these are encoded using the different encoding rulesets.
myQuestion encoded using DER or BER(definite length)gives the following hexadecimal representation:
30 13 02 01 05 13 0E 41 6E 79 62 6F 64 79 20 74 68 65 72 65 3F
30 SEQUENCE
13 of length .13 (19) bytes, containing
02 INTEGER (type .02 (2))
01 of length .01 (1) byte, containing
05 value .05 (5)
13 PrintableString(type .13 (19))
OE of length .0E (14) bytes, containing
41 character .41 (65,"A")
6E character .6E (110,"n")
79 character .79 (121,"y")
62 character .62 (98,"b")
...
65 character .65 (101,"3")
3F character .3F (63,"!")
Using BER with indefinite length,the coding is slightly different:
30 80 02 01 05 13 0E 41 6E 79 62 6F 64 79 20 74 68 65 72 65 3F 00 00
Where.80 represents the indefinite length,and the encoded message is terminated by'.00.00'.
If myQuestion is encoded using(aligned)PER the result differs 'drastically':
01 05 0E 41 6E 79 62 6F 64 79 20 74 68 65 72 65 3F
The difference is caused by not including information about the data structure in the encoded content.
As a result the encoding is 4 bytes less than when using BER encoding.
To decode,one needs the encoding definition,to be able to decode like this:
--TYPE INFORMATION: SEQUENCE
--TYPE INFORMATION: INTEGER
01 First byte: length = .01, 1 byte
05 Value bytes (1 byte): .05 (5)
--TYPE INFORMATION: PrintableString
OE First byte: length= .0E, 14 bytes
... Value bytes (14 bytes) =.41.6E.79.62.6F.64.79.20.74.68.65.72.65.3F
The information in the bold lines is taken from the encoding schema.
Using unaligned PER(UPER) the encoded data gets changed completely and the result is 1 byte less than the aligned version:
01050E 83 BB CE 2D F93C A0 E9 A32F 2C AF C0
The difference is caused by the fact that a elements ofa PrintableString are made up from 7 bit characters and
these are now no longer aligned on an 8-bit boundary by prepadding the bits with a 0.
This table shows the different encoding of the beginning of the string"Are":
.41 .6E .79 .62 result
PER encoding 01000001 01101110 01111001 01100010 01000001011011100111100101100010
UPER encoding 1000001 1101110 1111001 1100010 1000001110111011110011100010 83 BB CE
The number of bytes spared by using UPER is depending on how strict the schema is made and what data types are used.
When the XML Encoding Rules are used a rather simple XML representation can be created:
<?xml version="1.0"encoding="UTF-8"?>
<FooQuestion>
<trackingNumber>5</trackingNumber>
<question>Anybody there?</question>
</FooQuestion>

Binary file not shown.

Binary file not shown.

6
package-lock.json generated
View File

@@ -1,6 +0,0 @@
{
"name": "build.ems",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

View File

@@ -8,7 +8,7 @@
Name: %{project_lname}
Summary: 5GC OMC
Version: 2.2410.3
Version: 1.2508.1
Release: %{release_date}
Vendor: omc
URL: https://www.omc.com/
@@ -33,50 +33,40 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
OMCRootDir=/usr/local/omc
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
UsrLib64Dir=/usr/lib64
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList="restconf.yaml sshsvc.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
for CFile in ${CFileList}; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
else
#else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
${OMCBinDir}/upgconf.sh
fi
#if [ -e "${OMCBinDir}/upgconf.sh" ]; then
# ${OMCBinDir}/upgconf.sh
#fi
fi
done
if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; fi
for LogoFile in ${LogoFileList}; do
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
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
mkdir -p /opt/omc/ftp
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 libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
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
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
@@ -89,9 +79,7 @@ firewall-cmd --reload
systemctl daemon-reload
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
# read environment parameter and to do
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
@@ -110,23 +98,13 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start captrace.service
systemctl start sshsvc.service
systemctl start crontask.service
systemctl start restagent.service
echo "done"
# 卸载时执行
%postun
UsrLocalBinDir=/usr/local/bin
UsrLib64Dir=/usr/lib64
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
@@ -138,25 +116,17 @@ firewall-cmd --reload
if [ "$1" = "0" ] ; then
sudo systemctl stop restagent.service
sudo systemctl stop crontask.service
sudo systemctl stop sshsvc.service
sudo systemctl stop captrace.service
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
sudo systemctl disable restagent.service
sudo systemctl disable crontask.service
sudo systemctl disable sshsvc.service
sudo systemctl disable captrace.service
sudo systemctl daemon-reload
else
sudo systemctl daemon-reload
sudo systemctl stop restagent.service
sudo systemctl stop crontask.service
sudo systemctl stop sshsvc.service
sudo systemctl stop captrace.service
sudo systemctl start crontask.service
sudo systemctl start sshsvc.service
sudo systemctl start captrace.service
sudo systemctl start restagent.service
fi
@@ -179,11 +149,7 @@ fi
/usr/local/omc/static
#/etc/nginx/conf.d/omc.conf
/lib/systemd/system/restagent.service
/lib/systemd/system/crontask.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