-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem_stat.sh
More file actions
executable file
·85 lines (66 loc) · 1.72 KB
/
system_stat.sh
File metadata and controls
executable file
·85 lines (66 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
exec 3>&1 1>STATS_FILE.txt 2>&1
get_fsstat()
{
echo "=========================================="
echo "Getting the filesystem stats"
echo "=========================================="
df -h
}
get_diskusestat()
{
echo "=========================================="
echo "Getting the jboss stats"
du -sh $PWD/jboss*/
du -sh $PWD/jboss*/*
echo "=========================================="
echo "Getting the standalone stats within jboss"
du -sh $PWD/**/standalone/*
echo "=========================================="
echo "Getting the jboss tmp directory stats"
du -sh $PWD/jboss*/standalone/tmp/
du -sh $PWD/**/standalone/tmp/*
echo "=========================================="
#du -sh /home/$USER/jboss-*/*
#du -sh **/standalone/
}
list_war()
{
echo "=========================================="
echo "Getting all the wars and size within the jboss"
find $PWD/jboss* -name *.war -exec du -sh {} \;
:<<COMMENTS
echo "==========================================" >&3
echo "WAR FILES FOUND" >&3
echo "==========================================" >&3
for war in $(find $PWD/jboss* -name *.war)
do
echo $war >&3
done
echo "==========================================" >&3
COMMENTS
echo "=========================================="
}
get_folderstat()
{
if [[ "$#" -gt 1 ]]
then
echo "more than one folder"
for folder in "$@"
do
#echo "$folder"
du -sh $folder
done
fi
}
echo "Calling file_system stat funtion.." >&3
get_fsstat 1>&3
echo "Getting all .war withing jboss" >&3
list_war
echo "Calling jboss stat funtion.." >&3
get_diskusestat
#echo "Calling the folder stat function"
#FOLDER1=/home/jenkins/LOGS/
#FOLDER2=/home/jenkins/workspace/*
#get_folderstat $FOLDER1 $FOLDER2 >&3
#sshpass -p "$PASS" ssh jenkins@192.168.83.15