Compare commits

...

36 Commits

Author SHA1 Message Date
AGT EMS
ea652d7254 feat: add smpp data coding schema smpp8dcs0Unpack7(19) 2025-06-19 17:31:39 +08:00
AGT EMS
f06f26c81b fix:... 2025-06-19 11:02:16 +08:00
AGT EMS
fbd48eb4ee fix: dos2unix some files 2025-06-19 10:48:08 +08:00
AGT EMS
6fee394db0 fix: opt install shell script 2025-06-18 16:14:09 +08:00
root
9ae7d50f73 add aas-config 2025-06-13 10:31:29 +08:00
root
c7523004bd new version-alarm lincense 2025-06-03 11:53:01 +08:00
root
5026cdb2b7 alarm 2025-05-09 18:56:04 +08:00
root
f744be8df8 ussd kpi and smlog cdr 2025-03-27 17:36:21 +08:00
lai
a74d97e221 增加ussd统计 2025-03-27 17:30:20 +08:00
lai
7f79b5abac 增加特殊情况 2025-03-07 17:49:16 +08:00
lai
b379a19aae 去除tapcvt 2025-02-27 11:26:16 +08:00
root
e9347a3ae0 smpp-c 2025-02-24 19:35:15 +08:00
root
cab9a32f96 tap-pre 2025-02-21 17:09:10 +08:00
root
48e5b94f1f tap-cdr.c 2025-01-22 21:53:19 +08:00
root
6d9e440ec8 add MSC-CDR 2025-01-03 18:35:27 +08:00
lai
8ef1414ea3 DEBUG 2024-12-18 18:27:55 +08:00
lai
a1c7b3d2dd DEBUG 2024-12-18 17:52:16 +08:00
lai
230812d6e1 SGSN特殊处理 2024-12-18 16:23:10 +08:00
lai
6e7d29edad 取消打印 2024-11-20 15:04:47 +08:00
48f0493d4e add:spgw kpi 2024-11-14 17:17:48 +08:00
2e658c5839 ... 2024-11-11 18:17:16 +08:00
236f1937a6 init git attributes 2024-11-11 18:12:33 +08:00
agtuser
530f9116ae init 2024-11-11 17:55:10 +08:00
91fb7cf944 ... 2024-10-22 10:28:41 +08:00
8dc85066da re-init mian branch 2024-10-22 10:26:32 +08:00
5e9fabfc23 re-init mian branch 2024-10-22 10:26:18 +08:00
25ce1a5d4a .. 2024-10-21 09:28:47 +08:00
9472b7d3e3 ... 2024-10-21 09:26:25 +08:00
0e2ed9cbb0 ... 2024-10-19 18:49:51 +08:00
9e94735d95 .. 2024-10-19 18:47:25 +08:00
agtuser
a95266652b chmod 755 2024-10-19 18:43:26 +08:00
54ffb086e4 ... 2024-10-19 18:41:02 +08:00
8eb8329d45 ... 2024-10-19 18:40:34 +08:00
7ac790cc51 ... 2024-10-19 18:37:28 +08:00
5b74cd26bd ... 2024-10-19 18:36:47 +08:00
bb3ffe4658 ... 2024-10-19 18:35:15 +08:00
29 changed files with 1794 additions and 1840 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto

157
.gitignore vendored
View File

@@ -1,76 +1,81 @@
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
.idea/
# Run temp file and dir
# Built Visual Studio Code Extensions
*.o
*.a
*.vsix
*.log
*.log-*
*.bak
*.bak*
*.exe
__debug_bin*.exe
# bin file
bin/iptrans
bin/alive
bin/bsscomm
bin/cdrCollector
bin/ftpSend
bin/nrtrde
bin/sftpSend
bin/smcli
bin/subsComm
bin/subsDataBackup
bin/wsms
bin/paraComm
bin/alarmAgent
bin/alarmGenerator
bin/beatProc
bin/beatSend
bin/raidAgent
bin/statTest
bin/ftpclient
bin/omcLibTest
bin/omcMain
bin/cstaCollector
bin/logCollector
bin/omcCleaner
plat/iptrans/iptrans
src/configMgr/c_program/impmod/alive
src/configMgr/c_program/impmod/bsscomm
src/accountMgr/c_program/cdrCollector/cdrCollector
src/accountMgr/c_program/ftpsend/ftpSend
src/accountMgr/c_program/nrtrde/nrtrde
src/accountMgr/c_program/sftpSend/sftpSend
src/accountMgr/c_program/smcli/smcli
src/accountMgr/c_program/subsComm/subsComm
src/accountMgr/c_program/subsDataBackup/subsDataBackup
src/accountMgr/c_program/wsms/wsms
src/configMgr/c_program/paraComm/paraComm
src/faultMgr/c_program/alarmAgent/alarmAgent
src/faultMgr/c_program/alarmGenerator/alarmGenerator
src/faultMgr/c_program/beatProc/beatProc
src/faultMgr/c_program/beatSend/beatSend
src/faultMgr/c_program/raidAgent/raidAgent
src/faultMgr/c_program/sysStat/statTest
src/omcLib/c_program/ftp/ftpclient
src/omcLib/c_program/omcLib/omcLibTest
src/omcMain/c_program/omcMain/omcMain
src/performanceMgr/c_program/cstaCollector/cstaCollector
src/performanceMgr/c_program/logCollector/logCollector
src/securityMgr/c_program/omcCleaner/omcCleaner
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
.idea/
# Run temp file and dir
# Built Visual Studio Code Extensions
*.o
*.o.ES
*.a
*.vsix
*.log
*.log-*
*.bak
*.bak*
*.exe
__debug_bin*.exe
*.swp
# bin file
bin/iptrans
bin/alive
bin/bsscomm
bin/cdrCollector
bin/ftpSend
bin/nrtrde
bin/sftpSend
bin/smcli
bin/subsComm
bin/subsDataBackup
bin/wsms
bin/paraComm
bin/initKeys
bin/parseResult
bin/sendfile
bin/alarmAgent
bin/alarmGenerator
bin/beatProc
bin/beatSend
bin/raidAgent
bin/statTest
bin/ftpclient
bin/omcLibTest
bin/omcMain
bin/cstaCollector
bin/logCollector
bin/omcCleaner
plat/iptrans/iptrans
src/configMgr/c_program/impmod/alive
src/configMgr/c_program/impmod/bsscomm
src/accountMgr/c_program/cdrCollector/cdrCollector
src/accountMgr/c_program/ftpsend/ftpSend
src/accountMgr/c_program/nrtrde/nrtrde
src/accountMgr/c_program/sftpSend/sftpSend
src/accountMgr/c_program/smcli/smcli
src/accountMgr/c_program/subsComm/subsComm
src/accountMgr/c_program/subsDataBackup/subsDataBackup
src/accountMgr/c_program/wsms/wsms
src/configMgr/c_program/paraComm/paraComm
src/faultMgr/c_program/alarmAgent/alarmAgent
src/faultMgr/c_program/alarmGenerator/alarmGenerator
src/faultMgr/c_program/beatProc/beatProc
src/faultMgr/c_program/beatSend/beatSend
src/faultMgr/c_program/raidAgent/raidAgent
src/faultMgr/c_program/sysStat/statTest
src/omcLib/c_program/ftp/ftpclient
src/omcLib/c_program/omcLib/omcLibTest
src/omcMain/c_program/omcMain/omcMain
src/performanceMgr/c_program/cstaCollector/cstaCollector
src/performanceMgr/c_program/logCollector/logCollector
src/securityMgr/c_program/omcCleaner/omcCleaner

