New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Check date from REST API

Votes:

0

Your Vote:

Up

Down

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.

clearpass rest-api template timestamp

Created on May 19, 2020 7:20:31 AM by  atomizer (0) 1

Last change on May 19, 2020 7:35:20 AM by  Marijan Horsky [Paessler Support]



4 Replies

Votes:

0

Your Vote:

Up

Down

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.

Created on May 19, 2020 12:14:03 PM by  Marijan Horsky [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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())" } ] } }

Created on May 19, 2020 12:29:03 PM by  atomizer (0) 1



Votes:

0

Your Vote:

Up

Down

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 [email protected] with the following Ticket ID PAE2006344.

Created on May 19, 2020 12:44:04 PM by  Marijan Horsky [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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()) } ] } }

Created on May 20, 2020 8:14:55 AM by  atomizer (0) 1



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.