Files
s390-tools/opticsmon/opticsmon.8
Niklas Schnelle c34adb9cab opticsmon: Introduce opticsmon tool
The optics monitoring tool opticsmon implements the user-space portion
of reporting optics data to the SE. Its basic functionality is to
collect optical module information equivalent to "ethtool --module-info"
for PCI Physical Functions and forwards this data to the SE using the
new SCLP Write Event Data Action Qualifier 3.

For the part of finding all PFs we need to look at all PCI
functions and determine which ones are PFs and what netdevs they
correspond to. This is a generally useful functionality so this part as
well as the SCLP issuing code go into a new libzpci library which also
includes a standalone example for listing PCI functions and their s390x
specific attributes. Medium term we plan to add this functionality to
lszdev.

For the opticsmon tool itself there are 2 basic operating modes:

* One-shot Mode: Without parameters opticsmon collects optical module
  data and prints a summary of the netdevice in JSON format. With
  --module-data it also includes a base64 encoded raw dump equivalent to
  ethtool --module-info <netdev> raw on.
* Monitor Mode: With the --monitor flag opticsmon runs continuously
  usually started via a systemd unit and collects new optical module
  data on a time interval (default 24h) or when the operational state
  ("/sys/class/net/<netdev/operstate") changes. The tool listens for
  changes via netlink so no polling on sysfs is necessary

Note: Both modes will *NOT* issues SCLPs without adding the
--send-report flag but will output a JSON summary for each data
collection so can be tested without firmware impact.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-12-06 10:57:34 +01:00

84 lines
2.0 KiB
Groff

.\" Copyright IBM Corp. 2024
.\" s390-tools is free software; you can redistribute it and/or modify
.\" it under the terms of the MIT license. See LICENSE for details.
.\"
.\" Macro for inserting an option description prologue.
.\" .OD <long> [<short>] [args]
.de OD
. ds args "
. if !'\\$3'' .as args \fI\\$3\fP
. if !'\\$4'' .as args \\$4
. if !'\\$5'' .as args \fI\\$5\fP
. if !'\\$6'' .as args \\$6
. if !'\\$7'' .as args \fI\\$7\fP
. PD 0
. if !'\\$2'' .IP "\fB\-\\$2\fP \\*[args]" 4
. if !'\\$1'' .IP "\fB\-\-\\$1\fP \\*[args]" 4
. PD
..
.
.TH opticsmon 8 "Oct 2024" s390-tools zpcictl
.
.SH NAME
opticsmon - Monitor optical modules for directly attached PCI based NICs
.
.
.SH SYNOPSIS
.B "opticsmon"
.I "OPTIONS"
.
.
.SH DESCRIPTION
Use
.B opticsmon
to monitor the health of the optical modules of directly attached PCI based
NICs. When executed without the \fB--daemon\fR option it will collect optical
module data from all available PCI network interface physical functions and
print a summary in JSON format. Add the \fB--send-report\fR option to report
this data to the support element.
.
.
.SH OPTIONS
.SS Operation Options
.OD daemon "d"
Run continuously and report on link state changes and periodically
.PP
.
.OD send-report "r"
Report the optics health data to the Support Element (SE)
.PP
.
.OD quiet "q"
Be quiet and don't print optics health summary
.PP
.
.OD interval "i" "seconds"
Interval in seconds at which to collect monitoring data in the absence of link
state changes. A value larger than 24 hours (86400 seconds) is clamped down to
24 hours.
.PP
.
.OD module-info ""
Include a base64 encoded binary dump of the module's SFF-8636/8472/8024
standard data for each netdev. This matches "ethtool --module-info <netdev> raw
on".
.B Example: Extract module information for the first adapter
.CL
opticsmon --module-info | jq -r '.adapters[0].netdevs[0].optics.module_info' | base64 -d | hexdump -C
.PP
.PP
.
.SS General Options
.OD help "h" ""
Print usage information, then exit.
.PP
.
.OD version "v" ""
Print version information, then exit.
.PP