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
相關文章
- Memcached
- 4.2 配置 RestartREST
- restart oracle streamRESTOracle
- onclick="return check()" 和 onclick="check()" 區別
- 4.1.1 Oracle Restart概述OracleREST
- How to Restart Qt ApplicationRESTQTAPP
- docker的restart策略DockerREST
- 3.3 Shutting Down a DatabaseDatabase
- 安裝 Memcached
- Memcached 原理剖析
- Memcached 協議協議
- jupyter-kernelRestart:restart failedRESTAI
- 4.1 關於 Oracle RestartOracleREST
- 3.3.4 Shutting Down with the Transactional Mode
- Check if String is HappyAPP
- 【node】process
- php開發memcachedPHP
- SVG restart 動畫屬性SVGREST動畫
- SVG restart動畫屬性SVGREST動畫
- 4.2.1 關於配置Oracle RestartOracleREST
- CF917E Upside DownIDE
- 21:Count Down設計模式設計模式
- CHECK_INTERFACE作用
- check_document_position
- SAP WM中階Storage Type的Capacity Check – Usage check based on SUT
- find process by port
- 4.5 通過SRVCTL 呼叫Oracle RestartOracleREST
- 4.2.4 向Oracle Restart 配置新增元件OracleREST元件
- Redis 和 Memcached 比較Redis
- [轉]memcached學習系列
- 4-bit shift register and down counter
- [LintCode] Check Full Binary Tree
- Mysql replication check指令碼MySql指令碼
- Check connection related issue of mysqlMySql
- 括展actuator health check
- [Symfony Component Process Exception RuntimeException] The Process class relies on proc_open, whichException
- RuntimeError: An attempt has been made to start a new process before the current process hasError
- SAP WM中階儲存型別的Capacity Check – Usage check based on material型別