IBM / newrelic-cli

New Relic CLI is a command line tool which is used to operate New Relic objects(Synthetic monitors, alert policies, conditions, account users etc). You can use it easily to list/get/create/delete these objects. It can be used to backup your New Relic configuration data and restore in the future. It is easy to be used other than calling different REST API endpoints.
Apache License 2.0
62 stars 30 forks source link

alertsconditions Display alert conditions by alert policy id. #24

Open andrew-lozoya opened 5 years ago

andrew-lozoya commented 5 years ago

Usage: nr get [command]

Available Commands: alertsconditions Display alert conditions by alert policy id.

$ ./nr get alertsconditions $ length of [flags] should be 1 instead of 0

or

$ ./nr get alertsconditions 449096 $ infrastructure_condition.Response: 401 Unauthorized. Error: invalid character 'I' looking for beginning of value.

Does not work instructions say there should not be a required argument but -help says "by alert policy id". neither is working...

mlvazqu2 commented 5 years ago

What kind of role do you have in New Relic? It seems you don't have the right role to access alerts.

mlvazqu2 commented 5 years ago

Or perhaps your API key is invalid. New Relic returns Invalid API key. and status code 401.

sdeedee commented 4 years ago

@mlvazqu2 I'm encountering a similar problem. The issue is related to infrastructure conditions only. condition.Response: 404 Not Found. Error: <nil>. All other condition types are showed correctly