View File

@@ -20,6 +20,7 @@ alarmAgent -d
nrtrde -d
sftpSend -d
cstaCollector -d
[slave_task]
iptrans -d
paraComm -d

11
bin/conf/tap.cfg Normal file
View File

@@ -0,0 +1,11 @@
[local]
name=NFK
prefix=CD
currency=USD
utc_offset=+1200
tap_path=/opt
[partners]
name=PLWPC
plmnid=46000
place=CHINA
currency=CNY

View File

@@ -1,32 +0,0 @@
#!/usr/bin/expect
#This script use to init the server keys, it rewrite the known_hosts config file
#This script have 3 parameters
#remoteip: the ip of the remote server
#username: the name for logging in
#userpass: the password for logging in
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set timeout 5
spawn sftp $username@$remoteip
expect "*(yes/no)?*"
send "yes\n"
expect "*password*"
send "$userpass\n"
expect "*sftp>*"
send "quit\n"
expect eof
exit

View File

@@ -75,9 +75,30 @@
"Description."
::= { msc 1 }
-- 1.3.6.1.4.1.1373.2.3.3.1.99
control OBJECT IDENTIFIER ::= { msc 99 }
-- 1.3.6.1.4.1.1373.2.3.3.1.99.2
neSystem OBJECT IDENTIFIER ::= { control 2 }
-- 1.3.6.1.4.1.1373.2.3.3.1.99.2.1
config OBJECT IDENTIFIER ::= { neSystem 1 }
-- 1.3.6.1.4.1.1373.2.3.3.1.99.2.1.2
licenseUpdate OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Description."
::= { config 2 }
-- 1.3.6.1.4.1.1373.1.3.3.2.2
-- 1.3.6.1.4.1.1373.2.3.3.1.2
parameter OBJECT IDENTIFIER ::= { msc 2 }

View File

@@ -71,7 +71,26 @@
"Description."
::= { pps 1 }
-- 1.3.6.1.4.1.1373.2.3.3.6.99
control OBJECT IDENTIFIER ::= { pps 99 }
-- 1.3.6.1.4.1.1373.2.3.3.6.99.2
neSystem OBJECT IDENTIFIER ::= { control 2 }
-- 1.3.6.1.4.1.1373.2.3.3.6.99.2.1
config OBJECT IDENTIFIER ::= { neSystem 1 }
-- 1.3.6.1.4.1.1373.2.3.3.6.99.2.1.2
licenseUpdate OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Description."
::= { config 2 }
-- 1.3.6.1.4.1.1373.1.3.3.2.2
-- 1.3.6.1.4.1.1373.2.3.3.6.2
parameter OBJECT IDENTIFIER ::= { pps 2 }

View File

