728x90
반응형
#!/bin/sh

#%# family=auto
#%# capabilities=autoconf

#GETNUM=`/bin/sh /home/test/bin/app/munin_rta.sh`

TODAY=`date +"%Y-%m-%d"`
TOMCAT_HOME2=/home/test/SERVER/

RTA1=0


MONITOR_LOG2=$TOMCAT_HOME2/logs/play_MONITOR.$TODAY.log

if [ -e $MONITOR_LOG2 ]; then
#RTA1=$(tail -n 1000 $MONITOR_LOG1 | grep "SESSION\[" | tail -n 5 | awk -F "SESSION" '{print $2}' | tr -d "[]")
RTA1=$(tail -n 3000 $MONITOR_LOG2 | grep WebSocketMonitor | grep SESSION | tail -n 1 | awk '{print $12}' | awk '{print substr($0, 9)}' | awk '{print substr($0, 0, index($0,"]")-1)}')
fi


if [ "$1" = "autoconf" ]; then
        if [ -n ${RTA1} ] ; then
                echo yes
                exit 0
        else
                echo no
                exit 0
        fi
fi

if [ "$1" = "config" ]; then
        echo 'graph_title User Session(Concurrent User)'
        echo 'graph_args -r --lower-limit 0'
        echo 'graph_vlabel users'
        echo 'graph_category Apps'
        echo 'total.label Total users'
        echo 'total.min 0'
        echo 'total.draw LINE2'
        echo 'total.type GAUGE'
        exit 0
fi

if [ -n ${RTA1} ] ; then
    echo "total.value $RTA1";
else
    echo "total.value U";
fi
728x90
300x250

'IT > Munin' 카테고리의 다른 글

Couchbase Munin Plugin 설정  (0) 2021.08.19
Munin App Exception 에 대한 체크  (0) 2021.07.30
Munin 플러그인 설정  (0) 2021.07.29
Connections-through-firewall 유효화  (0) 2021.07.29
Munin 노드 설치 및 구성  (0) 2021.07.07

+ Recent posts