Shell's service anomaly monitoring case

Example one: Web server Nginx Script service monitoring[Email protected]/server/scripts] #cat jiance_ng.sh#!/bin/bashif! Ss-lntup|grep [N]ginx &>/dev/nullThen/etc/init.d/nginx startecho "Nginx dead,but It's OK" |mail-s "WHW11" [email

"Shell" Linux Shell Case detailed

In general, case is a judgment statement that is easier to understand than if.Case Statement Formatcase in 变量 值1) 内容 ;;值2) 内容 ;;esacNote: Each content needs to be added after;; , can be written across rows or peers. Instance: Executes

Shell script Dish

Shell Script Menu Operation case:#!/bin/bashwhile truedo#       clearcat Shell script Dish

Shell exercises (15)

Exercise 1:Monitor network cardrequirements: every 10 minutes to detect the specified network card traffic, if the network card traffic is 0, restart the network card! (Use cron Task Scheduler!) )Reference Answer:#!/bin/bash# date:2018 March 21 lang=

"Shell" Linux shell location variables detailed

Linux Shell location Variables in detail what are positional variables? Simply put, when the user runs the script, input parameters, the variables corresponding to these parameters are called positional variables.

Shell+expect Completing the remote startup service

Expect script: file name: expect_ssh#!/usr/bin/expectset host [lindex $argv 0]set username [lindex $argv 1]set Password [lindex $argv 2]spawn ssh [email prote CTED] $hostexpect {"(yes/no)?" {send "yes\n" expect "*assword:" {send "$password \ n"}}

Shell scripts--writing CGI code

Recommend the initial CGI, after reading the approximate, probably to the CGI has a general impression. Here's how to write code in a CGI script that implements a mix of shell and HTML tags:#!/bin/bash#index.cgiecho

Shell script (2)-if statement

If statement1. What is a conditional test operation?To make a shell script "intelligent", the problem is to differentiate between different situations to determine what action to take. The shell environment, based on the return status value ($?)

Shell Exercises (12)

Exercise 1:Detect file ChangesRequirements: There are two Linux servers A and B, if a can ssh directly to B, do not enter the password. A and B have a directory called/data/web/. Here are a lot of files, of course, we do not know the specific number

Solve SecureCRT Spark-shell in Scala can't remove the problem

Transferred from: http://blog.csdn.net/huanbia/article/details/51318278Problem description When using SECURECRT to open Spark-shell, sometimes the following problems, when the wrong time to press the BACKSPACE (BACKSPACE) or delete (delete key),

Shell File Test Operators

File Test OperatorsFile test operators are used to detect various properties of Unix files.Attribute detection is described as follows: operator Description Example -B File Detects if the file is a

Shell Exercises (iv)

Exercise 1:Backing Up the databaseRequirements: Design a shell script to back up the database, first save a copy of the data on the local server, and then remotely copy a copy, save the week of data locally, Remote Storage for one monthsAssume that

The meaning of each parameter in the shell script

File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Shell programming------Looping Statements

1. For Loop statement:Two common ways to use for: notation (1): for inch 1 2 3 4 5 (PS in $ (seq15 in {1). 5 }) do echo"$val " DoneNotation (2):   for ((i=0;i; i++)) ( PS: Must Be for (()) ) { "val=i%2"

Linux Shell Learning Notes

The first line of the shell script illustrates the path to the interpreter: #!/bin/bashRun the script two ways: Use the bash command to run the shell file, or grant the script file execution permissions, you can directly execute the fileWhen the

Common parentheses in Shell Usage Summary Linux Course learning

LinuxSmall Brackets()and curly braces{}is the execution of one of these commands, but there is a certain difference, and its specific meaning is as follows:(): Commands within parentheses are executed in a child shell (()): Compare and calculate the

Shell special Characters

Special symbols Wildcard characters, any character? Any of the characters. #注释字符\ de-Semantic characters| Pipeline Several commands related to pipelinesCut select information for the row analysisMain parameters-B: Split in bytes. These

Getting Started with Linux fifth day--shell script Getting Started (bottom) debugging debug of Basic grammar

first, how to debug 1. Parameters through the SH command:SH [-NVX] Scripts. SH options and Parameters:-N: Do not execute script, query syntax only;-V: Before executing sccript, output the contents of scripts to the screen;-x: script to be used The

Shell script Programming Shell array

1.bash supports one-dimensional arrays (multidimensional arrays are not supported) and does not qualify the size of the array(1) define an array:Array_name= (value0 value1 value2 value3)OrArray_name= (Value0Value1value2Value3)or individually defined:

Win10, the Cmd,power shell is set to the default encoding of ' UTF-8

Power ShellNote: The following content is written on a non-Windows platform, there may be spelling errors, if any, please correct me, I will amend as soon as possible. It can be implemented using the PowerShell configuration file (\ Profile). \)The

Total Pages: 541 1 .... 343 344 345 346 347 .... 541 Go to: GO

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.