@@ -74,6 +74,26 @@
"Description."
::= { smsc 1 }
-- 1.3.6.1.4.1.1373.2.3.3.5.99
control OBJECT IDENTIFIER ::= { smsc 99 }
-- 1.3.6.1.4.1.1373.2.3.3.5.99.2
neSystem OBJECT IDENTIFIER ::= { control 2 }
-- 1.3.6.1.4.1.1373.2.3.3.5.99.2.1
config OBJECT IDENTIFIER ::= { neSystem 1 }
-- 1.3.6.1.4.1.1373.2.3.3.5.99.2.1.2
licenseUpdate OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Description."
::= { config 2 }
-- 1.3.6.1.4.1.1373.1.3.3.2.2
-- 1.3.6.1.4.1.1373.2.3.3.5.2
@@ -432,7 +452,8 @@
smpp8dcs0def7(2),
smpp7def8(16),
smpp8dcs4def8(17),
smpp8dcs0def8(18)
smpp8dcs0def8(18),
smpp8dcs0Unpack7(19)
}
MAX-ACCESS read-write
STATUS current
@@ -528,8 +549,15 @@
::= { sMPPEntry 10 }
-- 1.3.6.1.4.1.1373.2.3.3.5.2.3.1.1.11
smppRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Key Parameter:Yes"
::= { sMPPEntry 11 }
-- 1.3.6.1.4.1.1373.2.3.3.5.2.3.1.1.12
smppRoleType OBJECT-TYPE
SYNTAX INTEGER
{
@@ -541,30 +569,9 @@
DESCRIPTION
"Key Parameter:Yes Name:Role Type
Remark:Specify the role type of local SMPP entity"
::= { sMPPEntry 11 }
-- 1.3.6.1.4.1.1373.2.3.3.5.2.3.1.1.12
smppRerouteInd OBJECT-TYPE
SYNTAX INTEGER
{
disable(0),
enable(1)
}
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Key Parameter:Yes Name:Reroute Indication
Remark:Specify the reroute indication of local SMPP entity"
::= { sMPPEntry 12 }
-- 1.3.6.1.4.1.1373.2.3.3.5.2.3.1.1.13
smppRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Key Parameter:Yes"
::= { sMPPEntry 13 }
END
--

View File

@@ -1,31 +0,0 @@
#!/bin/sh
#This script parse the result.txt file
#to judge whether the operation of sending file is successful
#The local do not have the Permission to access the remote directory
if [ `grep -c "handle" /tmp/result$1.txt` -gt 0 ] ; then
`echo 4 >/tmp/temp$1.txt`
#echo "The local do not have the Permission to access the remote directory"
exit
fi
#The name or the password is not fit
if [ `grep -c "Permission denied" /tmp/result$1.txt` -gt 0 ] ; then
`echo 2 >/tmp/temp$1.txt`
#echo "The name or the password is not fit"
exit
fi
#Successful
if [ `grep -c "100%" /tmp/result$1.txt` -gt 0 ] ; then
`echo 0 >/tmp/temp$1.txt`
#echo "Send the file successfully"
exit
fi
#The remote server is unavailable
`echo 1 >/tmp/temp$1.txt`
#echo "The remote server is unavailable"
exit

View File

@@ -1,32 +0,0 @@
#!/usr/bin/expect
#This script interative with the remote server, and send the file to it
#This script have 6 parameters
#remoteip: the ip of the remote server
#username: the name for logining in
#userpass: the password for logining in
#resdir: the directory to store the files
#sendfile: the file to send to the remote server
#desdir: the directory to send the files
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set resdir [lindex $argv 3]
set sendfile [lindex $argv 4]
set desdir [lindex $argv 5]
set timeout 120
spawn sftp $username@$remoteip
expect "yes/no" {send "yes\n"; expect "*assword: "} "*assword: "
send "$userpass\n"
expect "*sftp>*"
send "cd $desdir\n"
send "lcd $resdir\n"
send "put $sendfile\n"
expect "*100%*"
exit

View File

@@ -184,7 +184,9 @@ case "$runMode" in
hostName='single'
#my.conf
mv -f /etc/my.cnf /etc/my.cnf_bak
if [ -f /etc/my.cnf ] ; then
mv -f /etc/my.cnf /etc/my.cnf_bak
fi
cp -f ../config/mariadb-50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf
chmod 644 /etc/mysql/mariadb.conf.d/50-server.cnf
echo "set configuration file: /etc/mysql/mariadb.conf.d/50-server.cnf ok!"

BIN
bin/tapcvt Normal file

Binary file not shown.

View File

@@ -44,8 +44,6 @@
## TEST_OBJ_PATH = [module object files Path for test ] => just for test
##---------------------------------------------------------------------##
MODULE = 8ecp
TYPE = plat

View File

@@ -1,7 +1,7 @@
# Makefile for platform of EMS
PLATDIR = ../plat
BINDIR = ../bin
PLATDIR = $(shell pwd)
BINDIR = $(PLATDIR)/../bin
PLATMODULELIST = 8ecp aif bicc debug haepub iptrans isdn isup m2ua mgc mgcp mgc_v2 mtp3 pal public rtp sccp scf sip smpp snmp tcap xapp
.PHONY: all $(PLATMODULELIST) clean
@@ -14,6 +14,7 @@ $(PLATMODULELIST):
@echo "====================== make $@ ======================="
@cd $(PLATDIR)/$@ && $(MAKE)
@if [ $@ = "iptrans" ]; then \
cd $(PLATDIR)/$@; \
./mkiptrans.sh; \
cp -f ./iptrans $(BINDIR); \
fi

View File

@@ -1,3 +1,4 @@
#!/bin/bash
#gcc -o iptrans ./src/iptrmain.c -Llib/ -liptrans -L../debug/lib -ldebug -lcurses -L../snmp/lib -lsnmp -L../public/lib -lpublic -lm
gcc -o iptrans ./src/iptrmain.c -Llib/ -liptrans -L../debug/lib -ldebug -L../snmp/lib -lsnmp -L../public/lib -lpublic -lm
#!/bin/bash
#gcc -o iptrans ./src/iptrmain.c -Llib/ -liptrans -L../debug/lib -ldebug -lcurses -L../snmp/lib -lsnmp -L../public/lib -lpublic -lm
gcc -o iptrans ./src/iptrmain.c -Llib/ -liptrans -L../debug/lib -ldebug -L../snmp/lib -lsnmp -L../public/lib -lpublic -lm

View File

@@ -82,6 +82,8 @@ BYTE str2oid(char *str, DWORD * array, BYTE max);
char *bcd2str(BYTE* buf,int len);
int smsDecodeAll(int code_type,char* strIn,char* strOut,int length);
char* digits2str(BYTE* buf,int len);
char* askm2str(BYTE* buf,int len);
void test()
{
@@ -767,6 +769,9 @@ void create_record_table(cdr_src *psrc,MYSQL *pCdrConn)
sprintf(tmpstr,"TEXT");
strcat(createfieldlist,tmpstr);
break;
case 42: // 假设这是一个字符串类型的字段
strcat(createfieldlist, "VARCHAR(30)"); // 或者根据需要调整长度
break;
//integer
case 1:
//unsigned integer
@@ -1442,9 +1447,22 @@ void cdr_parse(cdr_sys *psys,int tagcode,ASN_BUF *asnbuf,int fieldIndex,char* fi
case 4:
if((len = get_tlv(pdef->fields[fieldIndex].tags[tagcode],tempbyte,asnbuf)) > 0)
{
//opps need cc
if(psrc->sysTypeNo == 375)
sprintf(fieldstr,",'%s'",digits2str(tempbyte,len * 2));
if (psrc->sysTypeNo == 375) {
sprintf(fieldstr, ",'%s'", digits2str(tempbyte, len * 2));
} else if ((psrc->sysTypeNo == 320 && !strcmp(pdef->fields[fieldIndex].tags[tagcode], "7.12")) ||
(psrc->sysTypeNo == 351 &&
(!strcmp(pdef->fields[fieldIndex].tags[tagcode], "0.1") ||
!strcmp(pdef->fields[fieldIndex].tags[tagcode], "0.2")))) {
if (tempbyte[0] == 0x91 || tempbyte[0] == 0x81 || tempbyte[0] == 0xa1) {
sprintf(fieldstr, ",'%s'", digits2str(tempbyte + 1, (len - 1) * 2));
} else {
// 阿斯克码值
sprintf(fieldstr, ",'%s'", askm2str(tempbyte, len * 2));
}
}
else
sprintf(fieldstr,",'%s'",digits2str(tempbyte + 1,(len - 1) * 2));
}
@@ -1714,7 +1732,16 @@ void cdr_parse(cdr_sys *psys,int tagcode,ASN_BUF *asnbuf,int fieldIndex,char* fi
sprintf(fieldstr,",NULL");
}
break;
case 42:
if((len = get_tlv(pdef->fields[fieldIndex].tags[tagcode], tempbyte, asnbuf)) > 0)
{
sprintf(fieldstr, ",'%d.%d.%d.%d'", tempbyte[0], tempbyte[1], tempbyte[2], tempbyte[3]);
}
else
{
sprintf(fieldstr, ",NULL");
}
break;
}
}
@@ -1952,6 +1979,22 @@ char* digits2str(BYTE* buf,int len)
return dig;
}
char* askm2str(BYTE* buf, int len) {
static char str[512];
int i;
for (i = 0; i < 512; i++) {
str[i] = '\0';
}
for (i = 0; i < len; i++) {
str[i] = buf[i];
}
str[len] = '\0';
return str;
}
// Extra function
int sendHeartbeat()
{

View File

@@ -1265,7 +1265,11 @@ void clear_table(char *table_name)
cdr_log("[ERR %d][clear_table]:Can not connect to CDR_DB",mysql_errno(pubConn));
return;
}
sprintf(mng_sqlstr,"delete from CDR_DB.%s WHERE TO_DAYS(releaseTime)<TO_DAYS(NOW());",table_name);
if(mysql_getnores(pubConn,mng_sqlstr) != 0)
cdr_log("[ERR %d][clear_table]:%s",mysql_errno(pubConn),mng_sqlstr);
else

View File

@@ -1,32 +1,32 @@
#!/usr/bin/expect
#This script use to init the server keys, it rewrite the known_hosts config file
#This script have 3 parameters
#remoteip: the ip of the remote server
#username: the name for logging in
#userpass: the password for logging in
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set timeout 5
spawn sftp $username@$remoteip
expect "*(yes/no)?*"
send "yes\n"
expect "*password*"
send "$userpass\n"
expect "*sftp>*"
send "quit\n"
expect eof
exit
#!/usr/bin/expect
#This script use to init the server keys, it rewrite the known_hosts config file
#This script have 3 parameters
#remoteip: the ip of the remote server
#username: the name for logging in
#userpass: the password for logging in
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set timeout 5
spawn sftp $username@$remoteip
expect "*(yes/no)?*"
send "yes\n"
expect "*password*"
send "$userpass\n"
expect "*sftp>*"
send "quit\n"
expect eof
exit

View File

