This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script monitors CPU and memory usage | |
# Get the current usage of CPU and memory | |
cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}') | |
memUsage=$(free -m | awk '/Mem/{print $3}') | |
# Print the usage | |
echo "CPU Usage: $cpuUsage%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: ensure ufw installed | |
apt: name=ufw update_cache=true | |
- name: ufw deny incoming | |
ufw: | |
direction: incoming |