I. Detect network connectivity by sending and receiving email regularly
#/bin/"Daily test mail" >-S server_state [email protected] < -DF./state.txt
~
Crontab-e
Add the following tasks
Ten * * * */root/checknkmail &
Time-sharing Week
Second, timing detection network status via email send
Checkserverstat Script content:
#/bin/Bashecho"Hztelecomdns">state.txtping-C5 202.101.172.35>>State.txtecho"Bju">> state.txtPing-c5 Ten. x.x.x >>State.txtecho"ADSL Gateway">>state.txtping-C5x.x.x.x >>State.txtecho"server_outside VPN">>state.txtping-C5 192.168.2.100>>State.txtecho"server_outside WAN">>state.txtping-C5x.x.x.x >>State.txtecho"VPN in Company">>state.txtping-C5 192.168.1.4>>State.txtecho"L2TP at AAA libweb">>state.txtping-C5x.x.x.x & >>State.txtmail-s Server_state [email protected] <STATE.TXTRM-df./state.txt
adding tasks in crontab
Corntab-e * * * */root/checkweatherstate & * * * */root/ Checkserverstate & * * */root/checkserverstate &Ten * * */root/ Checkserverstate &
Two scripts to check the status of a Linux network