Skip to content

Commit f635a96

Browse files
author
NSSPKrishna
committed
chore: Updated linux recipes
1 parent d866d41 commit f635a96

5 files changed

Lines changed: 36 additions & 63 deletions

File tree

recipes/newrelic/infrastructure/awslinux.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ install:
180180
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
181181
echo 'license_key: {{.NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
182182
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
183+
- |
184+
# Installation paths
185+
if [ ! -z "{{.NRIA_AGENT_DIR}}" ]; then
186+
echo 'agent_dir: {{.NRIA_AGENT_DIR}}' >> /etc/newrelic-infra.yml
187+
fi
188+
if [ ! -z "{{.NRIA_PLUGIN_DIR}}" ]; then
189+
echo 'plugin_dir: {{.NRIA_PLUGIN_DIR}}' >> /etc/newrelic-infra.yml
190+
fi
183191
184192
setup_proxy:
185193
cmds:

recipes/newrelic/infrastructure/centos_rhel.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ install:
154154
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
155155
echo 'license_key: {{.NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
156156
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
157+
- |
158+
# Installation paths
159+
if [ ! -z "{{.NRIA_AGENT_DIR}}" ]; then
160+
echo 'agent_dir: {{.NRIA_AGENT_DIR}}' >> /etc/newrelic-infra.yml
161+
fi
162+
if [ ! -z "{{.NRIA_PLUGIN_DIR}}" ]; then
163+
echo 'plugin_dir: {{.NRIA_PLUGIN_DIR}}' >> /etc/newrelic-infra.yml
164+
fi
157165
158166
setup_proxy:
159167
cmds:

recipes/newrelic/infrastructure/debian.yml

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -171,36 +171,11 @@ install:
171171
if [ $(echo {{.NEW_RELIC_REGION}} | grep -i staging | wc -l) -gt 0 ]; then
172172
echo 'staging: true' >> /etc/newrelic-infra.yml
173173
fi
174-
echo 'enable_process_metrics: {{.NRIA_ENABLE_PROCESS_METRICS}}' >> /etc/newrelic-infra.yml
175-
echo 'status_server_enabled: {{.NRIA_STATUS_SERVER_ENABLED}}' >> /etc/newrelic-infra.yml
176-
echo 'status_server_port: {{.NRIA_STATUS_SERVER_PORT}}' >> /etc/newrelic-infra.yml
174+
echo 'enable_process_metrics: true' >> /etc/newrelic-infra.yml
175+
echo 'status_server_enabled: true' >> /etc/newrelic-infra.yml
176+
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
177177
echo 'license_key: {{.NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
178178
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
179-
echo '{{.NRIA_PASSTHROUGH_ENVIRONMENT}}' >> /etc/newrelic-infra.yml
180-
- |
181-
# Logging configuration
182-
if [ ! -z "{{.NRIA_LOG_LEVEL}}" ]; then
183-
sed -i '/^log:/d' /etc/newrelic-infra.yml
184-
echo 'log:' >> /etc/newrelic-infra.yml
185-
echo ' level: {{.NRIA_LOG_LEVEL}}' >> /etc/newrelic-infra.yml
186-
if [ ! -z "{{.NRIA_LOG_FILE}}" ]; then
187-
echo ' file: {{.NRIA_LOG_FILE}}' >> /etc/newrelic-infra.yml
188-
fi
189-
if [ ! -z "{{.NRIA_LOG_FORMAT}}" ]; then
190-
echo ' format: {{.NRIA_LOG_FORMAT}}' >> /etc/newrelic-infra.yml
191-
fi
192-
fi
193-
- |
194-
# Hostname configuration
195-
if [ ! -z "{{.NRIA_DISPLAY_NAME}}" ]; then
196-
echo 'display_name: {{.NRIA_DISPLAY_NAME}}' >> /etc/newrelic-infra.yml
197-
fi
198-
if [ ! -z "{{.NRIA_OVERRIDE_HOSTNAME}}" ]; then
199-
echo 'override_hostname: {{.NRIA_OVERRIDE_HOSTNAME}}' >> /etc/newrelic-infra.yml
200-
fi
201-
if [ ! -z "{{.NRIA_OVERRIDE_HOSTNAME_SHORT}}" ]; then
202-
echo 'override_hostname_short: {{.NRIA_OVERRIDE_HOSTNAME_SHORT}}' >> /etc/newrelic-infra.yml
203-
fi
204179
- |
205180
# Installation paths
206181
if [ ! -z "{{.NRIA_AGENT_DIR}}" ]; then
@@ -209,40 +184,6 @@ install:
209184
if [ ! -z "{{.NRIA_PLUGIN_DIR}}" ]; then
210185
echo 'plugin_dir: {{.NRIA_PLUGIN_DIR}}' >> /etc/newrelic-infra.yml
211186
fi
212-
- |
213-
# Metrics sample rates
214-
if [ ! -z "{{.NRIA_METRICS_PROCESS_SAMPLE_RATE}}" ]; then
215-
echo 'metrics_process_sample_rate: {{.NRIA_METRICS_PROCESS_SAMPLE_RATE}}' >> /etc/newrelic-infra.yml
216-
fi
217-
if [ ! -z "{{.NRIA_METRICS_NETWORK_SAMPLE_RATE}}" ]; then
218-
echo 'metrics_network_sample_rate: {{.NRIA_METRICS_NETWORK_SAMPLE_RATE}}' >> /etc/newrelic-infra.yml
219-
fi
220-
if [ ! -z "{{.NRIA_METRICS_STORAGE_SAMPLE_RATE}}" ]; then
221-
echo 'metrics_storage_sample_rate: {{.NRIA_METRICS_STORAGE_SAMPLE_RATE}}' >> /etc/newrelic-infra.yml
222-
fi
223-
if [ ! -z "{{.NRIA_METRICS_SYSTEM_SAMPLE_RATE}}" ]; then
224-
echo 'metrics_system_sample_rate: {{.NRIA_METRICS_SYSTEM_SAMPLE_RATE}}' >> /etc/newrelic-infra.yml
225-
fi
226-
if [ ! -z "{{.NRIA_METRICS_NFS_SAMPLE_RATE}}" ]; then
227-
echo 'metrics_nfs_sample_rate: {{.NRIA_METRICS_NFS_SAMPLE_RATE}}' >> /etc/newrelic-infra.yml
228-
fi
229-
- |
230-
# Proxy configuration (NRIA_PROXY takes precedence over HTTPS_PROXY)
231-
if [ ! -z "{{.NRIA_PROXY}}" ]; then
232-
sed -i "/^proxy/d" /etc/newrelic-infra.yml
233-
echo 'proxy: {{.NRIA_PROXY}}' >> /etc/newrelic-infra.yml
234-
fi
235-
if [ ! -z "{{.NRIA_IGNORE_SYSTEM_PROXY}}" ]; then
236-
echo 'ignore_system_proxy: {{.NRIA_IGNORE_SYSTEM_PROXY}}' >> /etc/newrelic-infra.yml
237-
fi
238-
- |
239-
# Cloud and process configuration
240-
if [ ! -z "{{.NRIA_DISABLE_CLOUD_METADATA}}" ]; then
241-
echo 'disable_cloud_metadata: {{.NRIA_DISABLE_CLOUD_METADATA}}' >> /etc/newrelic-infra.yml
242-
fi
243-
if [ ! -z "{{.NRIA_DISABLE_ZERO_MEM_PROCESS_FILTER}}" ]; then
244-
echo 'disable_zero_mem_process_filter: {{.NRIA_DISABLE_ZERO_MEM_PROCESS_FILTER}}' >> /etc/newrelic-infra.yml
245-
fi
246187
247188
248189
setup_proxy:

recipes/newrelic/infrastructure/suse.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,15 @@ install:
156156
echo 'status_server_enabled: true' >> /etc/newrelic-infra.yml
157157
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
158158
echo 'license_key: {{.NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
159-
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
159+
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
160+
- |
161+
# Installation paths
162+
if [ ! -z "{{.NRIA_AGENT_DIR}}" ]; then
163+
echo 'agent_dir: {{.NRIA_AGENT_DIR}}' >> /etc/newrelic-infra.yml
164+
fi
165+
if [ ! -z "{{.NRIA_PLUGIN_DIR}}" ]; then
166+
echo 'plugin_dir: {{.NRIA_PLUGIN_DIR}}' >> /etc/newrelic-infra.yml
167+
fi
160168
161169
162170
setup_proxy:

recipes/newrelic/infrastructure/ubuntu.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ install:
162162
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
163163
echo 'license_key: {{.NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
164164
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
165+
- |
166+
# Installation paths
167+
if [ ! -z "{{.NRIA_AGENT_DIR}}" ]; then
168+
echo 'agent_dir: {{.NRIA_AGENT_DIR}}' >> /etc/newrelic-infra.yml
169+
fi
170+
if [ ! -z "{{.NRIA_PLUGIN_DIR}}" ]; then
171+
echo 'plugin_dir: {{.NRIA_PLUGIN_DIR}}' >> /etc/newrelic-infra.yml
172+
fi
165173
166174
167175
setup_proxy:

0 commit comments

Comments
 (0)