layout | title |
---|---|
default |
NewRelic |
Go to Monitoring and Logging workshop folder: $HOME/monitoring-logging-workshop
Start provisioned virtual machines: vagrant up --no-provision
Check virtual machines status: vagrant status
echo "license_key: YOUR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml
cat /etc/os-release
sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64/newrelic-infra.repo
sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
sudo yum install newrelic-infra -y
sudo systemctl start newrelic-infra.service
sudo systemctl status newrelic-infra.service
`
In your system go to newrelic-infra logging folder: cd /etc/newrelic-infra/logging.d
Create a copy of file.yml.example: cp file.yml.example file.yml
Edit the copied .yml file to have the following configurations:
vim file.yml
logs:
# Fetch syslog
- name: syslog
file: /var/log/syslog
Enable logging by editing /etc/newrelic-infra.yml
license_key: <license key>
log_file: /var/log/newrelic-logs.log
Restart the agent using systemctl
sudo systemctl restart newrelic-infra.service
NRQL> SELECT max(`host.disk.usedPercent`) FROM Metric
View Infrastructure events in a table view since 11AM till now
NRQL> SELECT * FROM InfrastructureEvent SINCE '11:00' UNTIL now
Get unique count of user sessions for the entire week
NRQL> SELECT uniqueCount(session) FROM PageView SINCE 1 week ago
How many of our infrastructure instances run Linux as main OS?
NRQL> SELECT count(`host.operatingSystem`) FROM Metric WHERE host.operatingSystem ='linux' SINCE 1 day ago
Link your AWS Account to New Relic
-
Go to one.newrelic.com > Infrastructure > AWS
-
From the IAM console, click Create role, then click Another AWS account:
a) For Account ID, use
754728514883
.b) Check the Require external ID box. For External ID, enter your New Relic account ID (Account Settings > API Keys).
c) Do not enable the setting to Require MFA (multi-factor authentication).
-
Attach the Policy
ReadOnlyAccess
-
Name the role name as
NewRelicInfrastructure-Integrations
-
Add Inline Policy with the following permission statement:
{
"Statement": [
{
"Action": [
"budgets:ViewBudget"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "2012-10-17"
}