cell队列监控
1.cell队列监控
基于Windows定时计划任务,通过Windows bat脚本监控Cell队列,当Source Cell队列有告警没有传递至Destination Cell时,能够及时发出告警。
Cell_Queue_Monitoring.bat
::关闭命令回显
@echo off::日志目录创建
if not exist "C:\Cell_Queue_Monitoring\%date:~0,4%%date:~5,2%%date:~8,2%" (md "C:\Cell_Queue_Monitoring\%date:~0,4%%date:~5,2%%date:~8,2%")::变量定义
set filename=C:\Cell_Queue_Monitoring\mquery_queue.txt
set logfile=C:\Cell_Queue_Monitoring\%date:~0,4%%date:~5,2%%date:~8,2%\msend.log
set cell_exception=20
set cell_queue_threshold=0::cell status判断
call mcstat -n pncell_bppm > null
if "%errorlevel%" equ "%cell_exception%" (call msend -n pncell_childserver -a PATROL_EV -q -m "cell-pncell_bppm may not be work,please check" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=3.3.3.3;mc_host_address=3.3.3.3"echo %date% %time% msend -n pncell_childserver -a PATROL_EV -q -m "cell-pncell_bppm may not be work,please check" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=3.3.3.3;mc_host_address=3.3.3.3" >>%logfile%exit 20
)::cell queue获取
call mquery -n pncell_bppm -q -a PATROL_EV -w "status: ==OPEN AND NOT propagated_to($THIS,'pncell_childserver') > 0" -s COUNT >%filename%::cell queue判断
for /f "tokens=1" %%a in (%filename%) do (
rem echo %%a
if "%%a" geq "%cell_queue_threshold%" (call msend -n pncell_bppm -a PATROL_EV -q -m "Events of pncell_bppm not propagated to pncell_childserver are %%a" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=2.2.2.2;mc_host_address=2.2.2.2"echo %date% %time% msend -n pncell_bppm -a PATROL_EV -q -m "Events of pncell_bppm not propagated to pncell_childserver are %%a" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=2.2.2.2;mc_host_address=2.2.2.2" >>%logfile% )
)
2.验证
BPPM告警
日志
2024/xx/xx xx x:xx:xx.03 msend -n pncell_bppm -a PATROL_EV -q -m "Events of pncell_bppm not propagated to pncell_childserver are 96" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=2.2.2.2;mc_host_address=2.2.2.2"
……
……
2024/xx/xx xx x:xx:xx.31 msend -n pncell_bppm -a PATROL_EV -q -m "Events of pncell_bppm not propagated to pncell_childserver are 5115" -b "severity=CRITICAL;netcool_field3='系统管理一';netcool_stringA='系统管理一';mc_host=2.2.2.2;mc_host_address=2.2.2.2"