@@ -1,31 +1,31 @@
#!/bin/sh
#This script parse the result.txt file
#to judge whether the operation of sending file is successful
#The local do not have the Permission to access the remote directory
if [ `grep -c "handle" /tmp/result$1.txt` -gt 0 ] ; then
`echo 4 >/tmp/temp$1.txt`
#echo "The local do not have the Permission to access the remote directory"
exit
fi
#The name or the password is not fit
if [ `grep -c "Permission denied" /tmp/result$1.txt` -gt 0 ] ; then
`echo 2 >/tmp/temp$1.txt`
#echo "The name or the password is not fit"
exit
fi
#Successful
if [ `grep -c "100%" /tmp/result$1.txt` -gt 0 ] ; then
`echo 0 >/tmp/temp$1.txt`
#echo "Send the file successfully"
exit
fi
#The remote server is unavailable
`echo 1 >/tmp/temp$1.txt`
#echo "The remote server is unavailable"
exit
#!/bin/sh
#This script parse the result.txt file
#to judge whether the operation of sending file is successful
#The local do not have the Permission to access the remote directory
if [ `grep -c "handle" /tmp/result$1.txt` -gt 0 ] ; then
`echo 4 >/tmp/temp$1.txt`
#echo "The local do not have the Permission to access the remote directory"
exit
fi
#The name or the password is not fit
if [ `grep -c "Permission denied" /tmp/result$1.txt` -gt 0 ] ; then
`echo 2 >/tmp/temp$1.txt`
#echo "The name or the password is not fit"
exit
fi
#Successful
if [ `grep -c "100%" /tmp/result$1.txt` -gt 0 ] ; then
`echo 0 >/tmp/temp$1.txt`
#echo "Send the file successfully"
exit
fi
#The remote server is unavailable
`echo 1 >/tmp/temp$1.txt`
#echo "The remote server is unavailable"
exit

View File

@@ -1,34 +1,34 @@
#!/usr/bin/expect
#This script interative with the remote server, and send the file to it
#This script have 6 parameters
#remoteip: the ip of the remote server
#username: the name for logining in
#userpass: the password for logining in
#resdir: the directory to store the files
#sendfile: the file to send to the remote server
#desdir: the directory to send the files
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set resdir [lindex $argv 3]
set sendfile [lindex $argv 4]
set desdir [lindex $argv 5]
set timeout 120
spawn sftp $username@$remoteip
expect "yes/no" {send "yes\n"; expect "*assword: "} "*assword: "
send "$userpass\n"
expect "*sftp>*"
send "cd $desdir\n"
send "lcd $resdir\n"
send "put $sendfile\n"
expect "*100%*"
exit
#!/usr/bin/expect
#This script interative with the remote server, and send the file to it
#This script have 6 parameters
#remoteip: the ip of the remote server
#username: the name for logining in
#userpass: the password for logining in
#resdir: the directory to store the files
#sendfile: the file to send to the remote server
#desdir: the directory to send the files
set remoteip [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]
set resdir [lindex $argv 3]
set sendfile [lindex $argv 4]
set desdir [lindex $argv 5]
set timeout 120
spawn sftp $username@$remoteip
expect "yes/no" {send "yes\n"; expect "*assword: "} "*assword: "
send "$userpass\n"
expect "*sftp>*"
send "cd $desdir\n"
send "lcd $resdir\n"
send "put $sendfile\n"
expect "*100%*"
exit

View File

