Skip to content

Commit 86eba5d

Browse files
committed
changed function order per convention
1 parent 66b7499 commit 86eba5d

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed

bin/v_list_sys_rrd

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,36 @@ json_list_rrd() {
2020
if [ "$i" -ne 1 ]; then
2121
echo -e "\t},"
2222
fi
23-
echo -e "\\t\"$i\": {"
23+
24+
# Define title
25+
if [ "$type" = 'la' ]; then
26+
title="Load Average"
27+
fi
28+
29+
if [ "$type" = 'mem' ]; then
30+
title="Memory Usage"
31+
fi
32+
33+
if [ "$type" = 'net' ]; then
34+
title="Bandwidth Usage $rrd"
35+
fi
36+
37+
if [ "$type" = 'web' ] || [ "$type" = 'ftp' ] ||\
38+
[ "$type" = 'ssh' ]; then
39+
title="$(echo $rrd| tr '[:lower:]' '[:upper:]') Usage"
40+
fi
41+
42+
if [ "$type" = 'db' ]; then
43+
db_type=$(echo $rrd|cut -f 1 -d _ |sed -e 's/mysql/MySQL/g' \
44+
-e 's/pgsql/PostgreSQL/g' )
45+
db_host=$(echo $rrd|cut -f 2 -d _ )
46+
title="$db_type Usage on $db_host"
47+
fi
48+
49+
echo -e "\t\"$i\": {"
2450
echo -e "\t\t\"TYPE\": \"$type\"",
25-
echo -e "\t\t\"RRD\": \"$rrd\""
51+
echo -e "\t\t\"RRD\": \"$rrd\"",
52+
echo -e "\t\t\"TITLE\": \"$title\""
2653
(( ++i))
2754
done
2855
done

bin/v_list_web_templates

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ format=${2-shell}
1313
source $VESTA/conf/vars.conf
1414
source $V_FUNC/shared.func
1515

16-
17-
#----------------------------------------------------------#
18-
# Verifications #
19-
#----------------------------------------------------------#
20-
21-
# Checking arg number
22-
check_args '1' "$#" 'user'
23-
24-
# Checking argument format
25-
format_validation 'user'
26-
27-
# Checking user
28-
is_user_valid
29-
3016
# Json function
3117
json_list_wtpl() {
3218
i='1' # iterator
@@ -68,6 +54,20 @@ shell_list_wtpl() {
6854
}
6955

7056

57+
#----------------------------------------------------------#
58+
# Verifications #
59+
#----------------------------------------------------------#
60+
61+
# Checking arg number
62+
check_args '1' "$#" 'user'
63+
64+
# Checking argument format
65+
format_validation 'user'
66+
67+
# Checking user
68+
is_user_valid
69+
70+
7171
#----------------------------------------------------------#
7272
# Action #
7373
#----------------------------------------------------------#

bin/v_update_sys_rrd_ssh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#!/bin/bash
32
# info: updating ssh rrd
43

0 commit comments

Comments
 (0)