Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Wanted python code for monitoring replication tasks using rest api and pushing them into newrelic.
Dear @akshatha9986 ,
For monitoring Qlik replication tasks and latency, you can use the Qlik Replicate REST API to retrieve information about replication tasks and their status . You can write a Python script that periodically queries the REST API and pushes the data to New Relic using the New Relic Python Agent . Here is an example of how to use the Qlik Replicate REST API to retrieve replication task information:
Python
import requests
url = "https://<qlik_replicate_host>/api/v1/replication_tasks"
headers = {
"Authorization": "Bearer <access_token>",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
tasks = response.json()
# Extract the task information
for task in tasks:
task_name = task["name"]
task_status = task["status"]
task_latency = task["latency"]
# Push the task information to New Relic
# ...
You can replace <qlik_replicate_host> with the hostname of your Qlik Replicate instance and <access_token> with your OAuth 2.0 access token. The above code retrieves the replication task information and latency for all tasks in your Qlik Replicate instance.
If you found our response useful, we kindly ask you to click on “Accept as Solution”. This will aid other users in finding the answer more effortlessly.
Thank you! 😊
Regards,
Deepak
Hi. I wrote this blog sometime ago that should help. https://mattdevdba.medium.com/using-the-attunity-aem-rest-api-to-send-metrics-to-elastic-stack-c8ed4... the destination was Elasticsearch but you should be able to swap that out for New Relic and the code is in Python. Hope this helps.
Well, nagios is a well-known one that I used for many years. I eventually started disliking it and created my own monitoring code (not in Python), but it works well for many people. Google around for nagios alternatives to see other popular systems
Hi @akshatha9986 ,
You can find an example program named example.py for reference under <Qlik Enterprise Manager Install Location>clients\python directory.
Regards,
Desmond
Dear @akshatha9986 ,
For monitoring Qlik replication tasks and latency, you can use the Qlik Replicate REST API to retrieve information about replication tasks and their status . You can write a Python script that periodically queries the REST API and pushes the data to New Relic using the New Relic Python Agent . Here is an example of how to use the Qlik Replicate REST API to retrieve replication task information:
Python
import requests
url = "https://<qlik_replicate_host>/api/v1/replication_tasks"
headers = {
"Authorization": "Bearer <access_token>",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
tasks = response.json()
# Extract the task information
for task in tasks:
task_name = task["name"]
task_status = task["status"]
task_latency = task["latency"]
# Push the task information to New Relic
# ...
You can replace <qlik_replicate_host> with the hostname of your Qlik Replicate instance and <access_token> with your OAuth 2.0 access token. The above code retrieves the replication task information and latency for all tasks in your Qlik Replicate instance.
If you found our response useful, we kindly ask you to click on “Accept as Solution”. This will aid other users in finding the answer more effortlessly.
Thank you! 😊
Regards,
Deepak