opticsmon: zpcimon: Rename opticsmon to zpcimon

The opticsmon tool started out as a tool for monitoring the health of
optical modules in directly attached PCI NICs. In the future however it
will also monitor the health of other PCI devices. In particular in
a first step it will monitor the health of directly attached NVMe
devices.

To reflect this broadening of its scope rename opticsmon to zpcimon. Add
zpcimon.service and install it both under the new name and symlinked as
opticsmon.service for backwards compatibility. Since users are expected
to mostly just enable the service this keeps old instructions just
working.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Niklas Schnelle
2025-12-09 17:53:57 +01:00
committed by Jan Höppner
parent e7bc4a5d31
commit e8550a4f8d
19 changed files with 39 additions and 32 deletions

8
.gitignore vendored
View File

@@ -102,9 +102,11 @@ lsstp/_lsstp
lsstp/lsstp.bash
mon_tools/mon_fsstatd
mon_tools/mon_procd
opticsmon/opticsmon
opticsmon/_opticsmon
opticsmon/opticsmon.bash
zpcimon/zpcimon
zpcimon/zpcimon.bash
zpcimon/_zpcimon
zpcimon/opticsmon.bash
zpcimon/_opticsmon
osasnmpd/osasnmpd
qetharp/qetharp
qethqoat/qethqoat

View File

@@ -15,7 +15,7 @@ TOOL_DIRS = zipl zdump fdasd dasdfmt dasdview tunedasd \
vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
ziomon iucvterm hyptop cmsfs-fuse qethqoat zfcpdump zdsfs cpumf \
systemd hmcdrvfs cpacfstats zdev dump2tar zkey netboot etc zpcictl \
lsstp hsci hsavmcore chreipl-fcp-mpath ap_tools rust opticsmon \
lsstp hsci hsavmcore chreipl-fcp-mpath ap_tools rust zpcimon \
zpwr zmemtopo
else

View File

@@ -316,7 +316,7 @@ build options:
| glibc-static | `HAVE_LIBC_STATIC` | zfcpdump |
| openssl | `HAVE_OPENSSL` | zkey, libekmfweb, libkmipclient, |
| | | zgetdump, rust/pvattest, rust/pvimg, |
| | | zgetdump/pvsecret, opticsmon |
| | | zgetdump/pvsecret, zpcimon |
| cryptsetup | `HAVE_CRYPTSETUP2` | zkey-cryptsetup |
| json-c | `HAVE_JSONC` | zkey-cryptsetup, libekmfweb, |
| | | libkmipclient |
@@ -326,7 +326,7 @@ build options:
| libxml2 | `HAVE_LIBXML2` | libkmipclient |
| systemd | `HAVE_SYSTEMD` | hsavmcore |
| libudev | `HAVE_LIBUDEV` | cpacfstatsd |
| libnl3 | `HAVE_LIBNL3` | opticsmon |
| libnl3 | `HAVE_LIBNL3` | zpcimon |
This table lists additional build or install options:
@@ -374,10 +374,10 @@ the different tools are provided:
The runtime requirements are: openssl-libs (>= 1.1.1) and libcurl.
* opticsmon:
For building opticsmon OpenSSL and the Netlink Library Suite (libnl3) are
* zpcimon:
For building zpcimon OpenSSL and the Netlink Library Suite (libnl3) are
required.
Tip: you may skip the opticsmon build by adding
Tip: you may skip the zpcimon build by adding
`HAVE_OPENSSL=0` or `HAVE_LIBNL3=0`
* osasnmpd:

View File

@@ -629,7 +629,7 @@ NETWORK_CMDS="ip -br a\
:nstat -az\
:openssl engine # deprecated in OpenSSL 3.n\
:openssl list --providers 2>/dev/null # redirect help on older systems\
:opticsmon --module-info\
:opticsmon --module-info\ # Now called zpcimon but kept for compatibility
:route -n\
"

View File

@@ -4,7 +4,7 @@ SYSTEM_UNITS = ttyrun-getty@.service iucvtty-login@.service \
cpacfstatsd.service cpuplugd.service \
dumpconf.service cpi.service \
mon_fsstatd.service mon_procd.service \
opticsmon.service
zpcimon.service
all:
@@ -19,6 +19,9 @@ install: system_units
$(INSTALL) -g $(GROUP) -o $(OWNER) \
-m 644 $$unit $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) ; \
done
# Make the legacy opticsmon.service a link to zpcimon.service
ln -sf zpcimon.service \
$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/opticsmon.service
else

View File

