Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Cloud watch agent for logs and use of PStore

wget https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

sudo rpm -U ./amazon-cloudwatch-agent.rpm


# IAM ROLE

EC2 Role
EC2
CloudWatchAgentServerPolicy
And AmazonSSMFullAccess 
CloudWatchRole

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
# Accept all defaults, until default metrics .. pick advanced.

# then when asking for log files to monitor

# 1 /VAR/LOG/SECURE
/var/log/secure
/var/log/secure
(Accept default instance ID)

# 2 /var/log/httpd/access_log
/var/log/httpd/access_log
/var/log/httpd/access_log
(Accept default instance ID)

# 3 /var/log/httpd/error_log
/var/log/httpd/error_log
/var/log/httpd/error_log
(Accept default instance ID)

# Config will be stored in /opt/aws/amazon-cloudwatch-agent/bin/config.json and stored in SSM

# Bug Fix
sudo mkdir -p /usr/share/collectd/
sudo touch /usr/share/collectd/types.db

# Load Config and start agent
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c ssm:AmazonCloudWatch-linux -s
Comment

PREVIOUS NEXT
Code Example
Shell :: docker pull 
Shell :: array difference powershell 
Shell :: ssh to gcp vm 
Shell :: display two content linux 
Shell :: how to change default directory in linux 
Shell :: microk8s port forward 
Shell :: get specific version of package 
Shell :: uvicorn post unsupported upgrade request 
Shell :: ubuntu uninstall google chrome 
Shell :: sed insert string at beginning of line matching pattern 
Shell :: mongoimport source list ubuntu 20.04 
Shell :: PULSEUADIO to PIPEWIRE default.pa - pipewire.conf 
Shell :: zsh: permiso denegado: /home/sebastian/.bash_aliases 
Shell :: ubuntu tftp server 
Shell :: Transfer all the changes made to a single file between git branches 
Shell :: wingpersonal linux mint 
Shell :: function in shell script returning 0 only 
Shell :: linux mint suspend keybinding cli 
Shell :: how to only adda and commit file that was changed in git 
Shell :: undo the most recent local commits in Git 
Shell :: Because you can never quite anticipate in which environment your particular zsh will be launched in, it is good practice to reset the options at the beginning of your script with the emulate command: 
Shell :: oppia linting test 
Shell :: nstall the XmlDoc2CmdletDoc NuGet package into your project. 
Shell :: raspi ssh passwort vergessen 
Shell :: github labeler example 
Shell :: debian kernel ppa 
Shell :: install chef client centos 
Shell :: convert docker compose yml to kubernetes online 
Shell :: install webex with wine 
Shell :: fslmaths subtract 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =