banner



How To Install New Relic Infrastructure Agent

If y'all accept a New Relic Infrastructure Pro license, and unmonitored MySQL servers, in that location's now an easy solution at your fingertips. With the New Relic MySQL integration you can monitor and graph most any detailed metric you could possibly want. New Relic recently unified its analytics tools with New Relic One, a dashboard that provides quick admission to all the New Relic tools. With an Infrastructure Pro subscription, you become access to:

  • New Relic Infrastructure: Flexible, dynamic monitoring of your entire infrastructure, from services running in the deject or on dedicated hosts, to containers running in orchestrated environments.
  • New Relic Alerts: A flexible, centralized notification system that unlocks the operational potential of New Relic. Alerts is a single tool to manage alert policies and warning conditions for all of your New Relic information.
  • New Relic Logs: A fast, scalable log management platform that allows you to connect your log data with the balance of your telemetry data.
  • New Relic Insights: Allows y'all to query and chart your New Relic data. Insights is a software analytics resource for gathering and visualizing data about your software, and agreement what that data says about your business.
New Relic infrastructure amanuensis install

New Relic provides a nice magician page that generates the commands needed to install the infrastructure agent and configure it for your account. For our target Os (CentOS vii) the wizard generated the following commands for installation:

# Create a configuration file and add your license primal  echo "license_key: xxxxxxxxxxxxxxxxxxxxxx" | sudo tee -a /etc/newrelic-infra.yml &&  # Create the agent's yum repository  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 &&  # Update your yum cache  sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra' &&  # Run the installation script  sudo yum install newrelic-infra -y

