File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ echo " Enter Your Name : "
3+ read username
4+
5+ if id " $username " & > /dev/null
6+ then
7+ echo " User Already Exists"
8+ else
9+ sudo useradd $username
10+ sudo passwd $username
11+ echo " User $username created successfully "
12+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ THRESHOLD=80
3+ USAGE=$( df / | tail -1 | awk ' {print $5}' | sed ' s/%//' )
4+ if [ $USAGE -gt $THRESHOLD ]
5+ then
6+ echo " Warning : Disk Usage above $THRESHOLD %"
7+ else
8+ echo " Disk Usage is Normal"
9+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ echo" ================== System Monitoring ==================="
3+
4+ echo" ================= Memory Usage ========================"
5+ echo " Memory Usage is : $( free -h) "
6+
7+ echo " =============== Disk Usage =========================="
8+ echo " Disk Usage is : $( df -h) "
9+
10+ echo " ==================== UPTIME ===================="
11+ echo " UpTime is : $( uptime) "
12+ echo " On Date $( date) "
13+
14+ echo " ============= Running Processes ==============="
15+ echo " Running Processes Are : $( top | head -6) "
16+
17+ echo " ========================== Monitoring Completed ======================================"
You can’t perform that action at this time.
0 commit comments