why not write a ncurses menu utility for all of this? Why require a web browser?
Hi
Beastie7
I can't implement WebSysctl as an "ncurses menu utility" because WebSysctl is a database, whereas an "ncurses menu utility" is a utility. Here's an explanation:
Utilities like nsysctl (CLI), sysctlview (GUI), and websysctl (WEB) display the same information for a sysctl node, as they all use libsysctlmibinfo2 on top of sysctlinfo-kmod to retrieve this data from the kernel.
That said, utilities (
sysutils/nsysctl,
deskutils/sysctlview,
sysctl(8),
prometheus_sysctl_exporter(8), and any potential ncurses-based utility) show the sysctl MIB of the running kernel on a single machine. The FreeBSD sysctl MIB is dynamic, a node can be added or removed dynamically. Each computer likely builds a different MIB depending on:
- OS version
- Running kernel
- Built configuration
- Loaded kernel modules
- Hardware
WebSysctl, on the other hand, is not a utility; it's a database. A committer can log in and upload the sysctl MIB on his computer, helping to incrementally build and update the global database.
That said, I did start writing a TUI sysctl utility some time ago, mostly as a test for libbsddialog. I ultimately abandoned the project because I didn’t see clear advantages to a TUI for this use case.
For example, suppose we're using a terminal and want to inspect the kern.osrelease node. What would be the benefit of displaying this in a TUI instead of just using the CLI?
% nsysctl -Dp kern.ostype
[OID]: 1.1: [NAME]: kern.ostype: [LABEL]: : [DESCRIPTION]: Operating system type: [TYPE]: string: [FORMAT]: A: [FLAGS]: RD MPSAFE CAPRD: [HANDLER]: Defined: [VALUE]: FreeBSD
Or say we want to explore the subtree kern.boottrace.*, what real advantage would a TUI have over a command like:
% nsysctl -s ", " -dtHI kern.boottrace
kern.boottrace, boottrace statistics, node, Undefined
kern.boottrace.table_size, Boot-time tracing table size, unsigned integer, Defined, 0
kern.boottrace.shutdown_trace_threshold, Tracing threshold (ms) below which tracing is ignored, integer, Defined, 0
kern.boottrace.shutdown_trace, Enable kernel shutdown tracing to the console, uint8_t, Defined, 0
kern.boottrace.enabled, Boot-time and shutdown-time tracing enabled, uint8_t, Defined, 0
kern.boottrace.reset, Reset run-time tracing table, integer, Defined,
kern.boottrace.shuttrace, Capture a shutdown-time trace event, string, Defined,
kern.boottrace.runtrace, Capture a run-time trace event, string, Defined,
kern.boottrace.boottrace, Capture a boot-time trace event, string, Defined,
kern.boottrace.log, Print a log of the boottrace trace data, string, Defined,
Of course, if there are clear benefits, I'm open to the idea. I could even consider finishing the sysctlTUI project.