@@ -788,6 +788,8 @@ int sendFile(char *remoteip, char *username, char *userpass, char *srcdir, char
//Use the expect script to send the file by sftp
sprintf(command,"expect sendfile %s %s %s %s %s %s 1>/tmp/result%d.txt 2>/dev/null",remoteip,username,userpass,srcdir,filename,desdir,fileIndex);
sprintf(message,"command %s \n",command);
logMessage(message);
system(command);
//Use the parseResult script to parse the result of sending file
@@ -801,6 +803,9 @@ int sendFile(char *remoteip, char *username, char *userpass, char *srcdir, char
sprintf(command,"rm -rf /tmp/result%d.txt",fileIndex);
system(command);
sprintf(message,"SendFile()---The result is %d\n",res);
logMessage(message);
//printf("SendFile()---The result is %d\n",res);
if(res==0)
@@ -841,6 +846,8 @@ int sendFile(char *remoteip, char *username, char *userpass, char *srcdir, char
}
//printf("%s\n",message);
sprintf(command,"rm -rf /tmp/temp%d.txt",fileIndex);
sprintf(message,"rm command %s \n",command);
logMessage(message);
system(command);
return res;

View File

@@ -64,8 +64,8 @@ linux72: $(PARACOMM_OBJ) $(LIB_OBJ)
linuxES: $(PARACOMM_OBJ.ES) $(LIB_OBJ.ES)
@echo Linking $(PROGS)
@$(LINK.c.ES) -o $(PROGS) $(PARACOMM_OBJ.ES) $(LINKFLAG.ES) -lm
ar r libparaComm.a $(LIB_OBJ.ES)
@$(LINK.c.ES) -o $(PROGS) $(PARACOMM_OBJ) $(LINKFLAG.ES) -lm
ar r libparaComm.a $(LIB_OBJ)
installbin: linuxES
cp -f $(PROGS) ../../../../bin/
@@ -85,13 +85,13 @@ initParaConf.o: initParaConf.c
$(COMPILE.c) -c initParaConf.c
paraCommMain.o.ES: paraCommMain.c
$(COMPILE.c.ES) -c paraCommMain.c -o paraCommMain.o.ES
$(COMPILE.c.ES) -c paraCommMain.c # -o paraCommMain.o.ES
paraComm.o.ES: paraComm.c
$(COMPILE.c.ES) -c paraComm.c -o paraComm.o.ES
$(COMPILE.c.ES) -c paraComm.c # -o paraComm.o.ES
initParaConf.o.ES: initParaConf.c
$(COMPILE.c.ES) -c initParaConf.c -o initParaConf.o.ES
$(COMPILE.c.ES) -c initParaConf.c # -o initParaConf.o.ES
clean:
rm -f *.o *.o.ES *.a $(PROGS)

View File

@@ -112,7 +112,7 @@ int checkPlatHasSubSysNo(int sysTypeNo,int sysNo)
{
// modified by simon at 2024/04/12
//if(sysNo != 9)
if (sysNo != 9 && sysNo != 3 && sysNo != 5 && sysNo != 6 ) // 9-MSS,3-HLR,5-OCS/PPS,6-SMSC
if (sysNo != 9 && sysNo != 3 && sysNo != 5 && sysNo != 6 && sysNo != 11) // 9-MSS,3-HLR,5-OCS/PPS,6-SMSC 11-AAS
{
switch(sysTypeNo)
{

View File

@@ -10,6 +10,8 @@ BYTE parseoid(char *str, DWORD * array, BYTE max);
char *oidtostr(DWORD* oid,int oidlen,char *output);
static char beatproc_sqlstr[8192];
static char beatprocInfo_sqlstr[8192];
static char state_str[MAX_MSG_LEN];
static _sys_conf sys_conf[MAX_SYS_CONF];
static int sys_conf_count=0;
@@ -257,70 +259,198 @@ void localBeatRecv(BYTE oidLen, DWORD *oidArr, BYTE *pdata,WORD dataLen,snmp_add
}
}
}*/
//another omc
if(psysconf->systypeno == 0)
{
if(oidArr[7] == 2 && oidArr[8] == 4 && oidArr[9] == 10)
//check oidlen
// if(oidLen > oidArr[psysconf->prefixoidlen]+1)
// {
// //ems_debug(BEATPROC_DEBUG_LOGFILE,"The length of oid is big");
// return;
// }
// <20><><EFBFBD><EFBFBD><EFBFBD>澯 Trap (OID <20><> .8 <20><>β)
if (oidArr[psysconf->prefixoidlen] == 8)
{
update_ems_process_state(oidArr,pdata);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Trap (OID <20><> .2 <20><>β)
// <20><>ӡ pdata <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// char pdatastring[256] = {0};
// char tmpstr[16];
// for (int j = 0; j < dataLen; j++)
// {
// sprintf(tmpstr, "%02X ", pdata[j]);
// strcat(pdatastring, tmpstr);
// }
// char oidstring[256] = {0};
// oidtostr(oidArr, oidLen, oidstring);
// ems_debug(BEATPROC_DEBUG_LOGFILE, "Received alarm trap OID: %s, data: %s", oidstring, pdatastring);
sysno=pdata[0];
subsysno=pdata[1];
if(sysno >= psysconf->maxsysnum || subsysno >= psysconf->maxsubsysnum)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"System %s sysno or subsysno is too big,[%d,%d] > [%d,%d]",psysconf->systypename,sysno,subsysno,psysconf->maxsysnum,psysconf->maxsubsysnum);
return;
}
for(i=0;i<4;i++)
{
//ems_debug(BEATPROC_DEBUG_LOGFILE,"pdata[39+%d]:%d",i,(int *)pdata[39+i]);
//ems_debug(BEATPROC_DEBUG_LOGFILE,"beatProcSequenceNum[%d]:%d",i,(int)beatProcSequenceNum[i]);
if(pdata[39+i] != beatProcSequenceNum[i])
// <20><>ȡʱ<C8A1><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3-6 <20>ֽڣ<D6BD>
unsigned long alarmTime = (pdata[2] << 24) | (pdata[3] << 16) | (pdata[4] << 8) | pdata[5];
// <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD> alarmId
char alarmIdStr[32];
sprintf(alarmIdStr, "%lu", alarmTime);
// ת<><D7AA>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊʱ<CEAA><CAB1><EFBFBD><EFBFBD>ʽ
char alarmTimeStr[20]; // <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
time_t alarmTime_t = (time_t)alarmTime;
strftime(alarmTimeStr, sizeof(alarmTimeStr), "%Y-%m-%d %H:%M:%S", localtime(&alarmTime_t));
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
int clearMode = pdata[6]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int compCode = pdata[8]; // <20><><EFBFBD><EFBFBD> ID
int alarmCode = pdata[9]; // <20><EFBFBD><E6BEAF>
// <20><>ȡ<EFBFBD><EFBFBD><E6BEAF>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> 11 <20>ֽڿ<D6BD>ʼ<EFBFBD><CABC>
char alarmInfo[256] = {0};
memcpy(alarmInfo, &pdata[10], dataLen - 10); // ʣ<><CAA3><EFBFBD>ֽ<EFBFBD>Ϊ<EFBFBD><EFBFBD><E6BEAF>Ϣ
MYSQL *pubConn = mysql_conn("localhost","OMC_PUB");
if (pubConn == NULL)
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "Connect to OMC_PUB fail");
return;
}
// <20><><EFBFBD><EFBFBD> SQL <20><><EFBFBD><EFBFBD>
if (clearMode == 0)
{
// <20><><EFBFBD><EFBFBD><EFBFBD>
sprintf(beatproc_sqlstr,
"UPDATE sysAlarmInfo SET clearTime=CURRENT_TIMESTAMP, clearMode=0, clearBy='System' "
"WHERE sysTypeNo=%d AND sysNo=%d AND subSysNo=%d AND compCode=%d AND alarmCode=%d AND clearMode=1 AND alarmId='%s';",
psysconf->systypeno, sysno, subsysno, compCode, alarmCode, alarmIdStr);
if (mysql_getnores(pubConn, beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "[SQL ERR], %s", beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "Alarm cleared: %s", beatproc_sqlstr);
}
mysql_close(pubConn);
return;
}
else if (clearMode == 1)
{
// <20><><EFBFBD><EFBFBD><EFBFBD>
sprintf(beatproc_sqlstr,
"INSERT INTO sysAlarmInfo (sysTypeNo, sysNo, subSysNo, compCode, alarmCode, alarmTime, clearTime, clearMode, alarmId, alarmInfo) "
"VALUES (%d, %d, %d, %d, %d, '%s', '0000-00-00 00:00:00', 1, '%s', '%s');",
psysconf->systypeno, sysno, subsysno, compCode, alarmCode, alarmTimeStr, alarmIdStr, alarmInfo);
if (mysql_getnores(pubConn, beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "[SQL ERR], %s", beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "New alarm inserted: %s", beatproc_sqlstr);
}
mysql_close(pubConn);
return;
}
else if(clearMode == 2)
{//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>
sprintf(beatproc_sqlstr,
"INSERT INTO sysAlarmEvent (sysTypeNo, sysNo, subSysNo, compCode, alarmCode, alarmTime, clearTime, clearMode, alarmId, alarmInfo) "
"VALUES (%d, %d, %d, %d, %d, '%s', '0000-00-00 00:00:00', 2, '%s', '%s');",
psysconf->systypeno, sysno, subsysno, compCode, alarmCode, alarmTimeStr, alarmIdStr, alarmInfo);
if (mysql_getnores(pubConn, beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "[SQL ERR], %s", beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "Event alarm inserted: %s", beatproc_sqlstr);
}
mysql_close(pubConn);
return;
}
} //end if .8
else{
//another omc
if(psysconf->systypeno == 0)
{
//ems_debug(BEATPROC_DEBUG_LOGFILE,"beatProcSequenceNum:%s",Sequencstring);
if(oidArr[7] == 2 && oidArr[8] == 4 && oidArr[9] == 10)
{
update_ems_process_state(oidArr,pdata);
return;
}
for(i=0;i<4;i++)
{
//ems_debug(BEATPROC_DEBUG_LOGFILE,"pdata[39+%d]:%d",i,(int *)pdata[39+i]);
//ems_debug(BEATPROC_DEBUG_LOGFILE,"beatProcSequenceNum[%d]:%d",i,(int)beatProcSequenceNum[i]);
if(pdata[39+i] != beatProcSequenceNum[i])
{
//ems_debug(BEATPROC_DEBUG_LOGFILE,"beatProcSequenceNum:%s",Sequencstring);
return;
}
}
//ems_debug(BEATPROC_DEBUG_LOGFILE,"EqHBProSequenceNum:%s",Sequencstring);
}
//msc trap message for parameter
else if(psysconf->systypeno == 320)
{
if(oidLen <= psysconf->prefixoidlen)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"MSC trap message oid is too short %d <= %d",oidLen,psysconf->prefixoidlen);
return;
}
//parameter
if(oidArr[psysconf->prefixoidlen] == 2)
{
update_msc_trap_msg(oidLen,oidArr,pdata,dataLen,addr);
return;
}
}
//check sysno and subsysno
sysno=pdata[0];
subsysno=pdata[1];
if(sysno >= psysconf->maxsysnum || subsysno >= psysconf->maxsubsysnum)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"System %s sysno or subsysno is too big,[%d,%d] > [%d,%d]",psysconf->systypename,sysno,subsysno,psysconf->maxsysnum,psysconf->maxsubsysnum);
return;
}
}
//ems_debug(BEATPROC_DEBUG_LOGFILE,"EqHBProSequenceNum:%s",Sequencstring);
}
//msc trap message for parameter
else if(psysconf->systypeno == 320)
{
if(oidLen <= psysconf->prefixoidlen)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"MSC trap message oid is too short %d <= %d",oidLen,psysconf->prefixoidlen);
return;
}
//parameter
if(oidArr[psysconf->prefixoidlen] == 2)
{
update_msc_trap_msg(oidLen,oidArr,pdata,dataLen,addr);
return;
}
}
//check sysno and subsysno
sysno=pdata[0];
subsysno=pdata[1];
if(sysno >= psysconf->maxsysnum || subsysno >= psysconf->maxsubsysnum)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"System %s sysno or subsysno is too big,[%d,%d] > [%d,%d]",psysconf->systypename,sysno,subsysno,psysconf->maxsysnum,psysconf->maxsubsysnum);
return;
}
if(psysconf->systems[sysno][subsysno].isalive == 0)
{
psysconf->systems[sysno][subsysno].isalive=1;
//printf("%s-%d-%d-%d is alive\n",psysconf->systypename,index,sysno,subsysno);
}
if(psysconf->isalive == 0)
{
psysconf->isalive=1;
}
psysconf->systems[sysno][subsysno].lastupdatetime=time(NULL);
update_state(psysconf,sysno,subsysno,pdata,dataLen,addr);
if(psysconf->systems[sysno][subsysno].isalive == 0)
{
psysconf->systems[sysno][subsysno].isalive=1;
//printf("%s-%d-%d-%d is alive\n",psysconf->systypename,index,sysno,subsysno);
}
if(psysconf->isalive == 0)
{
psysconf->isalive=1;
}
psysconf->systems[sysno][subsysno].lastupdatetime=time(NULL);
update_state(psysconf,sysno,subsysno,pdata,dataLen,addr);
}
}
@@ -414,6 +544,17 @@ void update_state(_sys_conf *psysconf,int sysNo,int subSysNo,BYTE *pdata,int dat
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"%s",beatproc_sqlstr);
}
sprintf(beatproc_sqlstr,"update OMC_PUB.sysAlarmInfo set clearTime=CURRENT_TIMESTAMP,clearMode=0,clearBy='System' where sysTypeNo=%d and sysNo=%d and subSysNo=%d and compCode=0 and alarmCode=254;",
psysconf->systypeno,sysNo,subSysNo);
if(mysql_getnores(pubConn,beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"[SQL ERR],%s",beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"%s",beatproc_sqlstr);
}
}
mysql_close(pubConn);
@@ -587,6 +728,39 @@ void update_alarm(_sys_conf *psysconf,int sysno,int subsysno,int compcode,int al
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"%s",beatproc_sqlstr);
}
// <20><><EFBFBD><EFBFBD> alarmCode Ϊ 254 ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD>뵽 alarmInfo <20><>
if (alarmcode == 254)
{
sprintf(beatproc_sqlstr,"update OMC_PUB.sysAlarmInfo set clearTime=CURRENT_TIMESTAMP,clearMode=0,clearBy='System' where sysTypeNo=%d and sysNo=%d and subSysNo=%d and compCode=0 and alarmCode=254;",
psysconf->systypeno,sysno,subsysno);
if(mysql_getnores(pubConn,beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"[SQL ERR],%s",beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE,"%s",beatproc_sqlstr);
}
time_t current_time = time(NULL);
char alarmIdStr[32];
sprintf(alarmIdStr, "%ld", (long)current_time); // <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
sprintf(beatproc_sqlstr, "insert into OMC_PUB.sysAlarmInfo(sysTypeNo,sysNo,subSysNo,compCode,alarmCode,alarmTime,clearTime,clearMode,alarmInfo,alarmId) "
"values(%d,%d,%d,%d,%d,CURRENT_TIMESTAMP,'0000-00-00 00:00:00',1,'Can not receive heartbeat','%s');",
psysconf->systypeno, sysno, subsysno, compcode, alarmcode,alarmIdStr);
if (mysql_getnores(pubConn, beatproc_sqlstr) != 0)
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "[SQL ERR],%s", beatproc_sqlstr);
}
else
{
ems_debug(BEATPROC_DEBUG_LOGFILE, "Inserted into alarmInfo: %s", beatproc_sqlstr);
}
}
}
psys->lastcompcode=compcode;

