Two scripts to check the status of a Linux network

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.