Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement automatic Patrol script based on Solaris 10 Linux in SharePlex

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how SharePlex realizes automatic inspection script based on Solaris 10 Linux. It is very detailed and has certain reference value. Interested friends must read it!

1.check script, which can be executed alone or called through start script

#! / bin/bash# Created by czh version v1.0# This script was used to check SharePlex Instance health.# This Script was created on RHEL 7.6 Platform and SunsOS 10.5.#### # MailUserName='yourname@yourcompany'#if ["$MailUserName" = "yourname@yourcompany"] # then# echo "Please modify the script so it has a valid email address" # exit 0#fi# # # Start Scriptsv_cop= `ps-ef | grep sp_cop | grep-v grep | awk'{print $2} '`vultranumnum mirror = `ps-ef | grep sp_cop | grep-v grep | awk' {print $2}'| wc-l`v _ os= `uname-a | awk'{print $1} '`i=1if [${v_os} = "SunOS"] Then while [$I-le ${v_num_cop}] do vainpid`echo ${v_cop} | / usr/xpg4/bin/awk-v vSecreti = "${I}"'{print $vSecreti} '`vroomscriptSecretname`echo $0`vroomdirname`dirname ${v_script_name} `SP_SYS_HOST_NAME= `pfiles ${v_pid} | grep sockname | sed-n' $p' | awk'{print $3}'` SP_PORT= `pfiles $v_pid | grep sockname | sed-n'$p' | awk'{print $5} '`pps-ef | grep sp_cop | grep-v grep | grep ${v_pid} | awk' {print $8}'| cut-d'.'- F1 | sed's /\ / $/ / `SP_SYS_VARDIR= `pfiles ${v_pid} | sed-n'$p' | sed-n's /\ / rim//p' | tr-d "`export SP_SYS_VARDIR export SP" _ SYS_HOST_NAME ${SP_PRODIR} / bin/sp_ctrl > ${v_dirname} / splex_temp.log / dev/nullkill-9 `ps-ef | grep start_check.sh | grep-v grep | awk'{print $2}'`2 > / dev/null

4.Readme file

1. Start to detect the role of the script: (1) create a splex_check_log directory in the directory where the script is located (2) store the generated log files at the beginning of SharePlex_Report_, and record SharePlex instances (3) execute once every 20 minutes by default You can change the execution frequency by modifying the script interval parameters (4) it will automatically delete the directory three days ago or if the log directory exceeds 50m, it will automatically delete the directory reconstruction (5) the script automatically calls the check_shareplex_health.sh script under the directory (6) the script execution steps are as follows: chmod uplink x start_check.shchmod uplink x stop_check.shchmod uplink x check_shareplex_health.sh./start_check.sh & 2. Stop the script using the following script function: (1) find out to execute the script process and execute the kill command. / stop_check.sh3.check_shareplex_health.sh script description (1) the script for start_check.sh finally calls the patrol script (2) the mailbox sends an alarm function with the default comment status, if the alarm sends an email, you can edit the check_shareplex_health.sh script a. Configure the server sendmail function to ensure that the server can send mail b. Remove the note c. From the beginning of the check_shareplex_health.sh email. Change the MailUserName variable to the email address you need to send, and remove the comment # in front of the 48-line pipe character to use the email function. The above is all the contents of the article "how to implement automatic Inspection script based on Solaris 10 Linux in SharePlex". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report