Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c354909d4a |
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
verstr=`grep version ./sys_nicmonitor/version.h | cut -d "=" -f 2`
|
||||
echo $verstr
|
||||
worksrc=sys_nicmonitor-$verstr
|
||||
|
||||
4
code/dep/42/run.sh
Normal file → Executable file
4
code/dep/42/run.sh
Normal file → Executable file
@@ -1,2 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
pkgadd dotconf#1.0.13-1.pkg.tar.gz
|
||||
|
||||
cp ../libproc_common.so /usr/lib64/
|
||||
# cp ../libproc_common.so /usr/lib/
|
||||
|
||||
8
code/dep/90/run.sh
Normal file → Executable file
8
code/dep/90/run.sh
Normal file → Executable file
@@ -2,11 +2,11 @@
|
||||
|
||||
arch=`uname -m`
|
||||
if [ "x$arch" == "x86_64" ]; then
|
||||
dpkg -i libdotconf0_1.3-0.2_amd64.deb
|
||||
dpkg -i libdotconf-dev_1.3-0.2_amd64.deb
|
||||
dpkg -i libdotconf0_1.3-0.2_amd64.deb
|
||||
dpkg -i libdotconf-dev_1.3-0.2_amd64.deb
|
||||
elif [ "x$arch" == "aarch64" ]; then
|
||||
dpkg -i libdotconf0_1.3-0.2_arm64.deb
|
||||
dpkg -i libdotconf-dev_1.3-0.2_arm64.deb
|
||||
dpkg -i libdotconf0_1.3-0.2_arm64.deb
|
||||
dpkg -i libdotconf-dev_1.3-0.2_arm64.deb
|
||||
fi
|
||||
|
||||
cp ../libproc_common.so /usr/lib/
|
||||
|
||||
11
code/dep/Makefile
Normal file
11
code/dep/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
all: libproc_common.so
|
||||
|
||||
libproc_common.so:
|
||||
g++ -fPIC -shared -I ../sys_nicmonitor/include proc_common.cpp -o libproc_common.so
|
||||
|
||||
install:
|
||||
cp libproc_common.so /usr/lib
|
||||
clean:
|
||||
rm -rf libproc_common.so
|
||||
7
code/dep/README
Normal file
7
code/dep/README
Normal file
@@ -0,0 +1,7 @@
|
||||
编译网卡监视程序前需安装依赖库和科东接口库。
|
||||
|
||||
依赖库:ibdotconf.so (软件源中安装对应软件包)
|
||||
|
||||
科东接口库:libproc_common.so (需要在当前目录编译生成make)
|
||||
|
||||
执行run.sh自动安装依赖。
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,7 +12,8 @@ NS_SYSADMIN::CProcCommon::~CProcCommon()
|
||||
printf("NS_SYSADMIN::CProcCommon::~CProcCommon\n");
|
||||
}
|
||||
|
||||
int NS_SYSADMIN::CProcCommon::proc_init(const char* scn_name, const char* subscn_name,char* process_name, const char* label = NULL, const char* subscn_lable = NULL)
|
||||
// int NS_SYSADMIN::CProcCommon::proc_init(const char* scn_name, const char* subscn_name,char* process_name, const char* label = NULL, const char* subscn_lable = NULL)
|
||||
int NS_SYSADMIN::CProcCommon::proc_init(const char* scn_name, const char* subscn_name,char* process_name, const char* label, const char* subscn_lable)
|
||||
{
|
||||
printf("NS_SYSADMIN::CProcCommon::proc_init\n");
|
||||
return 0;
|
||||
|
||||
31
code/dep/run.sh
Normal file → Executable file
31
code/dep/run.sh
Normal file → Executable file
@@ -1,2 +1,29 @@
|
||||
pkgadd dotconf#1.0.13-1.pkg.tar.gz
|
||||
cp ./libman.so /usr/lib64/
|
||||
#!/bin/bash
|
||||
#
|
||||
#*************************************************************
|
||||
# Author: Wei, Jing
|
||||
# Mail: jwei@linx-info.com
|
||||
# Date: 2021-11-30
|
||||
# FileName: run.sh
|
||||
# Use: ./run.sh
|
||||
# Description:
|
||||
#
|
||||
#
|
||||
#*************************************************************
|
||||
|
||||
make
|
||||
|
||||
if [ `grep -q 42 /etc/issue; echo $?` -eq 0 ]; then
|
||||
DIR=42
|
||||
elif [ `grep -q 90 /etc/issue; echo $?` -eq 0 ]; then
|
||||
DIR=90
|
||||
else
|
||||
echo "Failed to install dependency"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd $DIR
|
||||
bash run.sh
|
||||
popd
|
||||
|
||||
exit 0
|
||||
|
||||
Binary file not shown.
@@ -7,8 +7,8 @@ include $(DEFAULTS)
|
||||
all:sys_nicmonitor libnic_shm.so test
|
||||
|
||||
#CFLAGS += -D TESTINTERVAL -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0 -g
|
||||
CFLAGS += -I ./include -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0
|
||||
#CFLAGS += -I ./include -D USER_NUSP -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0
|
||||
# CFLAGS += -I ./include -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0
|
||||
CFLAGS += -I ./include -D USER_NUSP -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0
|
||||
|
||||
sys_nicmonitor:mnic.o read_netcard.o send_alarm.o
|
||||
$(CC) $(CFLAGS) -lproc_common -ldotconf -lpthread -o $@ $^
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
========
|
||||
版本说明:
|
||||
--V1.22 --
|
||||
--V2.1 --
|
||||
2021-11-30
|
||||
1) 解决bond模式为3时出现段错误问题。
|
||||
问题描述:网卡监视程序启动过程中存在段错误
|
||||
问题分析:bond模式3由于对bond模块源码进行了修改,导致/proc/net/bonding/目录下新增LINXNETHA目录。程序在处理时没有处理目标为目录情况,导致出现空指针情况,之后在对比字符串(strncmp)时,使用空指针从而导致段错误。
|
||||
解决办法:增加对目录的过滤,当目标为目录时退出线程。
|
||||
--V2.0 --
|
||||
2020-07-09
|
||||
1)根本南瑞郭海龙要求进行接口的修改
|
||||
取消之前libman.so动态库和proc_inv.h头文件,改为新的libproc_common.so动态库,同时增加include头文件目录
|
||||
|
||||
@@ -885,6 +885,19 @@ static void *check_inc_switch(void *ptr)
|
||||
char error_str[200];
|
||||
char *str = NULL;
|
||||
char *retp = NULL;
|
||||
struct stat filestat;
|
||||
|
||||
if(0 != stat(arg->bond_file_path, &filestat)){
|
||||
snprintf(error_str, sizeof(error_str), "EMERG: %s is not found\n", arg->bond_file_path);
|
||||
free(ptr);
|
||||
return NULL;
|
||||
// pthread_exit((void *)0);
|
||||
}
|
||||
if(S_ISDIR(filestat.st_mode)){
|
||||
snprintf(error_str, sizeof(error_str), "EMERG: Ignore directory %s\n", arg->bond_file_path);
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((fp = fopen(arg->bond_file_path, "r")) == NULL){
|
||||
snprintf(error_str, sizeof(error_str), "EMERG: fopen():%s\n", strerror(errno));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// version=2.0
|
||||
// version=2.1
|
||||
#ifndef MNIC_VERSION
|
||||
#define MNIC_VERSION "2.0"
|
||||
#define MNIC_VERSION "2.1"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user