Online troubleshooting commands-Shell, online troubleshooting-shell
Creation: Liu Xinyu, latest modification: about 4 hours ago
Go to metadata start 1. Track online logs and regularly refresh the latest content
tail-fn 200 $log
2. Search for a specified strin
For the server, the online rate is very important, there are problems to be resolved in a timely manner, but the system administrator can not be kept in the computer next to the site through the script to monitor the problem in a timely manner through mail notify the administrator, if it is 139 mailbox can also be free mobile phone SMS notification.Note: Sending mail directly through the system is easy to intercept, and you can use mail to connect to
Because the local area network host many, the VLAN also many, for often can know the number of on-line host, writes the script to examine the on-line host.
The effect is: the host online display green, the host offline display red results.
Usage:./ping IP Segment For example:./ping 192.168.0
Copy Code code as follows:
#!/bin/bash
Network=$1
for HOST in $ (SEQ 1 254)
do
nb sp; ping-c 1-w 1 $NETWORK. $HOST >/dev/null r
Execute shell commands in the program to automatically obtain all the online IP addresses and open ports in the LAN (Linux), shelllinuxPreface
The question is a bit long. It is actually the following: first, let the Shell command be executed in the program, and then pass the execution result to the variable, so that subsequent transactions can be processed, the s
ObjectiveThe topic said a bit long, in fact, is the following several things, the first is that the shell command can be executed within the program, and then pass the execution results to the variable, so that the subsequent transaction processing, the second is to use the Nmap command to get all the online IP and open ports in the current LAN, Finally, the results of nmap are processed to obtain only the
Execute shell commands in the program to automatically obtain all online IP addresses and open ports in the LAN (Linux)Preface
The question is a bit long. It is actually the following: first, let the Shell command be executed in the program, and then pass the execution result to the variable, so that subsequent transactions can be processed, the second is to use
new child process is created, and the proces.env of the main process is passed to the child county. Need to enter the child process in the main process money using Process.chmdir (), switch to the shell's execution directory. Nodejs API is also very thoughtful, which has a opts parameter, you can set the OPTS.CWD. To change the execution environment of the shell.3. Simple Shell ProgrammingI have no
Today, I'm going to install the SharePoint Online Management Shell on a new machine, and there are some problems and notes.
First the SharePoint Online Management Shell download Address: https://www.microsoft.com/en-us/download/details.aspx?id=35588
Both the download and installation are smooth, and after the installat
ECStore open-source online shop system Arbitrary File Modification Vulnerability can be shell
Brief description:
The file editing function in template editing does not have strict restrictions on editable files. As a result, any files in the system can be modified.
Select the file to be modified in the file editing function. Select the image here (the template file can also be used). Then, when uploading th
Project name: Online Shell Command Interpreter
Objective: To practice socket programming
Function: You can use Windows telnet to remotely log on to the Linux system, run your own shell command parser, and perform some simple internal and external commands, the operation commands and running results are displayed on the Windows Telnet terminal.
Source c
This script implements the following functions: 1. Backing up mysql databases online; 2. Saving backup logs to log files; 3. compressing data backup files; 4. Remotely ftp the compressed file to the backup server; 5. deleting data that has been backed up locally for more than seven days is mainly to prevent the abnormal growth of the disk space of the production server from leading to performance bottlenecks. The specific implementation of
How to use peanut shell 2.0+wordpress to build personal website? Hurry ~ ~ ~ Online
Peanut shells have been built!
WordPress has also been installed, can be used in the local normal use, and now in the background settings inside the configuration is:
But I changed it to the following
After the submission of the error, please tell me what's going on? How to solve? Urgent ~~~~~
------to solve the idea--
First, the script functionTo determine whether the IP is occupied, the ping rule is considered to be occupied and the results are output to ip_yes.txt and Ip_no.txt, respectively, by means of the ping command detection.Second, script writing#!/bin/bash#Check the network is onlineip_num=192.168.1.For i in ' SEQ 1 254 'DoPing-c 2 $ip _num$i >/dev/nullIf [$? = 0];thenecho "Echo $ip _num$i is yes"Echo $ip _num$i is yes >> ip_yes.txtElseecho "Echo $ip _num$i is no"Echo Echo $ip _num$i is no >> ip_no.
file.Hold and Swap: H command and x commandSwaps the pattern space and preserves the contents of the buffer. That is, the line that contains test and check is swapped:Sed-e '/test/h '-E '/check/x ' file Script ScriptFileThe SED script is a list of SED commands that boot the script file name with the-F option when you start sed. Sed is very picky about the commands entered in the script, and cannot have any whitespace or text at the end of the command, separated by semicolons if there are multip
...
Call from the prompt function:
You can use the definitions of common functions. Profile so that they will log in every time, at the command prompt, you can work with them.
Alternatively, you can group the definition in a file into test.sh, and then execute the file by typing in the current shell:
$. test.sh
The effect of doing so results in any function defined within the test.sh, which can be read in the following
Checks the system hardware information of online servers, including: IP address (intranet, all), remote control card IP address, cpu information (number of cores), memory, hard disk, machine code, manufacturer, and product name #! /Bin/sh # Check the system hardware information of the online server #2012/01/05 ip = 'ifconfig | awk' {print $1, $2} '| grep-e 'link'-e 'inetaddr:' | awk '{if ($2 ~ /Link /)
Chec
in the script to find exactly.This script is suitable for the small and medium-sized machine room without monitoring platform patrol, the host running the script is not an online business Server. This script is also suitable for me just like the beginning of the shell novice practiced hand, using a relatively basic knowledge.The script reads as follows:#!/bin/bash#program:#thisprogramshowthe Onlinehost. #H
Online troubleshooting commands-Shell1. track online logs and regularly refresh the latest content: tail-fn 200 $ log 2. search for a specified String # only show the matched row grep $ String $ file # match the upper and lower lines of the String in the row grep-C n $ String $ file # number of rows matching the String grep $ String $ file | wc-l # match String highlighted grep -- color $ String $ file # us
Kill Oracle Online users and use root to execute this script on Oracle's serverParameter description for this Oracle user
Copy Code code as follows:
#!/bin/sh
function _oracleplus () {
Su-oracle-c "$oraclehome/bin/sqlplus/nolog" Connect/as Sysdba;
$
Exit
Eof
}
echo "START select Session!!!"
selectus= "SELECT ' Alter system kill session '" ' | | sid| | ', ' | | serial#| | ' from V\ $session where username= '; '
_oracleplus "$selectU
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.