Hello,

I use blackbox exporter to monitoring API Endpoint. I able to API using 
json paramter and POST method manually by curl command with below result :

[weblogic@xxxxxosb04 mwteam]$ curl -d "@data.json" -X POST -H 
"Content-Type: application/json" 
http://1x.1xx.7x.x:48002/dukil/get_json/isat/call_nik
{"content":[{"NO_XX":317502141012,"NXK":324410130005,"NAME_LP":"DUMMY","AGM":"DUMMY","KAB_NAME":"DUMMY","NO_RW":"00","KEC_NAME":"DUMMY","JEN_PKRJN":"DUMMY","NO_RT":"00","ALT":"DUMMY","TMPT_LHR":"DUMMY","PDDK_AKH":"DUMMY","NM_LGKP_BU":"DUMMY","PROP_NAME":"DUMMY","KEL_NAME":"DUMMY","JNS_KLMIN":"Li
 
Li","TGL_LER":"28-02-2018"}],"lastPage":true,"numberOfElements":1,"sort":null,"totalElements":1,"firstPage":true,"number":0,"size":1}

where is data.json :

{
    "NXK":"324410130005",
    "NO_XX":"317502141012",
    "NM_LGKP_BU":"",
    "user_id":"68317101XXXXX",
    "password":"XXXXXX",
    "msisdn":"123456789",
    "IP_User":"XXX"
}

But, when i setup in blackbox exporter with same json paramater its error - 
server returned HTTP status 400 Bad Request
 
Here is my configuration :

*blackbox.yml :*

modules:

  http_post_2xx:
    prober: http
    timeout: 5s
    http:
      valid_status_codes: [200]
      method: POST
      headers:
        Content-Type: application/json
      body: '{"NXK": "324410130005","NXK": "317502141012","NM_LGKP_BU": 
"","user_id": "68317101XXXXX","password": "XXXXXX","msisdn": 
"123456789","IP_User": "XXX"}'

*prometheus.yml :*

  - job_name: 'blackbox'
    metrics_path: /probe
    params:
      module: [http_post_2xx]
    static_configs:
      - targets:
        - http://1x.1xx.7x.x:48002/dukil/get_json/isat/call_nik
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement:  xxxxxosb04:9115

Please advise if i missed something in my configuration?


Thank You!

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/0efeac8a-425b-4bd0-84f8-17c0160eeb48n%40googlegroups.com.

Reply via email to