Compare commits
20 Commits
nbi
...
b73aff3a91
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b73aff3a91 | ||
|
|
e594a5f19a | ||
|
|
9bf9ac6479 | ||
|
|
ff0f52efac | ||
|
|
b758a21bab | ||
|
|
aa974c21dc | ||
|
|
6affa5f93e | ||
|
|
1b531f3556 | ||
|
|
4ebbbbf1f3 | ||
|
|
f0688a4273 | ||
|
|
e3319048ea | ||
|
|
0f90394faa | ||
|
|
79c5378bc3 | ||
|
|
e1cc70a0b8 | ||
|
|
1d29e002f3 | ||
|
|
fdcf8be579 | ||
|
|
e2ee082cb8 | ||
|
|
150d7aadbc | ||
|
|
4215a73c8c | ||
|
|
e1f4eb6267 |
1
.gitignore
vendored
@@ -27,6 +27,5 @@ release
|
|||||||
rpmbuild/RPMS
|
rpmbuild/RPMS
|
||||||
rpmbuild/SOURCES
|
rpmbuild/SOURCES
|
||||||
rpmbuild/BUILD
|
rpmbuild/BUILD
|
||||||
rpmbuild/BUILDROOT
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
90
bin/build.sh
@@ -1,14 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [OPTION] deb|badeb|rpm"
|
echo "Usage: $0 [OPTION] deb|badeb|rpm|psapdeb"
|
||||||
echo
|
echo
|
||||||
echo "Build omc package, option as follow:"
|
echo "Build omc package, option as follow:"
|
||||||
echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg"
|
echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg"
|
||||||
echo " badeb: ubuntu|debian package build by dpkg"
|
echo " badeb: ubuntu|debian package build by dpkg"
|
||||||
echo " rpm: centos/redhat package, build by rpmbuild"
|
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 " -r, =build root directory build root directory, default directory is $HOME/omc.git"
|
||||||
echo " -d dump SQL from database"
|
echo " -d dump SQL from database"
|
||||||
|
echo " -h, --help display this help and exit"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +19,7 @@ pkgtype=""
|
|||||||
new_args=()
|
new_args=()
|
||||||
# Traverse all parameters
|
# Traverse all parameters
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" ]]; then
|
if [[ "$arg" == "deb" || "$arg" == "badeb" || "$arg" == "rpm" || "$arg" == "psapdeb" ]]; then
|
||||||
pkgtype=$arg
|
pkgtype=$arg
|
||||||
else
|
else
|
||||||
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
|
new_args+=("$arg") # Add non pkgtype parameters to a new parameter list
|
||||||
@@ -31,7 +34,7 @@ fi
|
|||||||
# Use a new parameter list
|
# Use a new parameter list
|
||||||
set -- "${new_args[@]}"
|
set -- "${new_args[@]}"
|
||||||
|
|
||||||
GitLocalRoot=${HOME}/omc.git
|
GitLocalRoot=${HOME}/${ProjectL}.git
|
||||||
while getopts "r:d" option; do
|
while getopts "r:d" option; do
|
||||||
case $option in
|
case $option in
|
||||||
r)
|
r)
|
||||||
@@ -56,7 +59,7 @@ fi
|
|||||||
ProjectL=omc
|
ProjectL=omc
|
||||||
ProjectU=OMC
|
ProjectU=OMC
|
||||||
PROJECT=${ProjectL}
|
PROJECT=${ProjectL}
|
||||||
VERSION=2.2508.2
|
VERSION=1.2506.2
|
||||||
RelDate=`date +%Y%m%d`
|
RelDate=`date +%Y%m%d`
|
||||||
RelVer=${VERSION}-${RelDate}
|
RelVer=${VERSION}-${RelDate}
|
||||||
Ky10Arch=ky10.aarch64
|
Ky10Arch=ky10.aarch64
|
||||||
@@ -69,7 +72,7 @@ RpmArch=`arch`
|
|||||||
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS
|
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS
|
||||||
ReleaseDir=${EmsBuildRoot}/release
|
ReleaseDir=${EmsBuildRoot}/release
|
||||||
DumpToolDir=${EmsBEDir}/tools/misc
|
DumpToolDir=${EmsBEDir}/tools/misc
|
||||||
ProjectTag="nbi"
|
ProjectTag=""
|
||||||
|
|
||||||
BuildDir=${EmsBuildRoot}/build
|
BuildDir=${EmsBuildRoot}/build
|
||||||
CustomizedDir=${EmsBuildRoot}/customized
|
CustomizedDir=${EmsBuildRoot}/customized
|
||||||
@@ -159,8 +162,7 @@ case $(get_os_info) in
|
|||||||
;;
|
;;
|
||||||
openEuler)
|
openEuler)
|
||||||
ptype=rpm
|
ptype=rpm
|
||||||
majorVersion=${OSVersion:0:2}
|
RelOS=oe20
|
||||||
RelOS=oe${majorVersion}
|
|
||||||
RpmPkgName=${ProjectL}-${RelVer}.${RpmArch}.${ptype}
|
RpmPkgName=${ProjectL}-${RelVer}.${RpmArch}.${ptype}
|
||||||
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}.${ptype}
|
||||||
;;
|
;;
|
||||||
@@ -218,19 +220,15 @@ case "${pkgtype}" in
|
|||||||
chmod 755 ${BuildOMCBinDir}/*
|
chmod 755 ${BuildOMCBinDir}/*
|
||||||
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
|
cp -rf ${BuildDir}/* ${RpmBuildDir}/BUILD/
|
||||||
cp -rf ${CustomizedDir}/agt.d ${RpmBuildOMCDir}/static
|
cp -rf ${CustomizedDir}/agt.d ${RpmBuildOMCDir}/static
|
||||||
cp -rf ${CustomizedDir}/omc.d ${RpmBuildOMCDir}/static
|
cp -rf ${CustomizedDir}/psap.d ${RpmBuildOMCDir}/static
|
||||||
cd ${RpmBuildDir}
|
cd ${RpmBuildDir}
|
||||||
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
|
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
|
||||||
|
|
||||||
if [ ! ProjectTag = "" ]; then
|
|
||||||
RpmPkgRename=${ProjectL}-r${RelVer}-${RelOS}-${RelArch}-${ProjectTag}.${ptype}
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
|
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
|
||||||
cd ${ReleasePkgDir}
|
cd ${ReleasePkgDir}
|
||||||
rm -f omc-md5sum.txt
|
rm -f ${ProjectL}-md5sum.txt
|
||||||
# rpm --addsign *.rpm
|
# rpm --addsign *.rpm
|
||||||
md5sum $RpmPkgRename >omc-md5sum.txt
|
md5sum $RpmPkgRename >${ProjectL}-md5sum.txt
|
||||||
echo "Finish to make ${pkgtype} package <======"
|
echo "Finish to make ${pkgtype} package <======"
|
||||||
;;
|
;;
|
||||||
deb)
|
deb)
|
||||||
@@ -281,7 +279,7 @@ case "${pkgtype}" in
|
|||||||
chmod 755 ${DebBuildDir}/DEBIAN/postrm
|
chmod 755 ${DebBuildDir}/DEBIAN/postrm
|
||||||
cp -rf ${BuildDir}/* ${DebBuildDir}/
|
cp -rf ${BuildDir}/* ${DebBuildDir}/
|
||||||
cp -rf ${CustomizedDir}/agt.d ${DebBuildOMCDir}/static
|
cp -rf ${CustomizedDir}/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}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
|
||||||
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
|
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
|
||||||
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
|
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
|
||||||
@@ -356,6 +354,68 @@ case "${pkgtype}" in
|
|||||||
md5sum ${DebPkgName} >omc-md5sum.txt
|
md5sum ${DebPkgName} >omc-md5sum.txt
|
||||||
echo "Finish to make ${pkgtype} package <======"
|
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
|
usage
|
||||||
exit 4
|
exit 4
|
||||||
|
|||||||
@@ -11,12 +11,19 @@ usage() {
|
|||||||
echo " -m, =be|fe|all be: only process back-end code, default if non input"
|
echo " -m, =be|fe|all be: only process back-end code, default if non input"
|
||||||
echo " fe: only process front-end code"
|
echo " fe: only process front-end code"
|
||||||
echo " all: process all include be and fe"
|
echo " all: process all include be and fe"
|
||||||
echo " -c, =ba ba: customized for BA OMC"
|
echo " -c, =ba|psap ba: customized for BA OMC, psap: customized for PSAP Portal"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgtype=""
|
pkgtype=""
|
||||||
new_args=()
|
new_args=()
|
||||||
be_args=()
|
be_args=()
|
||||||
|
|
||||||
|
handle_invalid_option() {
|
||||||
|
echo "Invalid option: -$1" >&2
|
||||||
|
usage
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
# Traverse all parameters
|
# Traverse all parameters
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then
|
if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then
|
||||||
@@ -35,7 +42,7 @@ fi
|
|||||||
# Use a new parameter list
|
# Use a new parameter list
|
||||||
set -- "${new_args[@]}"
|
set -- "${new_args[@]}"
|
||||||
|
|
||||||
rootdir=${HOME}/omc.git
|
rootdir=${HOME}/psap.git
|
||||||
m_arg="*"
|
m_arg="*"
|
||||||
while getopts "m:r:c:d" option; do
|
while getopts "m:r:c:d" option; do
|
||||||
case $option in
|
case $option in
|
||||||
@@ -54,12 +61,15 @@ while getopts "m:r:c:d" option; do
|
|||||||
if [ "${c_arg}" == "ba" ]; then
|
if [ "${c_arg}" == "ba" ]; then
|
||||||
pkgtype="badeb"
|
pkgtype="badeb"
|
||||||
be_args+=("${pkgtype}")
|
be_args+=("${pkgtype}")
|
||||||
|
elif [ "${c_arg}" == "psap" ]; then
|
||||||
|
pkgtype="psapdeb"
|
||||||
|
be_args+=("${pkgtype}")
|
||||||
|
else
|
||||||
|
handle_invalid_option "$OPTARG"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
handle_invalid_option "$OPTARG"
|
||||||
usage
|
|
||||||
exit 2
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -113,6 +123,12 @@ makebe() {
|
|||||||
./build.sh ${be_args[@]}
|
./build.sh ${be_args[@]}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_makepkg() {
|
||||||
|
cd ${builddir}
|
||||||
|
git checkout debbuild/DEBIAN/
|
||||||
|
git checkout debbuild/22.04/DEBIAN/
|
||||||
|
}
|
||||||
|
|
||||||
case "${m_arg}" in
|
case "${m_arg}" in
|
||||||
fe)
|
fe)
|
||||||
makefe
|
makefe
|
||||||
@@ -120,8 +136,10 @@ case "${m_arg}" in
|
|||||||
all)
|
all)
|
||||||
makefe
|
makefe
|
||||||
makebe
|
makebe
|
||||||
|
post_makepkg
|
||||||
;;
|
;;
|
||||||
be | *)
|
be | *)
|
||||||
makebe
|
makebe
|
||||||
|
post_makepkg
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
189
build/usr/local/omc/etc/default/restconf.yaml
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
# 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: psap_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
|
||||||
|
# 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: false
|
||||||
|
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
|
||||||
|
capability: 50
|
||||||
|
sn: "-"
|
||||||
|
expiryDate: "-"
|
||||||
|
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
|
||||||
@@ -71,7 +71,7 @@ database:
|
|||||||
password: 1000omc@kp!
|
password: 1000omc@kp!
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 33066
|
port: 33066
|
||||||
name: omc_db
|
name: psap_db
|
||||||
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
||||||
|
|
||||||
omc:
|
omc:
|
||||||
|
|||||||
@@ -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_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 (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 ©2024 千通科技', '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 EMS', 'i18n_en', 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 ©2024 AGrandTech', '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
|
-- set internationalization switching to ON
|
||||||
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
SET FOREIGN_KEY_CHECKS = 0;
|
|
||||||
|
|
||||||
--
|
|
||||||
REPLACE INTO `sys_config` VALUES (6, 'config.sys.officialUrl', 'sys.officialUrl', 'https://www.bluearcus.com', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.officialUrlRemark');
|
|
||||||
REPLACE INTO `sys_config` VALUES (106, 'config.sys.title', 'sys.title', 'config.sys.titleValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.titleRemark');
|
|
||||||
REPLACE INTO `sys_config` VALUES (107, 'config.sys.copyright', 'sys.copyright', 'config.sys.copyrightValue', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.copyrightRemark');
|
|
||||||
REPLACE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 'false', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nOpenRemark');
|
|
||||||
REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
|
||||||
|
|
||||||
--
|
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
|
||||||
|
|
||||||
-- set internationalization switching to ON
|
|
||||||
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
|
||||||
UPDATE `sys_menu` SET `status` = '0' WHERE `menu_id` = 2122;
|
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
||||||
|
Before Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 216 KiB |
@@ -1,2 +0,0 @@
|
|||||||
export default {
|
|
||||||
};
|
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -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_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 (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', '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', 'OMC', 'i18n_en', 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', '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
|
-- set internationalization switching to ON
|
||||||
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);
|
||||||
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
customized/psap.d/logo/en_icon.png
Executable file
|
After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
customized/psap.d/logo/zh_icon.png
Executable file
|
After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -1,8 +1,9 @@
|
|||||||
Package: OMC
|
Package: PSAP
|
||||||
Version: 2.2508.2-YYYYMMDD
|
Version: 1.2506.2-20250616
|
||||||
Section: AGrandTech
|
Section: AGrandTech
|
||||||
Prioritt: optional
|
Prioritt: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Maintainer: Simon Zhangsz
|
Maintainer: Simon Zhangsz
|
||||||
Depends:
|
Depends:
|
||||||
Description: OMC
|
Description: psap
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ UsrLocalBinDir=/usr/local/bin
|
|||||||
OmcDaemon=omcd
|
OmcDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
NginxConfDir=${NginxEtcDir}/conf.d
|
NginxConfDir=${NginxEtcDir}/conf.d
|
||||||
CFileList=$(ls ${OMCEtcDir}/default)
|
CFileList="restconf.yaml sshsvc.yaml omc.conf"
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -47,7 +47,7 @@ fi
|
|||||||
|
|
||||||
for LogoFile in ${LogoFileList}; do
|
for LogoFile in ${LogoFileList}; do
|
||||||
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
||||||
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Starting OMC service ... "
|
echo -n "Starting PSAP service ... "
|
||||||
systemctl start sshsvc.service
|
systemctl start sshsvc.service
|
||||||
systemctl start restagent.service
|
systemctl start restagent.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ rm -f /usr/local/bin/omcd
|
|||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping PSAP service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping PSAP service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ database:
|
|||||||
password: 1000omc@kp!
|
password: 1000omc@kp!
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 33066
|
port: 33066
|
||||||
name: omc_db
|
name: psap_db
|
||||||
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
||||||
backup: /usr/local/omc/database
|
backup: /usr/local/omc/database
|
||||||
|
|
||||||
@@ -57,12 +57,6 @@ redis:
|
|||||||
host: "127.0.0.1" # Redis host
|
host: "127.0.0.1" # Redis host
|
||||||
password: "helloearth"
|
password: "helloearth"
|
||||||
db: 10 # Redis db_num
|
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
|
# used to specify the default data source for multiple data resourece
|
||||||
defaultDataSourceName: "default"
|
defaultDataSourceName: "default"
|
||||||
|
|
||||||
@@ -78,7 +72,7 @@ mml:
|
|||||||
|
|
||||||
# Tracking configuration
|
# Tracking configuration
|
||||||
trace:
|
trace:
|
||||||
enabled: true
|
enabled: false
|
||||||
host: "172.16.5.100" # Fill in the specific IP address
|
host: "172.16.5.100" # Fill in the specific IP address
|
||||||
port: 33033
|
port: 33033
|
||||||
|
|
||||||
@@ -109,7 +103,9 @@ omc:
|
|||||||
vendor: ""
|
vendor: ""
|
||||||
dn: ""
|
dn: ""
|
||||||
chk2ne: false
|
chk2ne: false
|
||||||
|
capability: 50
|
||||||
sn: "-"
|
sn: "-"
|
||||||
|
expiryDate: "-"
|
||||||
checksign: false
|
checksign: false
|
||||||
rootDir: /usr/local/omc
|
rootDir: /usr/local/omc
|
||||||
binDir: /usr/local/omc/bin
|
binDir: /usr/local/omc/bin
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Package: OMC
|
Package: OMC
|
||||||
Version: 2.2508.2-YYYYMMDD
|
Version: 1.2506.2-YYYYMMDD
|
||||||
Section: AGrandTech
|
Section: AGrandTech
|
||||||
Prioritt: optional
|
Prioritt: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ UsrLocalBinDir=/usr/local/bin
|
|||||||
OmcDaemon=omcd
|
OmcDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
NginxConfDir=${NginxEtcDir}/conf.d
|
NginxConfDir=${NginxEtcDir}/conf.d
|
||||||
CFileList=$(ls ${OMCEtcDir}/default)
|
CFileList="restconf.yaml sshsvc.yaml omc.conf"
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -47,7 +47,7 @@ fi
|
|||||||
|
|
||||||
for LogoFile in ${LogoFileList}; do
|
for LogoFile in ${LogoFileList}; do
|
||||||
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
||||||
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Starting OMC service ... "
|
echo -n "Starting PSAP service ... "
|
||||||
systemctl start sshsvc.service
|
systemctl start sshsvc.service
|
||||||
systemctl start restagent.service
|
systemctl start restagent.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ rm -f /usr/local/bin/omcd
|
|||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping PSAP service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
|
||||||
echo -n "Stopping OMC service ... "
|
echo -n "Stopping PSAP service ... "
|
||||||
systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -1,175 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
import pandas as pd
|
|
||||||
import json
|
|
||||||
import random
|
|
||||||
import os
|
|
||||||
import glob
|
|
||||||
|
|
||||||
def generate_pm_json(excel_file_path, output_file_path):
|
|
||||||
"""
|
|
||||||
从 Excel 文件中提取英文名称和空间粒度,生成 PM JSON 文件
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
# 检查文件是否存在
|
|
||||||
if not os.path.exists(excel_file_path):
|
|
||||||
print(f"错误:文件 {excel_file_path} 不存在")
|
|
||||||
return False
|
|
||||||
|
|
||||||
print(f"正在读取 Excel 文件: {excel_file_path}")
|
|
||||||
|
|
||||||
# 读取 Excel 文件的所有工作表
|
|
||||||
excel_data = pd.read_excel(excel_file_path, sheet_name=None)
|
|
||||||
|
|
||||||
# 使用字典按 granularity 分组
|
|
||||||
granularity_groups = {}
|
|
||||||
processed_sheets = 0
|
|
||||||
|
|
||||||
# 遍历所有工作表,查找包含"英文名称"列的表格
|
|
||||||
for sheet_name, df in excel_data.items():
|
|
||||||
print(f" 处理工作表: {sheet_name}")
|
|
||||||
|
|
||||||
# 检查是否包含"英文名称"列
|
|
||||||
if '英文名称' in df.columns:
|
|
||||||
processed_sheets += 1
|
|
||||||
print(f" - 找到英文名称列,共 {len(df)} 行数据")
|
|
||||||
|
|
||||||
# 检查是否有空间粒度列
|
|
||||||
granularity_col = None
|
|
||||||
for col in df.columns:
|
|
||||||
if '空间粒度' in str(col) or '粒度' in str(col):
|
|
||||||
granularity_col = col
|
|
||||||
break
|
|
||||||
|
|
||||||
# 用于记录当前sheet中最后一个不为空的空间粒度
|
|
||||||
last_valid_granularity = "DefaultFunction"
|
|
||||||
|
|
||||||
for index, row in df.iterrows():
|
|
||||||
english_name = row['英文名称']
|
|
||||||
|
|
||||||
# 跳过空值和非字符串值
|
|
||||||
if pd.notna(english_name) and str(english_name).strip() and str(english_name) != 'nan':
|
|
||||||
english_name = str(english_name).strip()
|
|
||||||
|
|
||||||
# 获取空间粒度信息
|
|
||||||
current_granularity = None
|
|
||||||
if granularity_col and pd.notna(row[granularity_col]):
|
|
||||||
current_granularity = str(row[granularity_col]).strip()
|
|
||||||
if current_granularity: # 确保不是空字符串
|
|
||||||
last_valid_granularity = current_granularity
|
|
||||||
|
|
||||||
# 如果当前行的空间粒度为空,使用最后一个有效的空间粒度
|
|
||||||
granularity = last_valid_granularity
|
|
||||||
|
|
||||||
# 生成随机值
|
|
||||||
random_value = random.randint(0, 16)
|
|
||||||
|
|
||||||
kpi = {
|
|
||||||
"KPIID": english_name,
|
|
||||||
"KPIValues": [
|
|
||||||
{
|
|
||||||
"Name": "Total",
|
|
||||||
"Value": random_value
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
# 按 granularity 分组
|
|
||||||
if granularity not in granularity_groups:
|
|
||||||
granularity_groups[granularity] = []
|
|
||||||
|
|
||||||
granularity_groups[granularity].append(kpi)
|
|
||||||
|
|
||||||
# 显示使用的粒度信息
|
|
||||||
granularity_info = ""
|
|
||||||
if current_granularity:
|
|
||||||
granularity_info = f" (当前: {granularity})"
|
|
||||||
else:
|
|
||||||
granularity_info = f" (继承: {granularity})"
|
|
||||||
|
|
||||||
print(f" 添加 KPI: {english_name} = {random_value}{granularity_info}")
|
|
||||||
else:
|
|
||||||
print(f" - 跳过(无英文名称列)")
|
|
||||||
|
|
||||||
# 生成最终的 JSON 结构
|
|
||||||
result = []
|
|
||||||
for granularity, kpis in granularity_groups.items():
|
|
||||||
result.append({
|
|
||||||
"ObjectType": granularity,
|
|
||||||
"KPIs": kpis
|
|
||||||
})
|
|
||||||
|
|
||||||
# 写入文件
|
|
||||||
with open(output_file_path, 'w', encoding='utf-8') as f:
|
|
||||||
json.dump(result, f, indent=4, ensure_ascii=False)
|
|
||||||
|
|
||||||
print(f" 成功生成文件: {output_file_path}")
|
|
||||||
print(f" 处理了 {processed_sheets} 个工作表")
|
|
||||||
print(f" 生成了 {len(granularity_groups)} 个对象类型")
|
|
||||||
for granularity, kpis in granularity_groups.items():
|
|
||||||
print(f" - {granularity}: {len(kpis)} 个 KPI")
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(f"错误: {str(e)}")
|
|
||||||
import traceback
|
|
||||||
traceback.print_exc()
|
|
||||||
return False
|
|
||||||
|
|
||||||
def main():
|
|
||||||
print("PM JSON 批量生成器")
|
|
||||||
print("=" * 60)
|
|
||||||
|
|
||||||
# 定义要处理的文件列表
|
|
||||||
pm_files = [
|
|
||||||
"AMF-PM(V1.1.5)-Company-Version00.xlsx",
|
|
||||||
"PCF-PM(V1.1.4)-Company-Version00.xlsx",
|
|
||||||
"SMF-PM(V1.2.1)-Company-Version00.xlsx",
|
|
||||||
"UDM-PM(V1.2.2)-Company-Version00.xlsx",
|
|
||||||
"UPF-PM(V1.2.1)-Company-Version00.xlsx"
|
|
||||||
]
|
|
||||||
|
|
||||||
# 也可以自动发现当前目录下的所有 PM Excel 文件
|
|
||||||
# pm_files = glob.glob("*-PM(*)-Company-Version*.xlsx")
|
|
||||||
|
|
||||||
successful_files = 0
|
|
||||||
failed_files = 0
|
|
||||||
|
|
||||||
for excel_file in pm_files:
|
|
||||||
print(f"\n处理文件: {excel_file}")
|
|
||||||
print("-" * 50)
|
|
||||||
|
|
||||||
# 检查文件是否存在
|
|
||||||
if not os.path.exists(excel_file):
|
|
||||||
print(f" 警告:文件 {excel_file} 不存在,跳过")
|
|
||||||
failed_files += 1
|
|
||||||
continue
|
|
||||||
|
|
||||||
# 生成输出文件名
|
|
||||||
base_name = os.path.splitext(excel_file)[0]
|
|
||||||
output_file = f"{base_name}-generated.json"
|
|
||||||
|
|
||||||
# 处理文件
|
|
||||||
if generate_pm_json(excel_file, output_file):
|
|
||||||
successful_files += 1
|
|
||||||
else:
|
|
||||||
failed_files += 1
|
|
||||||
|
|
||||||
# 汇总结果
|
|
||||||
print("\n" + "=" * 60)
|
|
||||||
print("批量处理完成!")
|
|
||||||
print(f"成功处理: {successful_files} 个文件")
|
|
||||||
print(f"失败/跳过: {failed_files} 个文件")
|
|
||||||
print(f"总计: {successful_files + failed_files} 个文件")
|
|
||||||
|
|
||||||
if successful_files > 0:
|
|
||||||
print("\n生成的文件列表:")
|
|
||||||
for excel_file in pm_files:
|
|
||||||
if os.path.exists(excel_file):
|
|
||||||
base_name = os.path.splitext(excel_file)[0]
|
|
||||||
output_file = f"{base_name}-generated.json"
|
|
||||||
if os.path.exists(output_file):
|
|
||||||
print(f" - {output_file}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -1,225 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"math/rand"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// KPIValue 表示单个 KPI 值
|
|
||||||
type KPIValue struct {
|
|
||||||
Name string `json:"Name"`
|
|
||||||
Value int `json:"Value"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// KPI 表示单个 KPI 项
|
|
||||||
type KPI struct {
|
|
||||||
KPIID string `json:"KPIID"`
|
|
||||||
KPIValues []KPIValue `json:"KPIValues"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// PMObject 表示性能管理对象
|
|
||||||
type PMObject struct {
|
|
||||||
ObjectType string `json:"ObjectType"`
|
|
||||||
KPIs []KPI `json:"KPIs"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// PMData 表示完整的性能管理数据
|
|
||||||
type PMData []PMObject
|
|
||||||
|
|
||||||
// generateRandomValue 生成 0-16 之间的随机数
|
|
||||||
func generateRandomValue() int {
|
|
||||||
return rand.Intn(17) // 0-16
|
|
||||||
}
|
|
||||||
|
|
||||||
// generatePMDataFromSchema 从 schema 文件生成随机数据
|
|
||||||
func generatePMDataFromSchema(schemaFile string, outputFile string) error {
|
|
||||||
// 读取 schema 文件
|
|
||||||
schemaData, err := os.ReadFile(schemaFile)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("读取 schema 文件失败: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解析 JSON
|
|
||||||
var pmSchema PMData
|
|
||||||
if err := json.Unmarshal(schemaData, &pmSchema); err != nil {
|
|
||||||
return fmt.Errorf("解析 JSON 失败: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生成新的随机数据
|
|
||||||
var newPMData PMData
|
|
||||||
for _, pmObj := range pmSchema {
|
|
||||||
newObj := PMObject{
|
|
||||||
ObjectType: pmObj.ObjectType,
|
|
||||||
KPIs: make([]KPI, len(pmObj.KPIs)),
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, kpi := range pmObj.KPIs {
|
|
||||||
newKPI := KPI{
|
|
||||||
KPIID: kpi.KPIID,
|
|
||||||
KPIValues: make([]KPIValue, len(kpi.KPIValues)),
|
|
||||||
}
|
|
||||||
|
|
||||||
for j, kpiVal := range kpi.KPIValues {
|
|
||||||
newKPI.KPIValues[j] = KPIValue{
|
|
||||||
Name: kpiVal.Name,
|
|
||||||
Value: generateRandomValue(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
newObj.KPIs[i] = newKPI
|
|
||||||
}
|
|
||||||
|
|
||||||
newPMData = append(newPMData, newObj)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 写入新文件
|
|
||||||
outputData, err := json.MarshalIndent(newPMData, "", " ")
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("序列化 JSON 失败: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := os.WriteFile(outputFile, outputData, 0644); err != nil {
|
|
||||||
return fmt.Errorf("写入文件失败: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("成功生成随机数据文件: %s\n", outputFile)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// generatePMDataFromMultipleSchemas 批量处理多个 schema 文件
|
|
||||||
func generatePMDataFromMultipleSchemas(schemaDir string) error {
|
|
||||||
// 查找所有 *-generated.json 文件
|
|
||||||
pattern := filepath.Join(schemaDir, "*-generated.json")
|
|
||||||
schemaFiles, err := filepath.Glob(pattern)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("查找 schema 文件失败: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(schemaFiles) == 0 {
|
|
||||||
return fmt.Errorf("未找到任何 schema 文件 (pattern: %s)", pattern)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("找到 %d 个 schema 文件\n", len(schemaFiles))
|
|
||||||
|
|
||||||
successCount := 0
|
|
||||||
failCount := 0
|
|
||||||
|
|
||||||
for _, schemaFile := range schemaFiles {
|
|
||||||
// 生成输出文件名:将 "-generated.json" 替换为 "-random.json"
|
|
||||||
outputFile := strings.Replace(schemaFile, "-generated.json", "-random.json", 1)
|
|
||||||
|
|
||||||
fmt.Printf("\n处理文件: %s\n", filepath.Base(schemaFile))
|
|
||||||
fmt.Printf("输出文件: %s\n", filepath.Base(outputFile))
|
|
||||||
|
|
||||||
if err := generatePMDataFromSchema(schemaFile, outputFile); err != nil {
|
|
||||||
fmt.Printf("错误: %v\n", err)
|
|
||||||
failCount++
|
|
||||||
} else {
|
|
||||||
successCount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("\n处理完成! 成功: %d, 失败: %d\n", successCount, failCount)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// printPMDataSummary 打印 PM 数据摘要信息
|
|
||||||
func printPMDataSummary(file string) error {
|
|
||||||
data, err := os.ReadFile(file)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
var pmData PMData
|
|
||||||
if err := json.Unmarshal(data, &pmData); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("\n文件: %s\n", filepath.Base(file))
|
|
||||||
fmt.Printf("对象类型数量: %d\n", len(pmData))
|
|
||||||
|
|
||||||
totalKPIs := 0
|
|
||||||
for _, obj := range pmData {
|
|
||||||
fmt.Printf(" - %s: %d 个 KPI\n", obj.ObjectType, len(obj.KPIs))
|
|
||||||
totalKPIs += len(obj.KPIs)
|
|
||||||
}
|
|
||||||
fmt.Printf("总 KPI 数量: %d\n", totalKPIs)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 示例用法函数
|
|
||||||
func main() {
|
|
||||||
// 设置随机种子
|
|
||||||
// rand.Seed(time.Now().UnixNano())
|
|
||||||
|
|
||||||
if len(os.Args) < 2 {
|
|
||||||
fmt.Println("用法:")
|
|
||||||
fmt.Println(" go run pm_generator.go <command> [args]")
|
|
||||||
fmt.Println("")
|
|
||||||
fmt.Println("命令:")
|
|
||||||
fmt.Println(" batch <directory> - 批量处理目录下的所有 *-generated.json 文件")
|
|
||||||
fmt.Println(" single <input> <output> - 处理单个文件")
|
|
||||||
fmt.Println(" summary <file> - 显示文件摘要信息")
|
|
||||||
fmt.Println("")
|
|
||||||
fmt.Println("示例:")
|
|
||||||
fmt.Println(" go run pm_generator.go batch .")
|
|
||||||
fmt.Println(" go run pm_generator.go single AMF-PM-generated.json AMF-PM-random.json")
|
|
||||||
fmt.Println(" go run pm_generator.go summary AMF-PM-random.json")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
command := os.Args[1]
|
|
||||||
|
|
||||||
switch command {
|
|
||||||
case "batch":
|
|
||||||
dir := "."
|
|
||||||
if len(os.Args) > 2 {
|
|
||||||
dir = os.Args[2]
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("PM 数据随机生成器 - 批量模式")
|
|
||||||
fmt.Println(strings.Repeat("=", 50))
|
|
||||||
|
|
||||||
if err := generatePMDataFromMultipleSchemas(dir); err != nil {
|
|
||||||
fmt.Printf("错误: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
case "single":
|
|
||||||
if len(os.Args) < 4 {
|
|
||||||
fmt.Println("用法: go run pm_generator.go single <input_file> <output_file>")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
inputFile := os.Args[2]
|
|
||||||
outputFile := os.Args[3]
|
|
||||||
|
|
||||||
fmt.Printf("处理单个文件: %s -> %s\n", inputFile, outputFile)
|
|
||||||
|
|
||||||
if err := generatePMDataFromSchema(inputFile, outputFile); err != nil {
|
|
||||||
fmt.Printf("错误: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
case "summary":
|
|
||||||
if len(os.Args) < 3 {
|
|
||||||
fmt.Println("用法: go run pm_generator.go summary <file>")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
file := os.Args[2]
|
|
||||||
if err := printPMDataSummary(file); err != nil {
|
|
||||||
fmt.Printf("错误: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
fmt.Printf("未知命令: %s\n", command)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# OMC->北向通信协议 基于redis stream消息队列实现
|
|
||||||
|
|
||||||
## 告警关联关系数据上报变更
|
|
||||||
|
|
||||||
alarm_relation告警新增时
|
|
||||||
|
|
||||||
* streamkey和数据格式
|
|
||||||
|
|
||||||
```json
|
|
||||||
alarm_relation
|
|
||||||
{
|
|
||||||
"payload": "{\"ids\":[\"871847\",\"557903\"]}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
1、871847,557903为alarm_relation表主键,至少一个数据
|
|
||||||
|
|
||||||
## 资源数据上报变更
|
|
||||||
|
|
||||||
nbi_cm表新增时
|
|
||||||
|
|
||||||
* streamkey和数据格式
|
|
||||||
|
|
||||||
```json
|
|
||||||
nbi_cm
|
|
||||||
{
|
|
||||||
"payload": "{\"ids\":[\"642470\",\"105633\"]}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
1、642470,105633为nbi_cm表主键ID,ID支持多个
|
|
||||||
|
|
||||||
## 1分钟性能订阅上报数据
|
|
||||||
|
|
||||||
kpi_report_*表新增时
|
|
||||||
|
|
||||||
* 数据格式
|
|
||||||
|
|
||||||
```json
|
|
||||||
nbi_pm
|
|
||||||
{
|
|
||||||
"payload": "{\"neType\":\"AMF\",\"id\":\"606538\"}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
1、AMF、PCF等为具体对应的网元
|
|
||||||
2、606538为kpi_report_amf、kpi_report_pcf等表主键ID,ID支持一个
|
|
||||||
402
docs/quickstart/01-PSAP OMC 安装指南.md
Normal 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.yaml,trace级别的日志通常在调试系统时使用,正常运行级别为debug,如下配置项所示:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
logger:
|
||||||
|
file: /usr/local/omc/log/restagent.log
|
||||||
|
level: debug
|
||||||
|
duration: 24
|
||||||
|
count: 90
|
||||||
|
```
|
||||||
|
|
||||||
|
OMC crontask程序的配置文件在crontask.yaml,trace级别的日志通常在调试系统时使用,正常运行级别为debug,如下配置项所示:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
logger:
|
||||||
|
file: /usr/local/omc/log/crontask.log
|
||||||
|
level: trace
|
||||||
|
duration: 24
|
||||||
|
count: 90
|
||||||
|
```
|
||||||
|
|
||||||
|
OMC sshsvc程序的配置文件在sshsvc.yaml,日志配置项如下所示:
|
||||||
|
|
||||||
|
```json
|
||||||
|
logger:
|
||||||
|
file: /usr/local/omc/log/sshsvc.log
|
||||||
|
level: debug
|
||||||
|
duration: 24
|
||||||
|
count: 30
|
||||||
|
```
|
||||||
|
|
||||||
|
OMC captrace程序的配置文件在capconf.yaml,日志配置项如下所示:
|
||||||
|
|
||||||
|
```json
|
||||||
|
logger:
|
||||||
|
file: /usr/local/omc/log/captrace.log
|
||||||
|
level: trace
|
||||||
|
duration: 24
|
||||||
|
count: 10
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5 管理核心网系统
|
||||||
|
|
||||||
|
通过浏览器输入:[http://192.168.0.229:8888](http://192.168.0.229:8888) (nginx代理模式)
|
||||||
|
|
||||||
|
或:http://192.168.0.229:8080 (非nginx代理模式)
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
-- 1. 建辅助数字表
|
|
||||||
DROP TABLE IF EXISTS tmp_num_100;
|
|
||||||
CREATE TABLE tmp_num_100 (n TINYINT UNSIGNED PRIMARY KEY);
|
|
||||||
INSERT INTO tmp_num_100(n)
|
|
||||||
SELECT a.n + b.n AS n FROM (
|
|
||||||
SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4
|
|
||||||
UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9
|
|
||||||
) a
|
|
||||||
CROSS JOIN (
|
|
||||||
SELECT 0 n UNION ALL SELECT 10 UNION ALL SELECT 20 UNION ALL SELECT 30 UNION ALL SELECT 40
|
|
||||||
UNION ALL SELECT 50 UNION ALL SELECT 60 UNION ALL SELECT 70 UNION ALL SELECT 80 UNION ALL SELECT 90
|
|
||||||
) b
|
|
||||||
ORDER BY a.n + b.n;
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS tmp_num_500;
|
|
||||||
CREATE TABLE tmp_num_500 (n SMALLINT UNSIGNED PRIMARY KEY);
|
|
||||||
INSERT INTO tmp_num_500(n)
|
|
||||||
SELECT t.n FROM (
|
|
||||||
SELECT @r:=@r+1 n
|
|
||||||
FROM (SELECT 0 FROM tmp_num_100) a,
|
|
||||||
(SELECT 0 FROM tmp_num_100) b,
|
|
||||||
(SELECT @r:=-1) init
|
|
||||||
LIMIT 500
|
|
||||||
) t;
|
|
||||||
|
|
||||||
-- 2. 目标表(若未建)
|
|
||||||
-- CREATE TABLE cdr_event_smsc (
|
|
||||||
-- id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
-- ne_type VARCHAR(16),
|
|
||||||
-- ne_name VARCHAR(64),
|
|
||||||
-- rm_uid VARCHAR(64),
|
|
||||||
-- `timestamp` BIGINT,
|
|
||||||
-- cdr_json JSON,
|
|
||||||
-- created_at DATETIME,
|
|
||||||
-- tenant_id VARCHAR(64)
|
|
||||||
-- ) ENGINE=InnoDB;
|
|
||||||
|
|
||||||
-- 3. 关闭一些约束提高插入速度(可选)
|
|
||||||
SET autocommit = 0;
|
|
||||||
SET unique_checks = 0;
|
|
||||||
SET foreign_key_checks = 0;
|
|
||||||
|
|
||||||
-- 4. 插入 500 万(100 * 100 * 500)
|
|
||||||
-- 随机时间:过去一年内的任意秒(不均匀)
|
|
||||||
SET @start_ts = UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 365 DAY));
|
|
||||||
SET @range_sec = 365 * 24 * 3600;
|
|
||||||
|
|
||||||
INSERT INTO cdr_event_smsc
|
|
||||||
(ne_type, ne_name, rm_uid, `timestamp`, cdr_json, created_at)
|
|
||||||
SELECT
|
|
||||||
'SMSC' AS ne_type,
|
|
||||||
'SMSC_001' AS ne_name,
|
|
||||||
'4400HXSMSC001' AS rm_uid,
|
|
||||||
@start_ts + FLOOR(RAND()*@range_sec) AS `timestamp`,
|
|
||||||
'{\"calledParty\":\"15731123455\",\"callerParty\":\"18165338055\",\"cause\":28,\"recordType\":\"MTSM\",\"result\":0,\"serviceType\":\"Normal\",\"updateTime\":\"2025-08-18T11:09:52.703Z\"}' AS cdr_json,
|
|
||||||
NOW() AS created_at
|
|
||||||
FROM tmp_num_100 a
|
|
||||||
CROSS JOIN tmp_num_100 b
|
|
||||||
CROSS JOIN tmp_num_500 c;
|
|
||||||
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
-- 5. 恢复
|
|
||||||
SET unique_checks = 1;
|
|
||||||
SET foreign_key_checks = 1;
|
|
||||||
SET autocommit = 1;
|
|
||||||
BIN
docs/requirement/PSAP-OPENAPI说明文档.docx
Normal file
BIN
docs/requirement/PSAP门户网站-20250319-V1.xlsx
Normal file
@@ -6,10 +6,9 @@
|
|||||||
%define project_lname omc
|
%define project_lname omc
|
||||||
%define project_Uname OMC
|
%define project_Uname OMC
|
||||||
|
|
||||||
|
|
||||||
Name: %{project_lname}
|
Name: %{project_lname}
|
||||||
Summary: 5GC OMC
|
Summary: 5GC OMC
|
||||||
Version: 2.2508.2
|
Version: 1.2506.2
|
||||||
Release: %{release_date}
|
Release: %{release_date}
|
||||||
Vendor: omc
|
Vendor: omc
|
||||||
URL: https://www.omc.com/
|
URL: https://www.omc.com/
|
||||||
@@ -29,13 +28,6 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/local/bin/*
|
|||||||
chmod +x ${RPM_BUILD_ROOT}/usr/local/omc/htdocs/front
|
chmod +x ${RPM_BUILD_ROOT}/usr/local/omc/htdocs/front
|
||||||
chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
|
chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
|
||||||
|
|
||||||
# 安装前执行
|
|
||||||
%pre
|
|
||||||
echo -n "Stopping OMC service ... "
|
|
||||||
systemctl stop restagent.service
|
|
||||||
systemctl stop sshsvc.service
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
# 安装完成后执行
|
# 安装完成后执行
|
||||||
%post
|
%post
|
||||||
OMCRootDir=/usr/local/omc
|
OMCRootDir=/usr/local/omc
|
||||||
@@ -46,13 +38,13 @@ OMCStaticDir=${OMCRootDir}/static
|
|||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
OMCDaemon=omcd
|
OMCDaemon=omcd
|
||||||
NginxEtcDir=/etc/nginx
|
NginxEtcDir=/etc/nginx
|
||||||
CFileList=$(ls ${OMCEtcDir}/default)
|
CFileList="restconf.yaml sshsvc.yaml omc.conf"
|
||||||
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
||||||
|
|
||||||
# echo -n "Stopping OMC service ... "
|
echo -n "Stopping OMC service ... "
|
||||||
# systemctl stop restagent.service
|
systemctl stop restagent.service
|
||||||
# systemctl stop sshsvc.service
|
systemctl stop sshsvc.service
|
||||||
# echo "done"
|
echo "done"
|
||||||
|
|
||||||
for CFile in ${CFileList}; do
|
for CFile in ${CFileList}; do
|
||||||
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
||||||
@@ -69,23 +61,18 @@ done
|
|||||||
if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; fi
|
if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; fi
|
||||||
for LogoFile in ${LogoFileList}; do
|
for LogoFile in ${LogoFileList}; do
|
||||||
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
||||||
cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
cp ${OMCStaticDir}/psap.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
|
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
|
||||||
mkdir -p /opt/omc/ftp
|
mkdir -p /opt/omc/ftp
|
||||||
mkdir -p /opt/omc/ftp/log
|
mkdir -p /opt/omc/ftp/log
|
||||||
|
cd ${UsrLocalBinDir}
|
||||||
if [ ! -e ${UsrLocalBinDir}/${OMCDaemon} ]; then
|
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
|
||||||
echo -n "Creating symbolic link ${UsrLocalBinDir}/${OMCDaemon} ... "
|
|
||||||
ln -s ${OMCBinDir}/omcsvc.sh ${UsrLocalBinDir}/${OMCDaemon};
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# setting firewall
|
# setting firewall
|
||||||
port_list="80 443 44080 44443 33030 33443 33066 6379 22222"
|
PortList="80 443 44080 44443 33030 22222"
|
||||||
for Port in ${port_list}; do
|
for Port in ${PortList}; do
|
||||||
echo -n "firewall-cmd add port ${Port} ... "
|
|
||||||
firewall-cmd --zone=public --add-port=${Port}/tcp --permanent
|
firewall-cmd --zone=public --add-port=${Port}/tcp --permanent
|
||||||
done
|
done
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
@@ -110,15 +97,22 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo -n "Starting OMC service ... "
|
echo -n "Starting OMC service ... "
|
||||||
# systemctl start sshsvc.service
|
systemctl start sshsvc.service
|
||||||
# systemctl start restagent.service
|
systemctl start restagent.service
|
||||||
# echo "done"
|
echo "done"
|
||||||
|
|
||||||
# 卸载时执行
|
# 卸载时执行
|
||||||
%postun
|
%postun
|
||||||
UsrLocalBinDir=/usr/local/bin
|
UsrLocalBinDir=/usr/local/bin
|
||||||
OMCDaemon=omcd
|
rm -f ${UsrLocalBinDir}/omcd
|
||||||
|
|
||||||
|
# setting firewall
|
||||||
|
PortList="80 443 44080 44443 33030 22222"
|
||||||
|
for Port in ${PortList}; do
|
||||||
|
firewall-cmd --zone=public --remove-port=${Port}/tcp --permanent
|
||||||
|
done
|
||||||
|
firewall-cmd --reload
|
||||||
|
|
||||||
if [ "$1" = "0" ] ; then
|
if [ "$1" = "0" ] ; then
|
||||||
sudo systemctl stop restagent.service
|
sudo systemctl stop restagent.service
|
||||||
@@ -128,22 +122,12 @@ if [ "$1" = "0" ] ; then
|
|||||||
sudo systemctl disable restagent.service
|
sudo systemctl disable restagent.service
|
||||||
sudo systemctl disable sshsvc.service
|
sudo systemctl disable sshsvc.service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
# setting firewall
|
|
||||||
port_list="80 443 44080 44443 33030 33443 33066 6379 22222"
|
|
||||||
for Port in ${port_list}; do
|
|
||||||
echo -n "firewall-cmd remove port ${Port} ... "
|
|
||||||
firewall-cmd --zone=public --remove-port=${Port}/tcp --permanent
|
|
||||||
done
|
|
||||||
firewall-cmd --reload
|
|
||||||
rm -f ${UsrLocalBinDir}/${OMCDaemon}
|
|
||||||
else
|
else
|
||||||
echo -n "Starting OMC service ... "
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl stop restagent.service
|
sudo systemctl stop restagent.service
|
||||||
sudo systemctl stop sshsvc.service
|
sudo systemctl stop sshsvc.service
|
||||||
sudo systemctl start sshsvc.service
|
sudo systemctl start sshsvc.service
|
||||||
sudo systemctl start restagent.service
|
sudo systemctl start restagent.service
|
||||||
echo "done"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 规定那些文件必须放入安装程序中,如果没有就报错
|
# 规定那些文件必须放入安装程序中,如果没有就报错
|
||||||
|
|||||||