netstat – Collect network statistics using the AIX netstat command

Synopsis

This module gathers detailed network statistics using the AIX netstat command.

Supports all reporting flags, mutual exclusiveness validation, repeated sampling, and recording the command output to a file.

Requirements

The below requirements are needed on the host that executes this module.

  • AIX >= 7.1

Parameters

numeric_network_address (optional, bool, False)

Display network addresses numerically using -n.

When omitted, symbolic hostnames may appear.

pcb_address (optional, bool, False)

Show protocol control block (PCB) addresses using -A.

all_sockets_state (optional, bool, False)

Display the state of all sockets using -a.

socket_options (optional, bool, False)

Show detailed socket options along with -a using -o.

routing_table (optional, bool, False)

Display routing tables using -r.

show_route_details (optional, bool, False)

Display routing details including metrics and policy information using -C.

packet_counts (optional, bool, False)

Show communications subsystem packet counts using -D.

display_configured_interfaces (optional, bool, False)

Display all configured interfaces using -i.

interface_name (optional, str, None)

Display information for a specific interface using -I <interface>.

protocol (optional, str, None)

Display statistics for the given protocol using -p.

memory_stats (optional, bool, False)

Display memory management statistics using -m.

mbuf_pool_stats (optional, bool, False)

Display mbuf cluster pool statistics using -M.

protocol_stats (optional, bool, False)

Display protocol statistics using -s.

concise_protocol_stats (optional, bool, False)

Display only non-zero protocol statistics using -ss.

domain_sockets (optional, bool, False)

Display information about domain sockets using -u.

display_adapter_statistics (optional, bool, False)

Display adapter statistics for CDLI adapters using -v.

virtual_interface_and_multicast (optional, bool, False)

Display virtual interface table and multicast forwarding cache using -g.

ras_artifacts (optional, str, None)

Display reliability, availability, and serviceability (RAS) artifacts using -K <protocol>.

ras_file (optional, str, None)

File path to store RAS output when using -F.

ras_suppress_nonzero (optional, bool, False)

Suppress non-zero counters in RAS output using -b.

interactive_mode (optional, bool, False)

Start interactive mode using -w.

clear_stats (optional, str, None)

Clear statistics using -Z.

c clears network buffer statistics.

i clears interface statistics.

m clears memory allocator statistics.

s clears protocol statistics.

address_family (optional, str, None)

Limit reports to a specific address family using -f.

interval (optional, int, None)

Time in seconds between repeated netstat samples.

count (optional, int, None)

Number of samples to collect along with interval.

recorded_output (optional, str, None)

File path to record command output.

concatenated_output (True, bool, None)

If true, append output to file; if false, overwrite file.

cache_stats (optional, bool, False)

Display network buffer cache statistics using -c.

Notes

Note

Examples

- name: Show all sockets
  ibm.power_aix.netstat:
    all_sockets_state: true

- name: Show routing table with costs
  ibm.power_aix.netstat:
    routing_table: true

- name: Show RAS artifacts for TCP to file
  ibm.power_aix.netstat:
    ras_artifacts: tcp
    ras_file: /tmp/tcp_ras.log

Return Values

msg (always, str, netstat executed SUCCESSFULLY )

The execution message.

rc (If the command failed., int, )

The return code.

stdout (If the command failed., str, )

The standard output.

stderr (If the command failed., str, )

The standard error.

Status

Authors

  • AIX Development Team (@vivekpandeyibm)