New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.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


Delete tickets

Votes:

0

Your Vote:

Up

Down

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

closed delete tickets

Created on Jan 18, 2017 3:48:15 PM by  Carlascom (130) 1



4 Replies

Accepted Answer

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

Thank you

Created on Jan 19, 2017 7:51:55 AM by  Carlascom (130) 1



Votes:

0

Your Vote:

Up

Down

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 by  RG (10)

Last change on Nov 15, 2019 5:26:40 AM by  Sven Roggenhofer [Paessler Technical Support]



Votes:

0

Your Vote:

Up

Down

Hey RG,

thanks for sharing.

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



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.