0

I am looking for assistance in fixing my python script which uses Grafana API. I have to create silences in Grafana using a master excel sheet provided to me which contains below details to create the payload:

  1. Labels
  2. Change Start Time
  3. Change End Time

The script is not allowing to submit a POST call which is giving me certificate issue. We are authenticating the API call via API Key.

We currently do not have a certificate file handy.

Could someone please guide me how to procure a certificate and use it in the script. Appreciate the help!

Thanks Yavnica

1 Answer 1

0

You can bypass the certificate verification by adding verify=False in your requests.post() call (not recommended for production). Example:

response = requests.post(url, headers=headers, json=payload, verify=False)

To use a proper certificate:

  1. Ask your Grafana admin for the SSL certificate (.pem or .crt file).

  2. Save it locally (e.g., grafana_cert.pem).

  3. Then use it in your script:

response = requests.post(url, headers=headers, json=payload, verify='grafana_cert.pem')
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks the response. I did try the verify=False option but Grafana seems to now allow it. The certificate which the admin gave me was downloaded from the browser. Would that be the right one? If not, kindly guide how to download the entire certificate chain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.