Hi all,

I am trying to register onprem multiple nodes in consul DB using single 
json file but while registering through API, getting syntax error (*Request 
decode failed: json: cannot unmarshal array into Go value of type 
structs.RegisterRequest*)


I am using below curl command for registering nodes

curl --request PUT --data @nodes.json 
http://x.x.x.x:8500/v1/catalog/register

Below is the node json file I am using:

[
{
  "Node": "ABC",
  "Address": "ABC.net",
  "NodeMeta": {
    "external-node": "true",
    "external-probe": "true"
  },
  "Service": {
    "ID": "node_exporter",
    "Service": "monitoring",
    "Tags": ["node_exporter"],
    "Port": 9100
  }
},
{
  "Node": "XYZ",
  "Address": "XYZ.net",
  "NodeMeta": {
    "external-node": "true",
    "external-probe": "true"
  },
  "Service": {
    "ID": "node_exporter",
    "Service": "monitoring",
    "Tags": ["node_exporter"],
    "Port": 9100
  }
}
]

I am not installing consul agent in those nodes, just trying to register 
those external nodes in consul DB and from their Prometheus has to discover 
those nodes.

Can anyone please suggest on adding multiple nodes with one json file.

Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/c32518b6-357b-4369-8684-735409ea7803n%40googlegroups.com.

Reply via email to