Check process case

1:Check ports

#!/bin/bash 
set - e
set - x

if (netstat -nltp |grep 1935) == 0
  then echo "SRS Oringin start failed" >> /tmp/failed_start_service.log
    else echo  "SRS Oringin start"


2:Check process name

#/bin/bash


if ps aux |grep admin/|grep conf >/dev/null
then
echo -e "\033[33m admin started \033[0m"
else
echo -e "\033[41m Service admin start failed \033[0m"
fi

一句句解释分析细致讲解一下这段代码void netconf_entry(void) { int state = 0; int event = 0; UINT8 * pPacket = NULL; UINT32 dataLen = 0; char *pData = NULL; UINT8 ret = 0; struct np_module netopeer_module; struct np_module server_module; memset(&netopeer_module,0,sizeof(struct np_module)); memset(&server_module,0,sizeof(struct np_module)); state = Ros_GetCurState(); event = Ros_GetMsgId(); switch( state ) { case NETCONF_PROCESS_INIT: switch( event ) { case MSG_MasterPowerOn: case MSG_SlavePowerOn: //printf("netconf_entry MSG_SlavePowerOn\n"); Ros_SetNextState(NETCONF_PROCESS_RUNNING); break; case MSG_INIT_PROTOCOL_OK: Ros_SetNextState(NETCONF_PROCESS_RUNNING); break; default: break; } break; case NETCONF_PROCESS_RUNNING: switch( event ) { case MSG_DriverOK: netconf_init(); break; case MSG_NETCONF_TO_DCN: nc_verb_verbose("netconf_entry recv netconf to dcn msg\n"); break; case MSG_ALARM_TO_NETCONF: NcProcessAlarmMsg(); break; case MSG_LIBNETCONF_TO_NETOPEER: ncRcvLibnetconfMsgProc(); break; case MSG_NETCONF_LLDP_TIMER: Ros_SetTimer(netconfLLDPTimerID, NETCONF_MSG_TIME_LLDP, 0); ncLldpchange(); break; case MSG_NETCONF_15MIN_PERF_TIMER: Ros_SetTimer(netconf15MINPerfTimerID, NETCONF_MSG_15MIN_TIME_PERF, 0); packageOptInfo15Min(); packageIfStatisInfo15Min(); break; case MSG_NETCONF_24H_PERF_TIMER: Ros_SetTimer(netconf24hPerfTimerID, NETCONF_MSG_24H_TIME_PERF, 0); packageOptInfo24H(); packageIfStatisInfo24H(); break; case MSG_NETCONF_MEM_CHECK_TIMER: printS("MSG_NETCONF_MEM_CHECK_TIMER TIMEROUT\n"); memory_line_check(0); break; case MSG_NETCONF_TIMER: oam_perf_netconf_show_value_entry(); break; default: break; } break; default: break; } return EXIT_SUCCESS; }
07-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值