Hi,
I have an appliance with a REST API which are returning a number of things, including the date and time of the last cluster sync.
I need to check that this date and time does not get more than one hour behind the current date and time.
The output is as follows:
{ "name": "XXXX-CPPM01", "local_server": true, "server_uuid": "9815acac-94f5-4360-8e8d-XXXXXXXXXX", "server_dns_name": "XXXX-CPPM01", "fqdn": "XXXX-CPPM01.XXXX.LOCAL", "server_ip": null, "management_ip": "10.XXX.XX.99", "ipv6_server_ip": null, "ipv6_management_ip": null, "is_master": true, "extras": null, "is_insight_enabled": false, "is_insight_master": false, "replication_status": "ENABLED", "last_replication_timestamp": "2020-05-19 09:05:27+02", "is_profiler_enabled": true, "_links": { "self": { "href": "https://xxxx-cppm01/api/cluster/server/9815acac-94f5-4360-8e8d-xxxxxxxxxxx" } } }
How can I use a template and ovl file to check if the date is say, more then one hour in the past, and have PRTG raise an alarm when that happens?
Thanks.
Article Comments
Hi,
Thank you for the reply. I should have been more precise in my question. Im already using the REST Custom Sensor.
Problem is I cannot understand how to form the template to calculate the difference in seconds.
At the moment I have the below, which gives me this error: Could no evaluate channel value: can not dissolve dynamic channel Last successful replication: path does not exist 'duration($'.
{ "prtg": { "description" : { "comment": "Monitoring Clearpass Cluster replication" }, "result": [ { "channel": "Last clustersync seconds ago" , "value": "duration($.last_replication_timestamp, now())" } ] } }
May, 2020 - Permalink
Hi,
As we need to take a look at screenshots of the sensor. I would ask you to open a support ticket via mail to support@paessler.com with the following Ticket ID PAE2006344.
May, 2020 - Permalink
So support was not able to help as the problem is in the template it seems.
Can anyone help create a working template file?
I need to send an alarm when the replication time is more than one hour behind the current time.
This is my template so far, and its not working. { "prtg": { "description" : { "comment": "Monitoring Clearpass Cluster replication" }, "result": [ { "channel": "Replication Status" , "value": "duration($.last_replication_timestamp, now()) } ] } }
May, 2020 - Permalink
Hi,
You can use our Rest Custom Sensor which gives you the opportunity to calculate the date.
Afterwards you can display the difference in seconds.
May, 2020 - Permalink