-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
46 lines (42 loc) · 662 Bytes
/
Copy pathscript.sh
File metadata and controls
46 lines (42 loc) · 662 Bytes
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
#!/bin/bash
<< TODO
Bash Script that checks:
1. Memory Usages
2. CPU Load
3. Number of TCP connections
4. Kernal Version
TODO
server_name=$(hostname)
function memory_check(){
echo ""
echo "Memory Usage on ${server_name} is:"
free -h
echo ""
}
function CPU_load(){
echo ""
echo "CPU Load time on ${server_name} is:"
uptime
echo ""
}
function tcp_check(){
echo ""
echo "TCP Connections on ${server_name} is:"
echo ""
cat /proc/net/tcp | wc -l
echo ""
}
function kernal_check(){
echo ""
echo "Kernal Version on ${server_name} is:"
echo ""
uname -r
echo ""
}
function all_check() {
memory_check
CPU_load
tcp_check
kernal_check
}
all_check