View File

@@ -1,188 +0,0 @@
#!/bin/bash
src_dir=`pwd`
#omcLib
cd ${src_dir}/omcLib/c_program/omcLib
echo "----------------------------------------------------"
echo "-------------------- omcLib ------------------------"
echo "----------------------------------------------------"
make clean
make
#smeg
cd ${src_dir}/smeg
echo "----------------------------------------------------"
echo "---------------------- smeg ------------------------"
echo "----------------------------------------------------"
make clean
make
#faultMgr sysStat
cd ${src_dir}/faultMgr/c_program/sysStat
echo "----------------------------------------------------"
echo "---------------- faultMgr-->sysStat ----------------"
echo "----------------------------------------------------"
make clean
make
#omcLib ftp
cd ${src_dir}/omcLib/c_program/ftp
echo "----------------------------------------------------"
echo "----------------- omcLib ftp------------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr cdrCollector
cd ${src_dir}/accountMgr/c_program/cdrCollector
echo "----------------------------------------------------"
echo "---------- accountMgr cdrCollector -----------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr ftpSend
cd ${src_dir}/accountMgr/c_program/ftpsend
echo "----------------------------------------------------"
echo "------------- accountMgr ftpSend ------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr nrtrde
cd ${src_dir}/accountMgr/c_program/nrtrde
echo "----------------------------------------------------"
echo "------------- accountMgr nrtrde ------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr sftpSend
cd ${src_dir}/accountMgr/c_program/sftpSend
echo "----------------------------------------------------"
echo "------------- accountMgr sftpSend ------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr smcli
cd ${src_dir}/accountMgr/c_program/smcli
echo "----------------------------------------------------"
echo "-------------- accountMgr smcli --------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr subsComm
cd ${src_dir}/accountMgr/c_program/subsComm
echo "----------------------------------------------------"
echo "------------- accountMgr subsComm ------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr subsDataBackup
cd ${src_dir}/accountMgr/c_program/subsDataBackup
echo "----------------------------------------------------"
echo "----------- accountMgr subsDataBackup --------------"
echo "----------------------------------------------------"
make clean
make linuxES
#accountMgr wsms
cd ${src_dir}/accountMgr/c_program/wsms
echo "----------------------------------------------------"
echo "---------------- accountMgr wsms -------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#configMgr paraComm
cd ${src_dir}/configMgr/c_program/paraComm
echo "----------------------------------------------------"
echo "--------------- configMgr-->paraComm ---------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr alarmAgent
cd ${src_dir}/faultMgr/c_program/alarmAgent
echo "----------------------------------------------------"
echo "-------------- faultMgr-->alarmAgent ---------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr alarmGenerator
cd ${src_dir}/faultMgr/c_program/alarmGenerator
echo "----------------------------------------------------"
echo "------------ faultMgr-->alarmGenerator -------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr beatProc
cd ${src_dir}/faultMgr/c_program/beatProc
echo "----------------------------------------------------"
echo "--------------- faultMgr-->beatProc ----------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr beatSend
cd ${src_dir}/faultMgr/c_program/beatSend
echo "----------------------------------------------------"
echo "--------------- faultMgr-->beatSend ----------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr dualsrv
cd ${src_dir}/faultMgr/c_program/dualsrv
echo "----------------------------------------------------"
echo "--------------- faultMgr-->dualsrv -----------------"
echo "----------------------------------------------------"
make clean
make linuxES
#performanceMgr logCollector
cd ${src_dir}/performanceMgr/c_program/logCollector
echo "----------------------------------------------------"
echo "--------- performanceMgr-->logCollector ------------"
echo "----------------------------------------------------"
make clean
make linuxES
#performanceMgr cstaCollector
cd ${src_dir}/performanceMgr/c_program/cstaCollector
echo "----------------------------------------------------"
echo "--------- performanceMgr-->cstaCollector -----------"
echo "----------------------------------------------------"
make clean
make linuxES
#securityMgr omcCleaner
cd ${src_dir}/securityMgr/c_program/omcCleaner
echo "----------------------------------------------------"
echo "----------- securityMgr-->omcCleaner ---------------"
echo "----------------------------------------------------"
make clean
make linuxES
#faultMgr raidAgent
cd ${src_dir}/faultMgr/c_program/raidAgent
echo "----------------------------------------------------"
echo "--------------- faultMgr-->raidAgent ------------------"
echo "----------------------------------------------------"
make clean
make linuxES
#omcMain omcMain
cd ${src_dir}/omcMain/c_program/omcMain
echo "----------------------------------------------------"
echo "--------------- omcMain-->omcMain ------------------"
echo "----------------------------------------------------"
make clean
make linuxES