@@ -1,5 +1,5 @@
#
# Systemd unit for mon_fsstatd (monitor z/VM guest file systems)
# Systemd unit for zpcimon PCI NIC optical module monitoring
#
# Copyright IBM Corp. 2024
#
@@ -9,11 +9,11 @@
[Unit]
Description=Monitor health of directly attached PCI NIC optical modules
# Documentation=man:opticsmon
# Documentation=man:zpcimon
[Service]
Type=exec
ExecStart=@usrsbin_path@/opticsmon --send-report --monitor --interval 86400
ExecStart=@usrsbin_path@/zpcimon --send-report --monitor --interval 86400
KillMode=control-group
[Install]

View File

@@ -2,8 +2,8 @@ include ../common.mak
TESTS := tests/
zsh-completions = _opticsmon
bash-completions = opticsmon.bash
zsh-completions = _zpcimon
bash-completions = zpcimon.bash
include ../common_autocomp.mak
@@ -12,7 +12,7 @@ libs =$(rootdir)/libzpci/libzpci.a $(rootdir)/libutil/libutil.a
ifneq (${HAVE_OPENSSL},0)
check_dep_openssl:
$(call check_dep, \
"opticsmon", \
"zpcimon", \
"openssl/evp.h", \
"openssl-devel", \
"HAVE_OPENSSL=0")
@@ -22,7 +22,7 @@ endif # HAVE_OPENSSL
ifneq (${HAVE_LIBNL3},0)
check_dep_libnl3:
$(call check_dep, \
"opticsmon", \
"zpcimon", \
"netlink/socket.h", \
"libnl3-devel", \
"HAVE_LIBNL3=0")
@@ -69,20 +69,22 @@ endif
ALL_CPPFLAGS += $(LIB_CFLAGS)
LDLIBS += $(LIB_LFLAGS)
BUILDTARGET += opticsmon
BUILDTARGET += zpcimon
all: ${BUILDTARGET}
opticsmon: opticsmon.o optics_info.o optics_sclp.o ethtool.o link_mon.o $(libs)
zpcimon: zpcimon.o optics_info.o optics_sclp.o ethtool.o link_mon.o $(libs)
install: all
$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man8
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 opticsmon $(DESTDIR)$(BINDIR)
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 opticsmon.8 \
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zpcimon $(DESTDIR)$(BINDIR)
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 zpcimon.8 \
$(DESTDIR)$(MANDIR)/man8
ln -sf zpcimon $(DESTDIR)$(BINDIR)/opticsmon
ln -sf zpcimon.8 $(DESTDIR)$(MANDIR)/man8/opticsmon.8
endif # HAVE_OPENSSL3=0 or HAVE_LIBNL3=0
clean:
rm -f *.o *~ opticsmon core
rm -f *.o *~ zpcimon core
.PHONY: all install clean

View File

@@ -6,10 +6,11 @@
#include "lib/util_autocomp.h"
#include "opticsmon_cli.h"
#include "zpcimon_cli.h"
int main(void)
{
generate_autocomp(opt_vec, "zpcimon");
generate_autocomp(opt_vec, "opticsmon");
return 0;

View File

@@ -30,20 +30,20 @@
. br
..
.
.TH opticsmon 8 "Oct 2024" s390-tools zpcictl
.TH zpcimon 8 "Oct 2024" s390-tools zpcictl
.
.SH NAME
opticsmon - Monitor optical modules for directly attached PCI based NICs
zpcimon - Monitor optical modules for directly attached PCI based NICs
.
.
.SH SYNOPSIS
.B "opticsmon"
.B "zpcimon"
.I "OPTIONS"
.
.
.SH DESCRIPTION
Use
.B opticsmon
.B zpcimon
to monitor the health of the optical modules of directly attached PCI based
NICs. When executed without the \fB--monitor\fR option it will collect optical
module data from all available PCI network interface physical functions and
@@ -80,7 +80,7 @@ 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
.CL zpcimon --module-info | jq -r '.adapters[0].netdevs[0].optics.module_info' | base64 -d | hexdump -C
.PP
.PP
.

View File

@@ -31,7 +31,7 @@
#include "link_mon.h"
#include "optics_info.h"
#include "optics_sclp.h"
#include "opticsmon_cli.h"
#include "zpcimon_cli.h"
#define API_LEVEL 1
@@ -52,8 +52,7 @@ struct opticsmon_ctx {
};
static const struct util_prg prg = {
.desc = "Use opticsmon to monitor the health of the optical modules\n"
"of directly attached PCI based NICs",
.desc = "Use zpcimon to monitor the health of PCI devices",
.copyright_vec = { {
.owner = "IBM Corp.",
.pub_first = 2024,