Once you run the above commands, the infrastructure agent will begin sending OS metric data to New Relic (Note: We are making the assumption that you've already set up any firewalls needed for the New Relic infrastructure agent). If you desire a custom name for your host (Default is hostname) y'all can add  "display_name:  Name" to the /etc/newrelic-infra.yml file. Y'all tin can add tags as custom_attributes and can employ them to describe the host'due south function. All of the configuration options can exist found here and below is a sample /etc/newrelic-infra.yml file using the display_name and custom_attributes options:

license_key: 1db211983ab4871600faef016f5235066f208fd5  display_name: mysql-qa-usw-a-1 verbose: 0 custom_attributes:    env: QA    app: MySQL    team: Pythian

This takes care of getting the host level metrics into New Relic, simply we really desire to collect MySQL metrics and so we tin can be alerted for specific database problems. To collect MySQL metrics, we need to install the MySQL integration and have an Infrastructure Pro account. The Link to the MySQL integration provides these simple instructions for installation:

sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra' sudo yum install nri-mysql

The higher up commands will install the MySQL integration on my CentOS 7 hosts just nosotros will still demand to set upwardly a MySQL user and customize the MySQL integrations configuration file earlier we start collecting MySQL information. Using the MySQL command line, create a user with replication privileges :

mysql> CREATE USER 'newrelic'@'localhost' IDENTIFIED BY 'YOUR_SELECTED_PASSWORD';  mysql> GRANT REPLICATION Customer ON *.* TO 'newrelic'@'localhost' WITH MAX_USER_CONNECTIONS v

Modify the directory to the integration's folder and copy the sample configuration file:

# Change the directory to the integration'due south folder. cd /etc/newrelic-infra/integrations.d # Copy the sample configuration file: sudo cp mysql-config.yml.sample mysql-config.yml # Edit the file mysql-config.yml every bit shown beneath substituting the hostname, user, password: vi /etc/newrelic-infra/integrations.d/mysql-config.yml
integration_name: com.newrelic.mysql instances:   - name: mysql-server     command: condition     arguments:     	hostname: localhost     	port: 3306     	username: newrelic     	password: xxxxxxxxxxx     	extended_metrics: 1     	extended_innodb_metrics : 1     	# New users should go out this property as `true`, to identify the     	# monitored entities as `remote`. Setting this property to `false` (the     	# default value) is deprecated and will be removed soon, disallowing     	# entities that are identified as `local`.     	# Please check the documentation to get more information almost local     	# versus remote entities:     	# https://github.com/newrelic/infra-integrations-sdk/blob/master/docs/entity-definition.doctor     	remote_monitoring: true     labels:     	env: production     	role: Master

Note, in the to a higher place configuration file we accept enabled both extended_metrics and extended_innodb_metrics for MySQL. The complete list of the MySQL metrics is quite extensive, and custom graphs and alerts tin can be created for any of them. The side by side step is to restart the infrastructure agent:

systemctl restart newrelic-infra.service

Now that we have New Relic Infrastructure collecting information about our MySQL server(s) we tin start creating custom graphs along with alert policies and notification actions.

By signing in at https://login.newrelic.com/login nosotros can see the MySQL hosts we added to New Relic Infrastructure.

MySQL hosts added to New Relic Infrastructure.

Now we're ready to create alerts on whatever weather condition / data New Relic collects. With the MySQL integration we have a big selection of metrics to choose from:

Metrics available from MySQL integration when creating alerts on any conditions / data New Relic collects.

For our setup we are going to create a simple alert that will notify us whenever replication is stopped. In guild to set up alerting, yous need to create a new notification channel. To ready upwardly a notification channel, click on the alerts menu item. Side by side, selection the "Notifications channels" tab on the alerts page.

Using the alert notifications tab to create an alert to warning of stopped replication.

New Relic Alerts provides a nice option of notification channels / integrations for alerting including Slack, PagerDuty, OpsGenie, XMatters and, of course, e-mail.  One time you have a notification channel fix, you tin create a channel policy for receiving notifications:

Creating a channel policy for alerting covering Slack, PagerDuty, OpsGenie, XMatters and email.

Once you accept a notification aqueduct and policy defined you tin can commencement creating warning weather condition:

Creating alert conditions within the notification channel.

Beneath you can run into I picked the "Integrations" warning type to become the list of MySQL metrics. I then chose the "MySQLSample" and narrowed the scope to MySQL servers with the "cluster – node blazon" of slave. This volition enable this alert on all New Relic hosts fix with the MySQL integration that are slave members using replication.

Enabling an alert on all New Relic hosts set up with the MySQL integration that are slave members using replication.

We define the measurement threshold for the metric. In this case it's e'er "ane" when replication is running and "0" when it'southward stopped. We also choose the warning policy / notification aqueduct, and so click "create."

Defining the measurement threshold for the metric and choosing the alert policy / notification channel.

And we have created our first alert.

First alert is created.

It's important to make sure you lot're targeting the proper servers for each alert. In our example above, for the "narrow down entities" choice, we indirectly targeted only MySQL DB Servers by choosing a metric that only MySQL instances will send to our New Relic business relationship. That's swell for this metric, but as the DBA (database administrator) we don't desire to get paged for anything other than the database hosts and database server issues.

One way we tin can narrow downward entities is via tags or other attributes. To ensure you are only monitoring the hosts you are targeting it's a best do to utilize tags generously in your infrastructure deployment code and leverage them in "narrow down entities" for precise monitor targeting. For monitoring the "MySQL Server Downwardly" condition, we'll employ the general host level metrics and leverage the process information to alert only when we run across a count of zero /usr/sbin/mysqld processes. With a few more than clicks I have at present added MySQL database server alerts for excessive CPU atmospheric condition, max_connections or MySQL Server failures:

Adding MySQL database server alerts for excessive CPU conditions, Max Connections or MySQL Server failures.

Another mode to explore these metrics is to apply the Data Explorer which is role of "New Relic Insights" and tin be constitute every bit a tab in New Relic Infrastructure. Data Explorer lets you list / graph individual metrics and build alerts if desired. Below you can run into I was examining the metric "Avg Cluster.Seconds Behind Chief":

Data Explorer allows listing / graphing of individual metrics and building of alerts if desired.

With Insights and its tools you can explore your data and create custom dashboards:

Exploring your data and creating custom dashboards in New Relic Insights.

Hopefully this post has provided you with a helpful overview of the type of MySQL alerting and monitoring you can fix using New Relic Infrastructure.

Want to talk with an expert? Schedule a call with our squad to get the chat started.

Source: https://blog.pythian.com/setting-up-mysql-monitoring-with-new-relic-infrastructure-pro/

Posted by: millerhambir.blogspot.com

0 Response to "How To Install New Relic Infrastructure Agent"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel