Shift $ (($OPTIND-1))
This script can be installed or run directly, to see your own preferences. Non-toxic harmless, you can try, hahaha.
installation command:./tecmint_monitor.sh -i
Execute script command:./tecmint_monitor.sh
You can then execute the Monitor command in any one place, which is as simple as this:
You run the command to get a variety of the following information about the system:
Internet connectivity
Operating system Type
Original: http://blog.csdn.net/timchen525/article/details/76474017Problem Scenario:Develop the shell script to determine the size of the system's remaining memory, if less than 100MB, the message to the system administrator, and the script into the system scheduled tasks, that is, every 3 minutes to perform a check.In two steps:First step: scriptingThe script memory_mon.sh is as follows:[Plain]View PlainCopy
#!/bin/bash
Freemem= ' Free-m|awk ' nr==3 {print $NF} ' #获取系统当前的内存值, assig
:* * ** *topicName> >> /dev/nullHere is the topicname you want to monitor, the front 5 stars from left to right, respectively, representing minutes, hours, days, weeks, months. If you want to execute it in 5 minutes, you can write it as */5 * * * * , 10 minutes per hour, then write as * * *. Of course you can also output logs to a specified directory for later analysis:* * ** *topicName> >> /home/kafka/bin/getDataCount.logBecause only the need to analyze the total amount of data received per min
#!/bin/bash./etc/init.d/functionsif[' netstat-lntup| grep11211|wc-l '-lt1];then Action"Memcached serivce is error."/bin/falseExit1Fiecho-E"del key\r\n"| nc127.0.0.1 11211>/dev/NULLEcho-E"Set key 0 0 \r\noldboy1234\r\n"|nc127.0.0.1 11211>/dev/NULLmcvalues= ' Echo-e"Get key\r\n"|nc127.0.0.1 11211| grep OLDBOY1234|WC-l 'if[$MCValues-eq1];then Action"Memcached Service Status is OK."/bin/trueElseAction"Memcached Service Status is Error."/bin/falsefiECHO-E can be replaced by printfmemcached
Label:8 DBA most commonly used shell scripts for monitoring Oracle Databases--Go to Category: Linux A 8 Important scripts to monitor the Oracle database: 1. Check the availability of the instance 2. Check the availability of the listener 3. Check the alert log file for error messages 4. Empty the old log file before the log file is full 5. Analyze table and inde
} ":" TEMP "},
{" {#TABLENAME} ":" Sysaux "},
{" {#TABLENAME} ":" "},
{" {#TABLENAME} ":" Rows "}]}
[email protected] opt]#Another script is to get the last three columns of data in Tablespace.log, with the following script:[Email protected] opt]# cat/usr/local/zabbix/scripts/oracle_check.sh
#!/bin/bash
eq_data= "$"
zbx_ Req_data_tab= "$" source_data=/tmp/tablespace.log case $ in
maxmb) grep-e "$ZBX _req_data_tab" $SOURCe_data |awk ' {print $5*1024*10
Linux common system monitoring shell scriptsThe following is a few of my common Linux system monitoring scripts, we can change according to their own situation, I hope to give you a little help.1. Check the host network card traffic
#!/bin/bash
#network
#Mike. Xu
While:; Do
Time= ' Date +%m '-"%d" "%k": "%m"
day= ' Date +%m '-'%d '
Below is a few of my commonly used host monitoring scripts, we can change according to their own situation, and hope to give you a little help.1. Check the host network card traffic#!/bin/bash#network#mike.xuwhile:;dotime= ' Date+%m ' -"%d" "%k": "%M ' day= ' date+%m"-"%d" rx_before= ' ifconfigeth0|sed-n ' 8 "p|awk ' {print$2} ' |cut-c7-' tx_before= ' ifconfigeth0|sed-n ' 8 "p|awk ' {print$6} ' | cut-c7-
Tags: int definition mod partition real-time background warning ash sizeReal-time monitoring of the local memory and the remaining space on the hard disk, the remaining memory is less than 500M, the root partition remaining space is less than 1000M send alarm message to the root administrator1 Writing scripts[Email protected] ~]# vim jiankong.sh#!/bin/bash#此脚本中数字单位是kb, you can adjust the number size accordi
, this is one of its problems. (3). Use the MySQL client's commands and connect to MySQL with the account, and then determine whether MySQL is normal (local or remote connection state) based on the status of the command returned or what is returned. A common judgment script (just a few of the core content): 1 mysql-uroot-p1234-e'Select version (); '>/dev/null
2echo $? If the $0 above, the description is able to connect normally, if it is 1, then the connection failed. The disadvantage of this a
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.