-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance-spec.sh
More file actions
executable file
·62 lines (49 loc) · 1.24 KB
/
instance-spec.sh
File metadata and controls
executable file
·62 lines (49 loc) · 1.24 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
#!/usr/bin/env bash
# Check if running on AWS by testing metadata service
IS_AWS=false
if curl -s --max-time 2 http://169.254.169.254/latest/meta-data/ > /dev/null 2>&1; then
IS_AWS=true
fi
echo "======================================"
if [ "$IS_AWS" = true ]; then
echo " AWS INSTANCE SPECIFICATION DUMP"
else
echo " SYSTEM SPECIFICATION DUMP"
fi
echo " Generated: $(date)"
echo " Hostname : $(hostname -f)"
echo "======================================"
echo
if [ "$IS_AWS" = true ]; then
echo "=== INSTANCE TYPE ==="
curl -s http://169.254.169.254/latest/meta-data/instance-type || echo "Metadata not available"
echo
echo "=== INSTANCE ID ==="
curl -s http://169.254.169.254/latest/meta-data/instance-id || echo "Metadata not available"
echo
echo "=== AVAILABILITY ZONE ==="
curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone || echo "Metadata not available"
echo
fi
echo "=== CPU INFO ==="
lscpu
echo
echo "=== MEMORY ==="
free -h
echo
echo "=== BLOCK DEVICES ==="
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
echo
echo "=== DISK USAGE ==="
df -hT
echo
echo "=== NETWORK INTERFACES ==="
ip addr show
echo
echo "=== ROUTING TABLE ==="
ip route show
echo
echo "=== KERNEL & OS INFO ==="
uname -a
cat /etc/os-release
echo