check memcached process and restart if down
#!/bin/sh
#check memcached process and restart if down
PATH=$PATH:/usr/bin/memcached
DATE=`date -d "today" +"%Y-%m-%d-%H:%M"`
#用ps命令檢視memcached程式
MM=`ps -aux |grep "memcached" |grep "13250" |grep -v "grep" |wc -l`
#if語句判斷程式是否存在,如果不存在,輸出日誌記錄並重啟memcached服務
if [ "$MM" == "0" ]; then
echo "$DATE The memcached is problem and restart" >> /tmp/memcached_check.logs
/usr/bin/memcached -m 1024 -p 13250 -d -u nobody
else
echo "$DATE The memcached is ok" >>/tmp/memcached_check.logs
fi
相關文章
- alert檔案中出現:Auto-tuning: Shutting down background process GTXd
- update restartREST
- put it down?
- 4.2 配置 RestartREST
- restart oracle streamRESTOracle
- Memcached
- 4.1.1 Oracle Restart概述OracleREST
- docker的restart策略DockerREST
- Memcached筆記——(三)Memcached使用總結筆記
- Upside DownIDE
- Process Monitor Process (PMON) (121)
- 4.1 關於 Oracle RestartOracleREST
- SVG restart動畫屬性SVGREST動畫
- SVG restart 動畫屬性SVGREST動畫
- How to Restart Qt ApplicationRESTQTAPP
- onclick="return check()" 和 onclick="check()" 區別
- Memcached 協議協議
- Memcached 原理剖析
- 安裝 Memcached
- memcached 安裝
- memcached深度分析
- redis和memcachedRedis
- Memcached入門
- memcached安裝
- 3.3 Shutting Down a DatabaseDatabase
- BIEE Instance OracleBIPresentat DownOracle
- 4.2.1 關於配置Oracle RestartOracleREST
- jupyter-kernelRestart:restart failedRESTAI
- Oracle dedicated server process and shared server processOracleServer
- 3.3.4 Shutting Down with the Transactional Mode
- 21:Count Down設計模式設計模式
- php開發memcachedPHP
- PHP memcached,(set,get)PHP
- Ubuntu 安裝 MemcachedUbuntu
- ubuntu安裝memcachedUbuntu
- Memcached::cas 詳解
- memcached 安裝配置
- 4.2.4 向Oracle Restart 配置新增元件OracleREST元件