Plugins jstat__*: fix shellcheck issues; switch from bash to sh

This commit is contained in:
Lars Kruse 2018-07-04 04:14:33 +02:00
parent f5e6d7ea17
commit 67f9783780
3 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Plugin for monitor JVM activity - GC Count -
#
@ -64,7 +64,7 @@ get_jdk_type() {
print_config() {
echo 'graph_title GC Count' $graphtitle
echo "graph_title GC Count $graphtitle"
echo 'graph_args -l 0'
echo 'graph_vlabel GC Count(times)'
echo 'graph_total total'
@ -73,7 +73,7 @@ print_config() {
echo 'Young_GC.label Young_GC'
echo 'Young_GC.min 0'
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
echo 'Old_GC.label Old_GC'
echo 'Old_GC.min 0'
else
@ -86,7 +86,7 @@ print_config() {
print_stats() {
local pid_num="$1"
local awk_script
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
# shellcheck disable=SC2016
awk_script='{ YC = $4; OC = $5; print "Young_GC.value " YGC; print "Old_GC.value " FGC; }'
elif [ "${JDK_TYPE}" = "sun15" ]; then
@ -110,7 +110,7 @@ if [ "$1" = "autoconf" ]; then
exit 1
fi
if [ ! -f "${pidfilepath}" -o ! -r "${pidfilepath}" ]; then
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Plugin for monitor JVM activity - GC Time -
#
@ -64,7 +64,7 @@ get_jdk_type() {
print_config() {
echo 'graph_title GC Time' $graphtitle
echo "graph_title GC Time $graphtitle"
echo 'graph_args -l 0'
echo 'graph_vlabel GC Time(sec)'
echo 'graph_total total'
@ -73,7 +73,7 @@ print_config() {
echo 'Young_GC.label Young_GC'
echo 'Young_GC.min 0'
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
echo 'Old_GC.label Old_GC'
echo 'Old_GC.min 0'
echo 'Young_Pause.label Young_GC Pause'
@ -90,7 +90,7 @@ print_config() {
print_stats() {
local pid_num="$1"
local awk_script
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
# shellcheck disable=SC2016
awk_script='{
YCTime = $6;
@ -130,7 +130,7 @@ if [ "$1" = "autoconf" ]; then
exit 1
fi
if [ ! -f "${pidfilepath}" -o ! -r "${pidfilepath}" ]; then
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Plugin for monitor JVM activity - Heap Usage -
#
@ -64,13 +64,13 @@ get_jdk_type() {
print_config() {
echo "graph_title Heap Usage" $graphtitle
echo "graph_title Heap Usage $graphtitle"
echo "graph_args --base 1024 -l 0"
echo "graph_vlabel Heap Usage(Bytes)"
echo "graph_info Heap Usage"
echo "graph_category virtualization"
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
echo "NurserySize.label NurserySize"
echo "HeapSize.label HeapSize"
echo "UsedHeapSize.label UsedHeapSize"
@ -105,7 +105,7 @@ print_config() {
print_stats() {
local pid_num="$1"
local awk_script
if [ "${JDK_TYPE}" == "bea" ]; then
if [ "${JDK_TYPE}" = "bea" ]; then
# shellcheck disable=SC2016
awk_script='{
HeapSize = $1;
@ -185,7 +185,7 @@ if [ "$1" = "autoconf" ]; then
exit 1
fi
if [ ! -f "${pidfilepath}" -o ! -r "${pidfilepath}" ]; then
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi