show code js

2022年3月3日 星期四

HPE 5120 Storm

 2 Way (1) Storm constrain (2) Port managenet

We had 2 area need to limit this. so.... we use (2)


Open Port Managenemt, Config Storm Suppression

Broadcast use kbps and set it 2000

Multicast use ratio and set it 80%

Unicast use pps and set 2000

Add 2 Port(Area) , Click Apply and Save

cmd check code in file

 @echo off

@cls


for /F "delims= tokens=1" %%i in (C:\code.txt) do (


IF /I %%i==your_code ( GOTO ISOK ) ELSE ( GOTO ISNG )

)


@echo Check Error


GOTO ISEND


:ISOK


@echo Check Pass


GOTO ISEND


:ISNG


@echo Check Fail


:ISEND


@echo Done

windows event clear

 @wevtutil cl Security

@wevtutil cl Application

@wevtutil cl Setup

@wevtutil cl System

@wevtutil cl "DFS Replication"

@wevtutil cl "Windows PowerShell"

cmd use ping to do something

 @echo off

@cls

@set subject=[Subject Title]

@setlocal enabledelayedexpansion

@set logfile=log_%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.txt

@echo ================== >> %logfile%

@echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% Begin %subject% >> %logfile%


for /F "delims=; tokens=1" %%i in (C:\list.txt) do (

@ping -n 1 %%i | find "最小值"

@if !ERRORLEVEL!==1 (

                @echo %%i is down >> %logfile%

) else (

                @echo %%i is life >> %logfile%

@shutdown -s -t 0 -m \\%%i

)

@echo --------- >> %logfile%

)


@echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% End %subject% >> %logfile%

@echo ================== >> %logfile%


list.txt like below:

IP

IP

IP

......