View File

@@ -1,187 +0,0 @@
#!/bin/bash
src_dir=`pwd`
#omcLib
cd ${src_dir}/omcLib/c_program/omcLib
echo "----------------------------------------------------"
echo "-------------------- omcLib ------------------------"
echo "----------------------------------------------------"
#make clean
make
#smeg
cd ${src_dir}/smeg
echo "----------------------------------------------------"
echo "---------------------- smeg ------------------------"
echo "----------------------------------------------------"
#make clean
make
#faultMgr sysStat
cd ${src_dir}/faultMgr/c_program/sysStat
echo "----------------------------------------------------"
echo "---------------- faultMgr-->sysStat ----------------"
echo "----------------------------------------------------"
#make clean
make
#omcLib ftp
cd ${src_dir}/omcLib/c_program/ftp
echo "----------------------------------------------------"
echo "----------------- omcLib ftp------------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr cdrCollector
cd ${src_dir}/accountMgr/c_program/cdrCollector
echo "----------------------------------------------------"
echo "---------- accountMgr cdrCollector -----------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr ftpSend
cd ${src_dir}/accountMgr/c_program/ftpsend
echo "----------------------------------------------------"
echo "------------- accountMgr ftpSend ------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr nrtrde
cd ${src_dir}/accountMgr/c_program/nrtrde
echo "----------------------------------------------------"
echo "------------- accountMgr nrtrde ------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr sftpSend
cd ${src_dir}/accountMgr/c_program/sftpSend
echo "----------------------------------------------------"
echo "------------- accountMgr sftpSend ------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr smcli
cd ${src_dir}/accountMgr/c_program/smcli
echo "----------------------------------------------------"
echo "-------------- accountMgr smcli --------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr subsComm
cd ${src_dir}/accountMgr/c_program/subsComm
echo "----------------------------------------------------"
echo "------------- accountMgr subsComm ------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr subsDataBackup
cd ${src_dir}/accountMgr/c_program/subsDataBackup
echo "----------------------------------------------------"
echo "----------- accountMgr subsDataBackup --------------"
echo "----------------------------------------------------"
#make clean
make installbin
#accountMgr wsms
cd ${src_dir}/accountMgr/c_program/wsms
echo "----------------------------------------------------"
echo "---------------- accountMgr wsms -------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#configMgr paraComm
cd ${src_dir}/configMgr/c_program/paraComm
echo "----------------------------------------------------"
echo "--------------- configMgr-->paraComm ---------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr alarmAgent
cd ${src_dir}/faultMgr/c_program/alarmAgent
echo "----------------------------------------------------"
echo "-------------- faultMgr-->alarmAgent ---------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr alarmGenerator
cd ${src_dir}/faultMgr/c_program/alarmGenerator
echo "----------------------------------------------------"
echo "------------ faultMgr-->alarmGenerator -------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr beatProc
cd ${src_dir}/faultMgr/c_program/beatProc
echo "----------------------------------------------------"
echo "--------------- faultMgr-->beatProc ----------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr beatSend
cd ${src_dir}/faultMgr/c_program/beatSend
echo "----------------------------------------------------"
echo "--------------- faultMgr-->beatSend ----------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr dualsrv
cd ${src_dir}/faultMgr/c_program/dualsrv
echo "----------------------------------------------------"
echo "--------------- faultMgr-->dualsrv -----------------"
echo "----------------------------------------------------"
#make clean
make installbin
#performanceMgr logCollector
cd ${src_dir}/performanceMgr/c_program/logCollector
echo "----------------------------------------------------"
echo "--------- performanceMgr-->logCollector ------------"
echo "----------------------------------------------------"
#make clean
make installbin
#performanceMgr cstaCollector
cd ${src_dir}/performanceMgr/c_program/cstaCollector
echo "----------------------------------------------------"
echo "--------- performanceMgr-->cstaCollector -----------"
echo "----------------------------------------------------"
#make clean
make installbin
#securityMgr omcCleaner
cd ${src_dir}/securityMgr/c_program/omcCleaner
echo "----------------------------------------------------"
echo "----------- securityMgr-->omcCleaner ---------------"
echo "----------------------------------------------------"
#make clean
make installbin
#faultMgr raidAgent
cd ${src_dir}/faultMgr/c_program/raidAgent
echo "----------------------------------------------------"
echo "--------------- faultMgr-->raidAgent ------------------"
echo "----------------------------------------------------"
#make clean
make installbin
#omcMain omcMain
cd ${src_dir}/omcMain/c_program/omcMain
echo "----------------------------------------------------"
echo "--------------- omcMain-->omcMain ------------------"
echo "----------------------------------------------------"
#make clean
make installbin

View File

