What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Delete tickets

Votes:

0

Hi, is there a way to delete all closed tickets?

closed delete tickets

Created on Jan 18, 2017 3:48:15 PM



6 Replies

Accepted Answer

Votes:

0

Hi there,

You can set the Data Purging for closed tickets under "Setup > System Administration > Core & Probes > Historic Data Purging > Closed Tickets".

Created on Jan 18, 2017 4:05:05 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Thank you

Created on Jan 19, 2017 7:51:55 AM



Votes:

0

After setting retention to one day for closed tickets, you could also schedule the script below daily to close all open tickets.

# Ensuring TLS/SSL connection to our host
add-type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
        public bool CheckValidationResult(
            ServicePoint srvPoint, X509Certificate certificate,
            WebRequest request, int certificateProblem) {
            return true;
        }
    }
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

# return codes
$http_code = @{ 200 = "OK"; 302 = "Found"; 400 = "Bad Request"; 401 = "Unauthorized"}

# setup credentials 
$username = ""
$passhash  = ""
$creds_str = "&username=$($username)&passhash=$($passhash)"

# Command line that downloaded CSV file with all open tickets
$Cmd_GetAllOpenTicketsCSV = "https://CORE_SERVER_IP_ADDRESS/api/table.csv?content=tickets&columns=datetime,parentid,status&filter_status=1" + $creds_str

# Get list of todays tickets using command above
$AllOpenTickets     = Invoke-WebRequest -Uri $Cmd_GetAllOpenTicketsCSV | ConvertFrom-Csv

# Iterate through each open ticket and run URL to set it close
$AllOpenTickets | % { 
                        $t_id = $_."Ticket ID"
                        $res = Invoke-WebRequest -Uri "https://CORE_SERVER_IP_ADDRESS/api/closeticket.htm?id=$($t_id)&content=close$($creds_str)"
                        Write-Host "Closing ticket $($t_id) - $($http_code.($res.StatusCode))"
                    } 

Created on Nov 15, 2019 3:38:23 AM

Last change on Apr 7, 2023 6:22:07 AM by  Sasa Ignjatovic [Paessler Support]



Votes:

0

Hey RG,

thanks for sharing.

Created on Nov 15, 2019 5:27:14 AM by  Sven Roggenhofer [Paessler Technical Support]



Votes:

0

The script to close all open tickets. How do you implement this script?

Created on Oct 6, 2020 4:46:37 PM



Votes:

0

Lawsont,

The script can be executed by the scheduled task manager on the Windows PRTG Server.

Benjamin Day
[Paessler Support]

Created on Oct 7, 2020 3:27:29 AM by  Benjamin Day [Paessler Support] (1,441) 2 1




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.