NetBackup API with Prometheus and Grafana to expose metrics related to backup and restore operations

Hi,

Is it possible to use the NetBackup API, as mentioned in RESTful APIs included in NetBackup 10.3 | NetBackup 10.3 new features, changes, and enhancements | New features, enhancements, and changes | NetBackup™ Release Notes | Veritas™, to expose metrics related to backup and restore operations, including successes and failures, on a Grafana dashboard?

Could you please share a documentation link or any relevant resources to help me get started with this integration?

Thanks in advance.

Best regards,

Kaushal

Please post a sample JSON data from this rest API and what part of the data you want to visualize

@yosiasz, thank you so much for the quick response. I am currently in discussions with the Veritas team to obtain the JSON payload. I will share it here as soon as I receive it.

1 Like

cool while we await for that, what is the relationship of this api with prometheus stated in your title?

@yosiasz

Query NetBackup API for Backup Metrics

We need to interact with the NetBackup REST API to get backup and restore job data. Below is an example using the NetBackup REST API for Job Status.

API URL:
GET /netbackup/api/jobs

This will return a list of backup jobs, including their statuses, success or failure, and additional information like backup size and job duration.

Example request:

curl -X GET "https://<your_netbackup_server>/netbackup/api/jobs" -H "Authorization: Bearer <your_access_token>

The response would contain details such as:

jobID, status, startTime, endTime, errorDetails, etc.
status can be SUCCESS, FAILED, etc.

To expose these metrics to Prometheus, we need to write custom Prometheus exporter . The exporter will fetch data from the NetBackup API and expose it in the Prometheus format.

We need to configure Prometheus (/etc/prometheus/prometheus.yml) to scrape metrics from the custom Prometheus exporter which will be exposing them on port 8000 or 9000 for example.

Last step is to connect the Grafana visualization web application to Prometheus time series database to visualize the backup metrics for list of backup jobs, including their statuses, success or failure, and additional information like backup size and job duration.

1 Like

Usually rest apis return JSON, are you sure it is csv like data?

Why do you need to use Prometheus if the data is available via API, for historical reasons?

@yosiasz I am trying to address your questions.

Usually, REST APIs return JSON. Are you certain the data is in CSV format?

Example Metrics and Grafana Panel:
Metrics Exposed:

netbackup_job_status{status="SUCCESS", job_id="12345"}  
netbackup_job_status{status="FAILED", job_id="12346"}

Grafana Query Example:

To show all successful backups in a graph:
sum(netbackup_job_status{status="SUCCESS"})
To show failed backups:
sum(netbackup_job_status{status="FAILED"})

Why do you need to use Prometheus if the data is already available via API? Is it for historical reasons?

For historical and governance purposes, we need to track the success and failure of backups.
Please share your comments and suggestions. Thanks in advance.

1 Like

Every post has a surprise gift and more confusing :smile:

@yosiasz I am not sure if i understand your response. Please elaborate. Thanks in advance.

So currently are you pushing data from API to Prometheus?

@yosiasz I am in conversation with the Veritas team to share with us the REST API’s which are available from the Veritas NetBackup appliance.

Does not answer the question I asked. sorry but not possible to help you from my part

Hi,
Did you get a response from Veritas? I’m interested in the same solution.

@raulnovelda16 Apologies for the delay in replying. I am yet to receive the details