-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_newrelic.sh
executable file
·35 lines (25 loc) · 1.13 KB
/
check_newrelic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Include path so we can execute commands like 'python'
PATH=$PATH:/usr/bin
export PATH
# script location
AfPath=/usr/share/appfirst/plugins/libexec/poll-aroid/AfPoller
## NewRelic Specific Values
accessKey=""
## you can find you application ID at https://rpm.newrelic.com/api/explore/applications/list
accessAppId=""
## Application Name
## Name metrics are sorted with in statsd buckets
appName=""
## From "Applications > Metric Names copy metric name"
## https://rpm.newrelic.com/api/explore/applications/names
## for example "Agent/MetricsReported/count"
## or separated by comma Apdex, Agent/MetricsReported/count
## or get just one value from metric Agent/MetricsReported/count%min_response_time
## or Apdex%count, Apdex%score, Agent/MetricsReported/count%min_response_time
metricPath=""
## any additional program execution flags, IE --test or --dry-run (or both)
flags="--test --dry-run"
python $AfPath/AfPoller.py --plugin=newrelic --newrelic-access-key-id=$accessKey --newrelic-access-app-id=$accessAppId -m "$metricPath" -a $appName
## Output basic nagios-format "OK" so the polled data script knows this executed
echo "$0 OK"