1
0

39 Commits

Author SHA1 Message Date
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
26 changed files with 149 additions and 434 deletions

29
.gitignore vendored
View File

@@ -12,26 +12,19 @@
# 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
!rpmbuild/SPECS/omc.spec
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/

165
build.sh
View File

@@ -56,7 +56,7 @@ fi
ProjectL=omc
ProjectU=OMC
PROJECT=${ProjectL}
VERSION=2.2410.3
VERSION=2.2502.2
RelDate=`date +%Y%m%d`
RelVer=${VERSION}-${RelDate}
Ky10Arch=ky10.aarch64
@@ -66,9 +66,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 +80,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 +94,86 @@ 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}
;;
*)
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 +189,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,10 +209,9 @@ 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}/omc.d ${RpmBuildOMCDir}/static
cd ${RpmBuildDir}
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
@@ -178,10 +220,12 @@ case "${pkgtype}" in
rm -f omc-md5sum.txt
# rpm --addsign *.rpm
md5sum $RpmPkgRename >omc-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 +233,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 +248,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}
@@ -243,17 +275,20 @@ case "${pkgtype}" in
#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 +296,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 +308,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}
@@ -315,12 +336,14 @@ case "${pkgtype}" in
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 <======"
;;
*)
usage

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,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

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

View File

@@ -0,0 +1,2 @@
export default {
};

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.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

View File

@@ -1,5 +1,5 @@
Package: OMC
Version: 2.2410.3-YYYYMMDD
Version: 2.2502.2-YYYYMMDD
Section: AGrandTech
Prioritt: optional
Architecture: amd64

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="restconf.yaml sshsvc.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
@@ -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
@@ -105,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start crontask.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
@@ -17,15 +9,11 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

View File

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

View File

@@ -1,5 +1,5 @@
Package: OMC
Version: 2.2410.3-YYYYMMDD
Version: 2.2502.2-YYYYMMDD
Section: AGrandTech
Prioritt: optional
Architecture: amd64

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="restconf.yaml sshsvc.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OmcDaemon} ]; then ln -s ${OmcBinDir}/omcsvc.sh ${OmcDaemon}; fi
@@ -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
@@ -105,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start crontask.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
@@ -17,15 +9,11 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

View File

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

View File

@@ -11,6 +11,7 @@ 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 ba: customized for BA OMC"
}
pkgtype=""
@@ -49,8 +50,11 @@ 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}")
fi
;;
\?)
echo "Invalid option: -$OPTARG" >&2
@@ -66,18 +70,40 @@ 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() {

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: 2.2502.2
Release: %{release_date}
Vendor: omc
URL: https://www.omc.com/
@@ -33,31 +33,28 @@ 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
@@ -70,13 +67,6 @@ 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