diff --git a/README.md b/README.md index 9a22165..603bab5 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,10 @@ * bin/check-cmd.rb * bin/check-process-restart.rb * bin/check-process.rb - * bin/check-process.sh - * bin/metrics-process-status + * bin/check-threads-count.rb + * bin/metrics-process-status.rb + * bin/metrics-processes-threads-count.rb + * bin/process-uptime-metrics.sh ## Usage diff --git a/bin/check-process.sh b/bin/check-process.sh deleted file mode 100644 index a047765..0000000 --- a/bin/check-process.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# Check process -# -# === -# -# Examples: -# -# # check by process name -# check-process.sh -p nginx -# -# # check by PID file -# check-process.sh -f /var/spool/postfix/pid/master.pid -# -# Date: 2014-09-12 -# Author: Jun Ichikawa -# -# Released under the same terms as Sensu (the MIT license); see LICENSE -# for details. - -# get arguments -while getopts 'p:f:h' OPT; do - case $OPT in - p) PROCESS=$OPTARG;; - f) PID_FILE=$OPTARG;; - h) hlp="yes";; - *) unknown="yes";; - esac -done - -# usage -HELP=" - usage: $0 [ -p value -f value -h ] - - -p --> process name - -f --> file path to pid file - -h --> print this help screen -" - -if [ "$hlp" = "yes" ]; then - echo "$HELP" - exit 0 -fi - -if [ ${PROCESS} ]; then - scriptname=`basename $0` - ret=`ps aux | grep "${PROCESS}" | grep -v grep | grep -v $scriptname` - if [ ! "${ret}" ]; then - echo "CRITICAL - process ${PROCESS} does not exist" - exit 2 - fi - echo "PROCESS OK - ${PROCESS}" - exit 0 -fi - -if [ ${PID_FILE} ]; then - if [ ! -e ${PID_FILE} ]; then - echo "CRITICAL - PID file ${PID_FILE} does not exist" - exit 2 - fi - pid=`cat ${PID_FILE} | tr -d ' '` - if [ ! -f /proc/${pid}/status ]; then - echo "CRITICAL - status of ${PID_FILE} not found" - exit 2 - fi - echo "PROCESS OK - ${PID_FILE}" - exit 0 -fi - -echo "$HELP" -exit 2