Skip to content

Instantly share code, notes, and snippets.

@gspncr
Last active September 28, 2020 10:03
Show Gist options
  • Save gspncr/59f18d85763abf9f2d30ce68f6a49d86 to your computer and use it in GitHub Desktop.
Save gspncr/59f18d85763abf9f2d30ce68f6a49d86 to your computer and use it in GitHub Desktop.
new relic nri-apache version 2 integration example for multiple apache instances.
integrations:
- name: apache-server-metrics
integration_name: com.newrelic.apache
command: metrics
arguments:
status_url: http://127.0.0.1:90/server-status?auto
remote_monitoring: true
labels:
env: production
role: load_balancer
instance: default
port: 90
- name: apache-server-metrics-91
integration_name: com.newrelic.apache
command: metrics
arguments:
status_url: http://127.0.0.1:91/server-status?auto
remote_monitoring: true
labels:
env: production
role: load_balancer
instance: example.com
port: 91
- name: apache-server-metrics-92
integration_name: com.newrelic.apache
command: metrics
arguments:
status_url: http://127.0.0.1:92/server-status?auto
remote_monitoring: true
labels:
env: production
role: load_balancer
instance: test.com
port: 92
- name: apache-server-inventory
integration_name: com.newrelic.apache
command: inventory
arguments:
remote_monitoring: true
status_url: http://127.0.0.1:90/server-status?auto
labels:
env: production
role: load_balancer
- name: apache-server-inventory-91
integration_name: com.newrelic.apache
command: inventory
arguments:
remote_monitoring: true
status_url: http://127.0.0.1:91/server-status?auto
labels:
env: production
role: load_balancer
- name: apache-server-inventory-92
integration_name: com.newrelic.apache
command: inventory
arguments:
remote_monitoring: true
status_url: http://127.0.0.1:92/server-status?auto
labels:
env: production
role: load_balancer
<VirtualHost *:91>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 90
Listen 91
Listen 92
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

the apache setup

cd /etc/apache2/sites-available

sudo vi example.com.conf

cd /etc/apache2/sites-enabled

cd .. && vi ports.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment