Join the community today
Become a Member

Upgrade Nginx Redis Insight Guide Newrelic + PHP Agent Install

Discussion in 'Centmin Mod Insights' started by eva2000, Apr 15, 2017.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    54,087
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    11:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    This is a quick install guide for Newrelic agent + PHP Agent below. You'd need to read the documentation and find your Newrelic license key for the below steps.


    Install Newrelic Agent + PHP-Agent



    replace <your-key-goes-here> with your newrelic license key
    Code (Text):
    rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
    yum install newrelic-sysmond newrelic-php5
    nrsysmond-config --set license_key=<your-key-goes-here>
    /etc/init.d/newrelic-sysmond start
    chkconfig newrelic-sysmond on
    chkconfig newrelic-daemon on
    newrelic-install install
    

    Output for newrelic-install install command
    Code (Text):
    New Relic PHP Agent Installation (interactive mode)
    ===================================================
    
       Enter New Relic license key (or leave blank): LICENSENUMBER
    
    Below is a list of the directories in which we found a copy of PHP.
    Please select the directory or directories for which you wish to install
    New Relic. You can select either a single directory or
    multiple directories by separating each choice with either a space or a
    comma. To select all of the directories shown, please enter the special
    keyword 'all' (without the quotes).
    
       1)   /usr/local/bin
       2)   /usr/local/bin
    
       0)   Exit
    
       Selection (1-2, 0 to exit or all): 1
    
    Found a valid PHP in : /usr/local/bin
             PHP Version : 7.0.18
      Module API version : 20151012
        Module directory : /usr/local/lib/php/extensions/no-debug-non-zts-20151012
      Zend Thread Safety : no
       CLI ini directory : /etc/centminmod/php.d
          Install Status : OK
    
    New Relic is now installed on your system. Congratulations!
    
    1. Set newrelic.appname in your newrelic.ini file.
    
    2. Restart your web server. This will fix most reporting issues and
       load the agent's new features and bug fixes.
    
    If you have questions or comments, go to http://support.newrelic.com.
    


    Configure Newrelic PHP Agent



    Create the php newrelic.ini settings file at /etc/centminmod/php.d/newrelic.ini

    replace <your-key-goes-here> with your newrelic license key
    Code (Text):
    echo 'newrelic.license="<your-key-goes-here>\"' > /etc/centminmod/php.d/newrelic.ini
    echo "newrelic.appname=\"$(hostname) PHP Application\"" >> /etc/centminmod/php.d/newrelic.ini
    echo 'extension="newrelic.so"' >> /etc/centminmod/php.d/newrelic.ini
    

    contents of newrelic.ini would be like
    Code (Text):
    newrelic.license="<your-key-goes-here>"
    newrelic.appname="host.domain.com PHP Application"
    extension="newrelic.so"
    

    restart php-fpm service
    Code (Text):
    fpmrestart
    

    check that newrelic.ini is loaded and detected by php
    Code (Text):
    php --ini
    

    Code (Text):
    php --ini
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/mailparse.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/newrelic.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/zendopcache.ini
    

    Check newrelic module specifically, this is same as loading phpinfo file and looking for newrelic module section.
    Code (Text):
    php --ri newrelic
    

    Code (Text):
    php --ri newrelic
    
    newrelic
    
    New Relic RPM Monitoring => enabled
    New Relic Version => 7.1.0.187 ("roth" - "680e6fc1646b")
    
                                Global Directives                       
    Directive Name => Global Value
    newrelic.daemon.app_timeout => no value
    newrelic.daemon.auditlog => no value
    newrelic.daemon.collector_host => collector.newrelic.com
    newrelic.daemon.dont_launch => no value
    newrelic.daemon.location => /usr/bin/newrelic-daemon
    newrelic.daemon.logfile => no value
    newrelic.daemon.loglevel => no value
    newrelic.daemon.pidfile => no value
    newrelic.daemon.port => /tmp/.newrelic.sock
    newrelic.daemon.proxy => no value
    newrelic.daemon.ssl => enabled
    newrelic.daemon.ssl_ca_bundle => no value
    newrelic.daemon.ssl_ca_path => no value
    newrelic.daemon.utilization.detect_aws => enabled
    newrelic.daemon.utilization.detect_docker => enabled
    newrelic.feature_flag => no value
    newrelic.high_security => 0
    newrelic.logfile => /var/log/newrelic/php_agent.log
    newrelic.loglevel => info
    
                             Per-Directory Directives                   
    Directive Name => Local/Active Value => Master/Default Value
    newrelic.analytics_events.capture_attributes => enabled => enabled
    newrelic.analytics_events.enabled => enabled => enabled
    newrelic.appname => host.domain.com PHP Application => host.domain.com PHP Application
    newrelic.attributes.enabled => enabled => enabled
    newrelic.attributes.exclude => no value => no value
    newrelic.attributes.include => no value => no value
    newrelic.browser_monitoring.attributes.enabled => disabled => disabled
    newrelic.browser_monitoring.attributes.exclude => no value => no value
    newrelic.browser_monitoring.attributes.include => no value => no value
    newrelic.browser_monitoring.auto_instrument => enabled => enabled
    newrelic.browser_monitoring.capture_attributes => disabled => disabled
    newrelic.browser_monitoring.debug => disabled => disabled
    newrelic.browser_monitoring.loader => rum => rum
    newrelic.capture_params => off => off
    newrelic.cross_application_tracer.enabled => enabled => enabled
    newrelic.custom_insights_events.enabled => enabled => enabled
    newrelic.datastore_tracer.database_name_reporting.enabled => enabled => enabled
    newrelic.datastore_tracer.instance_reporting.enabled => enabled => enabled
    newrelic.enabled => yes => yes
    newrelic.error_collector.attributes.enabled => enabled => enabled
    newrelic.error_collector.attributes.exclude => no value => no value
    newrelic.error_collector.attributes.include => no value => no value
    newrelic.error_collector.capture_attributes => enabled => enabled
    newrelic.error_collector.capture_events => enabled => enabled
    newrelic.error_collector.enabled => enabled => enabled
    newrelic.error_collector.ignore_errors => no value => no value
    newrelic.error_collector.ignore_exceptions => no value => no value
    newrelic.error_collector.ignore_user_exception_handler => no => no
    newrelic.error_collector.prioritize_api_errors => no => no
    newrelic.error_collector.record_database_errors => yes => yes
    newrelic.framework => auto-detect => auto-detect
    newrelic.framework.drupal.modules => on => on
    newrelic.framework.wordpress.hooks => on => on
    newrelic.guzzle.enabled => 1 => 1
    newrelic.ignored_params => no value => no value
    newrelic.labels => no value => no value
    newrelic.license => d4...89 => d4...89
    newrelic.phpunit_events.enabled => disabled => disabled
    newrelic.process_host.display_name => no value => no value
    newrelic.special.max_nesting_level => -1 => -1
    newrelic.synthetics.enabled => enabled => enabled
    newrelic.transaction_events.attributes.enabled => enabled => enabled
    newrelic.transaction_events.attributes.exclude => no value => no value
    newrelic.transaction_events.attributes.include => no value => no value
    newrelic.transaction_events.enabled => enabled => enabled
    newrelic.transaction_tracer.attributes.enabled => enabled => enabled
    newrelic.transaction_tracer.attributes.exclude => no value => no value
    newrelic.transaction_tracer.attributes.include => no value => no value
    newrelic.transaction_tracer.capture_attributes => enabled => enabled
    newrelic.transaction_tracer.custom => no value => no value
    newrelic.transaction_tracer.detail => 1 => 1
    newrelic.transaction_tracer.enabled => enabled => enabled
    newrelic.transaction_tracer.explain_enabled => enabled => enabled
    newrelic.transaction_tracer.explain_threshold => 500 => 500
    newrelic.transaction_tracer.gather_input_queries => 1 => 1
    newrelic.transaction_tracer.record_sql => obfuscated => obfuscated
    newrelic.transaction_tracer.slow_sql => enabled => enabled
    newrelic.transaction_tracer.stack_trace_threshold => 500 => 500
    newrelic.transaction_tracer.threshold => apdex_f => apdex_f
    newrelic.webtransaction.name.files => no value => no value
    newrelic.webtransaction.name.functions => no value => no value
    newrelic.webtransaction.name.remove_trailing_path => no => no
    


    Updating Newrelic PHP Agent



    As per Upgrading the PHP agent | New Relic Documentation
    Code (Text):
    yum update newrelic-php5
    newrelic-install install
    fpmrestart
    

    If you want to silently run newrelic-install install command
    Code (Text):
    yum update newrelic-php5
    export NR_INSTALL_KEY="<your-key-goes-here>"
    export NR_INSTALL_SILENT=true
    newrelic-install install
    fpmrestart
    


     
    Last edited: Apr 15, 2017
  2. eva2000

    eva2000 Administrator Staff Member

    54,087
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    11:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    newrelic-php-agent-150417-01.png
    newrelic-php-agent-150417-02.png newrelic-php-agent-150417-03.png newrelic-php-agent-150417-04.png
     
Thread Status:
Not open for further replies.