The netbsd_exporter: An Alternative to Prometheus node_exporter with a Focus on NetBSD

System monitoring is of great importance for administrators to gain insights into the performance and state of their systems. A popular solution for this is Prometheus, a powerful open-source monitoring and alerting system based on metrics. In combination with Grafana, Prometheus offers advanced visualizations and analysis.

System Monitoring with Exporters

Monitoring systems is done through continuous querying of metrics provided by exporters. Exporters are specialized programs that provide metrics via an HTTP interface in Prometheus format and have knowledge of specific system details.

The NetBSD Exporter

The netbsd_exporter is an exporter specifically developed for NetBSD. It is inspired by the Sysctl Exporter of FreeBSD and aims for natural integration into the base system as well as low resource consumption.

Available Metrics

Currently, the netbsd_exporter can provide disk I/O, network I/O, RAM and filesystem usage, as well as CPU utilization. These metrics allow administrators to detect performance and potential bottlenecks early on.

Example Output:

netbsd_fs_size_bytes{device="dk0",mountpoint="/"} 14573516800
netbsd_fs_used_bytes{device="dk0",mountpoint="/"} 8648296448
netbsd_fs_free_bytes{device="dk0",mountpoint="/"} 5196546048
netbsd_load1 0.000000
netbsd_load5 0.000000
netbsd_load15 0.000000
netbsd_netif_rx_bytes{interface="xennet0"} 2048990748
netbsd_netif_tx_bytes{interface="xennet0"} 98329050
netbsd_netif_errors{interface="xennet0"} 0
netbsd_netif_rx_bytes{interface="lo0"} 12998
netbsd_netif_tx_bytes{interface="lo0"} 12998
netbsd_netif_errors{interface="lo0"} 0
netbsd_mem_size_bytes 249638912
netbsd_mem_free_bytes 23531520
netbsd_mem_active_bytes 79384576
netbsd_mem_inactive_bytes 48852992
netbsd_mem_paging_bytes 0
netbsd_mem_wired_bytes 16723968
netbsd_mem_swap_size_bytes 2147442688
netbsd_mem_swap_used_bytes 6533120
netbsd_dk_read_bytes{device="xbd0"} 307225201664
netbsd_dk_write_bytes{device="xbd0"} 33737978368
netbsd_dk_read_bytes{device="dk0"} 305721165824
netbsd_dk_write_bytes{device="dk0"} 32393216512
netbsd_dk_read_bytes{device="dk1"} 1503978496
netbsd_dk_write_bytes{device="dk1"} 1344761856

Integration with inetd

The netbsd_exporter is provided through inetd, an “Internet Super Server” that enables efficient management of network services. This integration allows the exporter to be called only when needed and provides metrics upon request. It requires only the NetBSD base system and no additional 3rd-party packages, which facilitates integration and minimizes resource consumption. Additionally, it benefits from the access restriction and throttling capabilities that inetd brings by default.

Alternative to node_exporter

The node_exporter is a widely used tool for collecting system metrics, supported by Prometheus. However, the NetBSD support of node_exporter is still incomplete. The netbsd_exporter focuses specifically on the NetBSD operating system and offers an alternative that provides specific metrics and information for NetBSD systems and is optimized to efficiently utilize resources.

Source Code

The source code of the netbsd_exporter is available under the 2-Clause-BSD License. The source code can be found at https://forge.petermann-it.de/mpeterma/netbsd_exporter. I always appreciate suggestions, feature requests, and bug reports. Please do not hesitate to share your proposals or discovered issues with me. Together, we can improve the netbsd_exporter.

The netbsd_exporter is a useful tool for monitoring NetBSD systems. It allows administrators to monitor metrics such as disk I/O, network I/O, RAM and filesystem usage, and CPU utilization in Prometheus-compatible format. The integration with inetd facilitates integration into existing infrastructures. The netbsd_exporter is an interesting and lightweight alternative to node_exporter that meets the specific requirements of NetBSD systems and takes their unique metrics into account.