You can use New Relic's REST API and your API key to obtain information about multiple components (instances) for your plugin, including:
- The summary metric in raw and formatted form as set by the plugin publisher
- Threshold data indicating when Caution and Critical alerts will be triggered
- Each
COMPONENT_ID
andCOMPONENT_NAME
for the plugin - Summary information for each component, including
SUMMARY_METRIC_ID
andSUMMARY_METRIC_NAME
- The associated summary metric information, including
METRIC_NAME
andMETRIC_VALUE
You can use the API Explorer to list components.
重要
When using these examples, be sure to replace each placeholder (for example, ${PLUGIN_ID}
) with its specific ID.
List all components
To obtain a list of the plugin's components (instances) and the summary data for the account associated with your API key, use:
curl -X GET "https://api.newrelic.com/v2/components.json" \ -H "X-Api-Key:${APIKEY}" -i
List by plugin_id
To obtain a list of the plugin's components (instances) and summary data for a single ${PLUGIN_ID}
, use the following command.
curl -X GET 'https://api.newrelic.com/v2/components.json' \ -H "X-Api-Key:${APIKEY}" -i \ -d 'filter[plugin_id]=${PLUGIN_ID}"
View the components' output
The output for each component ID will be similar to the following example, which is annotated and formatted for JSON. Due to the potential length of the output, you may want to paginate it.
{ "components": [ { "id": 3947935, <---<<< COMPONENT_ID "name": "F5-01-prod", <---<<< COMPONENT_NAME "summary_metrics": [ { "id": 116635, <---<<< SUMMARY_METRIC_ID "name": "CPU", <---<<< SUMMARY_METRIC_NAME "metric": "Component/CPU/Total/Global[%]", <---<<< METRIC_NAME "value_function": "average_value", <---<<< METRIC_VALUE "thresholds": { "caution": 75, <---<<< SUMMARY_METRIC_CAUTION_THRESHOLD "critical": 85 <---<<< SUMMARY_METRIC_CRITICAL_THRESHOLD }, "values": { "raw": 78.79225, <---<<< SUMMARY_METRIC_VALUE "formatted": "78.8 %" <---<<< SUMMARY_METRIC_FORMATTED_VALUE } }, { "id": 116636, "name": "Throughput", "metric": "Component/Throughput/Total[bits/sec]", ... }, ] }, .... ]}
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。