later ..." #如果有设备挂载到该挂载点 umount uninstall if Mount|grep-q "$mountpoint" ;thenumount$ mountpointfi# read-only way, mount the virtual machine's disk file to a specific directory, here is the/media/virtimage directory guestmount-r-d $name -i$ Mountpointechoecho "--------------------------------------------" echo-e "\033[32m$name the list of network cards in the virtual machine is as follows: \ 033[0m "dev=$ (ls/media/virtimage/etc/sysconfig/
This script has been tested under the Centos/rhel and Fedora Linux operating systems.Available for current network configuration information.Code:#!/bin/Bash#hwinf=/usr/sbin/hwinfoifcfg=/sbin/IFCONFIGIP4FW=/sbin/IPTABLESIP6FW=/sbin/Ip6tableslspci=/sbin/Lspciroute=/sbin/Routenetstat=/bin/NETSTATLSB=/usr/bin/Lsb_release # # files # #DNSCLIENT="/etc/resolv.conf"drvconf="/etc/modprobe.conf"NETALIASCFC="/etc/sys
Get Linux network traffic script
Syntax: [-- help] [-I] [-D]
#! /Bin/bash
Version = "1.0.0.1"Eth = ""SEC = 0
Help (){Printf "version: $ version \ n \Usage: $0 [-I interface] [-D time] \ n \\ T-I | -- interface: The needs of the inquiries interface network card (such as eth0, eth1...) \ n \\ T-d | -- Time: Delay Time (seconds) \ n ";}
Echo "$ *"For du
#!/usr/bin/Envpython#-*-coding=utf-8-*-#Using GPL v2.7#Author: [email protected]126. Com#python Monitor network card traffic"""1, the realization principle: obtains the system information through the SNMP protocol, then carries on the corresponding computation and the format, the final output result2, special note: SNMP is required on the monitored machine.Yum Install-Y net-snmp*installation"""#!/usr/bin/pythonimport reimport os#get SNMP-MIB2 of the D
In the past, I wrote a monitoring script to check the IP addresses in an IP list every 10 seconds by using the PING command. If the IP addresses in an IP list cannot be accessed, send messages via the messenger message and use BEEP to send alarms. Run the script.
Copy codeThe Code is as follows: rem main. bat
@ Echo off
For/F "eol =; tokens = 1, 2 * delims =" % I in (ip. TXT) do call: checkip % I % j 0
Ech
Write a Python script to capture network novels to create your own reader,
Are you worried about the "online novel reading" content that cannot be downloaded online? Or is the content of some articles impulsive to your favorites, but you cannot find a download link? Is there an impulse to write a program on your own to get everything done? Have you learned python and want to find something to show off and t
#!/bin/bash# Traffic monitor# Author:xiao guaishouget_traffic_info () {recv=`Cat/proc/net/dev |awk-F'[: ]+' '/' "$dev"'/{print}'' Sent=`Cat/proc/net/dev |awk-F'[: ]+' '/' "$dev"'/{print $11}''}get_traffic_rate () { in=`Echo$[($RECV-$old _recv)/1024x768] ' out=`Echo$[($sent-$old _sent)/1024x768] '}read-P'Please enter the network card device name you want to monitor:'Devif!grep-qp"\b$dev\b:"/proc/net/Dev Then Echo "the device you entered does not exi
Use shell script to compute the Linux NIC traffic, the most critical point in the method:
Copy Code code as follows:
Ifconfig $eth _name | grep bytes | awk ' {print $} ' | Awk-f: ' {print $} '
The flow of input and output is obtained by Ifconfig eth0|grep bytes.
Copy Code code as follows:
/@rac2 =>dd2$ifconfig Eth0|grep bytes
RX bytes:1638005313300 (1.4 TiB) TX bytes:3408060482049 (3.0 TiB)
The r
Job Four:
Write a script:
Implement Ping Class C network segment, Class B network segment and all hosts in Class A network segment;
The network segment address lets the user input, moreover uses the script to judge the
In the past, I wrote a monitoring script to check the IP addresses in an IP list every 10 seconds by using the ping command. If the IP addresses in an IP list cannot be accessed, send messages via the messenger message and use beep to send alarms. Run the script.Rem main. bat
@ Echo off
For/F "EOL =; tokens = 1, 2 * delims =" % I in (IP. txt) Do call: checkip % I % j 0
Echo --------------------------------------------------------------
Echo ---- the f
upload.php
This is the upload file interface, with any editor can be made to look good. It is important to note that the table
Enctype= "Multipart/form-data" section. This must not be wrong, or the server will not know you are uploading files.
The other there is nothing to say, hehe, we can make a better.
File Upload
The above describes the establishment of a home LAN file Exchange function of the script
I looked at the/proc/net/dev under Linux to record the number of packets and bytes sent and received by each network card. So initiation thought, wrote one. Operation Effect:
Copy Code code as follows:
[root@74-82-173-217 ~]#./net.sh
Current Ip:inet addr:74.82.173.217 bcast:74.82.173.223 mask:255.255.255.224
Summry info:rx bytes:203692709 (194.2 MiB) TX bytes:93525930 (89.1 MiB)
Eth0 Receive bytes:573 Packets:3
Eth0 Send bytes
A lot of friends do not know how to use shell scripts to collect information about the Linux system, including CPU, memory, disk, network and other information, here the script to do a small part of the explanation, we come together to see it.First, CPU information collection1), Collect CPU utilizationAcquisition algorithm: Collects and calculates the total CPU utilization or single core utilization through
(Jacob) #定义for循环变量i, execution cycles are 254 times, I cycle from 1 to 254# each cycle to a target host test ping connectivity,The syntax format of the ping command references the previous while version for I in {1..254}do ping-c2-i0.3-w1 192.168.4. $i >/dev/null if [$? –eq 0];then echo "192.168.4. $i are up" else echo "192.168.4. $i are down" Fidon E3. Test 192.168.4.0/24 connectivity across the entire network segment (multi-process version)#!/bin/b
The Linux script detects that the local link specifies whether the IP segment is unblocked, detects the specified IP through the ping command, detects the command execution result, and if 0 is unblocked, if 1 indicates that the network is unblocked, except that the specified machine disables the ping command. The code is as follows:#!/bin/bash#For N in ' seq 121 237 'DoPing-c1 192.168.10. $N >/dev/nullIf [$
Previously wrote a monitoring script, every 10 seconds using ping to check an IP list of IP, if not, then sent through Messenger message, and the use of beep issued an alarm sound. File Sleep.exe is required (available next to the Web), BEEP. EXE (Oneself with Delphi write, not necessary, the code can be removed, also can go to the Internet to find a), and then set up file Ip.txt,user.txt, run the script ca
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.