NAME

WebService::OPNsense::Diagnostics - Diagnostics API controller

VERSION

version 0.003

SYNOPSIS

my $diag = $opn->diagnostics;

my $result = $diag->ping('192.0.2.1');
my $states = $diag->pf_states;
my $info   = $diag->system_information;

DESCRIPTION

Network and system diagnostics.

METHODS

activity

my $activity = $diag->activity;

Returns system activity information.

arp_table

my $arp = $diag->arp_table;

Returns the ARP table.

del_state

my $result = $diag->del_state($stateid, $creatorid);

Deletes a specific pf state entry.

dns_lookup

my $result = $diag->dns_lookup($host);

Performs a reverse DNS lookup for an IP address using the OPNsense diagnostic DNS endpoint.

firewall_log

my $log = $diag->firewall_log;

Returns the firewall log.

firewall_log_filters

my $filters = $diag->firewall_log_filters;

Returns available firewall log filter options.

firewall_stats

my $stats = $diag->firewall_stats;

Returns firewall statistics summary.

flush_arp

my $result = $diag->flush_arp;

Flushes the ARP cache.

flush_sources

my $result = $diag->flush_sources;

Flushes all source tracking entries.

flush_states

my $result = $diag->flush_states;

Flushes all pf state entries.

interface_config

my $config = $diag->interface_config;

Returns network interface configuration.

interface_names

my $names = $diag->interface_names;

Returns a list of network interface names.

interface_statistics

my $stats = $diag->interface_statistics;

Returns network interface statistics.

kill_states

my $result = $diag->kill_states;

Kills all pf state entries.

memory

my $memory = $diag->memory;

Returns memory usage information.

ndp_table

my $ndp = $diag->ndp_table;

Returns the NDP (IPv6 neighbor) table.

pf_states

my $states = $diag->pf_states;

Returns current pf state table.

pf_statistics

my $stats = $diag->pf_statistics;
my $stats = $diag->pf_statistics($section);

Returns pf statistics. Optionally specify a section.

ping

my $result = $diag->ping($host);

Pings a host using the OPNsense diagnostic ping endpoint. Returns ping statistics.

portprobe

my $result = $diag->portprobe($probe_data);

Probes a port on a remote host. $probe_data should contain host and port fields.

routes

my $routes = $diag->routes;

Returns the system routing table.

search_service

my $results = $diag->search_service(%params);

Searches for system services.

system_disk

my $disk = $diag->system_disk;

Returns disk usage information.

system_information

my $info = $diag->system_information;

Returns general system information.

system_time

my $time = $diag->system_time;

Returns system time.

traceroute

my $result = $diag->traceroute($host);

Traces the route to a host using the OPNsense diagnostic traceroute endpoint.

traffic

my $traffic = $diag->traffic;

Returns current traffic statistics per interface.

client

my $http_client = $diag->client;

Returns the underlying HTTP client object used for API requests.

SEE ALSO

WebService::OPNsense

AUTHOR

Dean Hamstead <dean@fragfest.com.au>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Dean Hamstead.

This is free software, licensed under:

The MIT (X11) License