@@ -12,6 +12,8 @@ int getOmcSysNo(int* sysNo);
int getOmcStatus(int sysNo);
int omcSysNo=-1;
static char cstaproc_sqlstr[8192];
/*
return:
TIMETO_NONE
@@ -1009,7 +1011,9 @@ int csta_send(csta_src *pcsta,csta_sys *psys)
break;
case 2:
if(pcsta->sysTypeNo != 350){
csta_pdu.var[0].oid[b_oidlen++]=psys->id1;
}
if(pcsta->sysTypeNo==320 || pcsta->sysTypeNo==378|| pcsta->sysTypeNo==387)
{
//Entry OID
@@ -1143,7 +1147,7 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
{
csta_obj *pobj;
var_list *pvar;
DWORD d_timestamp,*p_long;
DWORD d_timestamp,*p_long;
DWORD *pval4;
WORD *pval2;
char sqlstr[8192],sumsqlstr[8192],sumCondition[512],sumFieldList[8192];
@@ -1225,6 +1229,7 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
sprintf(tmpstr3," and %s=%d",pobj->id1_field,psys->pre_id1 + pobj->id1_offset);
strcat(sumCondition,tmpstr3);
}
break;
case 2:
sprintf(key_field,"%s,%s,",pobj->id1_field, pobj->id2_field);
@@ -1234,6 +1239,7 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
sprintf(tmpstr3," and %s=%d and %s=%d",pobj->id1_field,psys->pre_id1 + pobj->id1_offset,pobj->id2_field,psys->pre_id2 + pobj->id2_offset);
strcat(sumCondition,tmpstr3);
}
break;
}
//csta_log("single_message_flag:%d",pcsta->single_message_flag);
@@ -1241,13 +1247,14 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
{
sprintf(sqlstr, "replace into %s.%sData (%s%s%s,csta_datetime)VALUES(%s%s",
CSTA_DB,pobj->detail_table,sys_field,key_field,pobj->sql_detail,sys_value,key_value);
//sum up accord to the map table
if(needSumFlag)
{
sprintf(tmpstr3," and UNIX_TIMESTAMP(csta_datetime) = %ld",d_timestamp);
strcat(sumCondition,tmpstr3);
sprintf(sumsqlstr,"select %s from %s.%sData where %s",pobj->sql_sum,CSTA_DB,pobj->detail_table,sumCondition);
}
if(pobj->field_width == 2)
@@ -1260,6 +1267,8 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
}
}
else
{
if (pcsta->sysTypeNo != 362)
{
for(i=0;i<pobj->detail_field_count;i++)
{
@@ -1267,6 +1276,37 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
sprintf(tmpstr3,"%u,",htonl(*pval4));
strcat(sqlstr,tmpstr3);
}
}else{ //SPGW
for(i=0;i<pobj->detail_field_count-2;i++)
{
pval4=(DWORD*)(pvar->msg + 4 + i * 4);
sprintf(tmpstr3,"%u,",htonl(*pval4));
strcat(sqlstr,tmpstr3);
// printf("Field %d: %u\n", i + 1, htonl(*pval4));
} //ǰʮ<C7B0><CAAE><EFBFBD><EFBFBD>
DWORD *uplink_tmp1, *uplink_tmp2;
DWORD *downlink_tmp1, *downlink_tmp2;
uint64_t uplink_total_volume;
uint64_t downlink_total_volume;
// <20><><EFBFBD><EFBFBD> uplink_total_volume
uplink_tmp1 = (DWORD*)(pvar->msg + 4 + (pobj->detail_field_count - 2) * 4); //68
uplink_tmp2 = (DWORD*)(pvar->msg + 4 + (pobj->detail_field_count -1) * 4); // 72
uplink_total_volume = ((uint64_t)ntohl(*uplink_tmp1) << 32) +ntohl(*uplink_tmp2);
sprintf(tmpstr3, "%llu,", uplink_total_volume);
strcat(sqlstr, tmpstr3);
// <20><><EFBFBD><EFBFBD> downlink_total_volume
downlink_tmp1 = (DWORD*)(pvar->msg + 4 + (pobj->detail_field_count ) * 4); //76<37><36>ʼ
downlink_tmp2 = (DWORD*)(pvar->msg + 4 + (pobj->detail_field_count +1) * 4); //80<38><30>ʼ
downlink_total_volume = ((uint64_t)ntohl(*downlink_tmp1) << 32) +ntohl(*downlink_tmp2);
sprintf(tmpstr3, "%llu,", downlink_total_volume);
strcat(sqlstr, tmpstr3);
}
}
sprintf(tmpstr3,"FROM_UNIXTIME(%ld))",d_timestamp);
strcat(sqlstr,tmpstr3);
@@ -1359,6 +1399,9 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
sprintf(sqlstr, "replace into %s.%sData (%s%s%scsta_datetime)VALUES(%s%s",
CSTA_DB,pobj->sum_table,sys_field,key_field,sumFieldList,sys_value,key_value);
for(i=0;i<pobj->sum_field_count;i++)
{
if(row[i] == NULL)
@@ -1377,7 +1420,56 @@ int csta_record(csta_src *pcsta,csta_sys *psys,snmp_pdu *pdu)
}
sprintf(tmpstr3,"FROM_UNIXTIME(%ld))",d_timestamp);
strcat(sqlstr,tmpstr3);
//only 320 mscSumData.check Signal Error
if (pcsta->sysTypeNo == 320 && strcmp(pobj->sum_table, "mscSumData") == 0) {
int sysNo = psys->sysid; // <20><> psys <20><>ȡ sysNo
int subSysNo = psys->subsysid;
unsigned int SignalErr = 0, Attempt = 0 ,KeyType =0;
sscanf(sqlstr, "%*[^,],%*[^,],%u,%*[^,],%u,%*[^,],%u", &KeyType,&Attempt, &SignalErr);
// MO-12 MT-13
if (Attempt > 0 && (KeyType == 12 || KeyType == 13)) {
double ratio = (double)SignalErr / Attempt;
// <20><><EFBFBD><EFBFBD> SignalErr / Attempt > 5%<25><><EFBFBD>򴥷<EFBFBD><F2B4A5B7>
if (ratio > 5.0) {
time_t current_time = time(NULL);
char alarmIdStr[32];
sprintf(alarmIdStr, "%ld", (long)current_time); // <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> alarmInfo <20><><EFBFBD><EFBFBD> SQL <20><><EFBFBD><EFBFBD>
sprintf(cstaproc_sqlstr, "insert into OMC_PUB.sysAlarmInfo(sysTypeNo,sysNo,subSysNo,compCode,alarmCode,alarmTime,clearTime,clearMode,alarmInfo,alarmId) "
"values(%d,%d,%d,%d,%d,CURRENT_TIMESTAMP,'0000-00-00 00:00:00',1,'Call failure rate exceeds 5%%');",
pcsta->sysTypeNo,sysNo,subSysNo, 0, 10, alarmIdStr);
// ִ<><D6B4> SQL <20><><EFBFBD><EFBFBD>
if (mysql_getnores(pubConn, cstaproc_sqlstr) != 0) {
csta_log("[SQL ERR]: %s", cstaproc_sqlstr);
} else {
csta_log("Inserted into alarmInfo: %s", cstaproc_sqlstr);
}
}else{
//clear 5% alarm
sprintf(cstaproc_sqlstr, "update OMC_PUB.sysAlarmInfo set clearTime=CURRENT_TIMESTAMP,clearMode=0,clearBy='System' "
"where sysTypeNo=%d and sysNo=%d and subSysNo=%d and compCode=%d and alarmCode=%d and clearMode=1;",
pcsta->sysTypeNo, sysNo, subSysNo, 0, 10);
// ִ<><D6B4> SQL <20><><EFBFBD><EFBFBD>
if (mysql_getnores(pubConn, cstaproc_sqlstr) != 0) {
csta_log("[SQL ERR]: %s", cstaproc_sqlstr);
} else {
csta_log("Cleared alarmInfo: %s", cstaproc_sqlstr);
}
}
} else {
csta_log("Attempt is zero, skipping SignalErr/Attempt calculation.");
}
}
if(mysql_getnores(pCstaConn,sqlstr) != 0)
{
if(mysql_errno(pCstaConn) == 1146)

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
#endif
#define MaxLogSrcNum 16 //max number of command can be execute as same time
#define MaxAttrDefnNum 256
#define MaxAttrDefnNum 512
#define MaxOidLen 20 //max number of object ID
#define MaxSubOidLen 10 //max number of sub object ID
#define MaxVarNum 50 //max number of var in one pdu