diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 21bfcf8a..a2144c77 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -274,7 +274,7 @@ jobs: - run: sudo apt-get update - run: sudo apt-get install help2man tofrodos - run: | - echo "Creating dist folder for linux/osx" + echo "Creating dist folder for Linux/macOS" make dist rm dist/snclient - uses: actions/upload-artifact@main @@ -692,7 +692,7 @@ jobs: - uses: actions/download-artifact@main with: name: "${{ env.BIN }}.pkg" - - name: "OSX Integration Tests" + - name: "macOS Integration Tests" run: | mv ${{ env.BIN }}.pkg t/snclient.pkg cd t diff --git a/Changes b/Changes index cc70d7c4..bcec956c 100644 --- a/Changes +++ b/Changes @@ -160,7 +160,7 @@ next: - update windows exporter to 0.31.3 - chore: update dependencies - change minimum golang requirement to 1.24.6 - - osx: + - macOS: - fix corrupted json output (invalid character '\x00' looking for beginning of object key string) 0.36 Tue Jul 29 14:24:04 CEST 2025 @@ -296,7 +296,7 @@ next: 0.21 Thu Mar 28 17:18:25 CET 2024 - add http config ini includes - - add osx pkg uninstaller + - add macOS pkg uninstaller - add check_eventlog support for unique-index (mlueckert) - add check_os_version add os name - add os and version to inventory @@ -392,12 +392,12 @@ next: - add /api/v1/admin/reload rest endpoint to initialize config changes - add /api/v1/admin/certs/replace rest endpoint to replace certificates - support different allowed hosts settings for each web handler - - fix cpu check on osx not returning metrics + - fix cpu check on macOS not returning metrics 0.13 Thu Nov 23 22:20:21 CET 2023 - drop privileges when running node exporter - update node exporter to 1.7.0 - - add node exporter to osx packages + - add node exporter to macOS packages - add check_load plugin - improve docs and help pages - add folder size support to check_files (#38) @@ -459,7 +459,7 @@ next: - add conf.d directory support for includes - added check_tasksched - added nrpe mode to test cmd - - fix osx installer (#27) + - fix macOS installer (#27) - fix linux check_drivesize (#14) - fix missing byte in nrpe response (#21) diff --git a/Makefile b/Makefile index 5d428ef3..e8dfc9d7 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ SED=sed -i GO=go CGO_ENABLED=0 -# OSX must be build with CGO enabled, otherwise we don't get cpu metrics +# macOS must be build with CGO enabled, otherwise we don't get cpu metrics DARWIN=0 ifeq ($(shell uname),Darwin) DARWIN=1 diff --git a/docs/checks/commands/check_connections.md b/docs/checks/commands/check_connections.md index e4e1befb..9f17e544 100644 --- a/docs/checks/commands/check_connections.md +++ b/docs/checks/commands/check_connections.md @@ -11,7 +11,7 @@ Checks the number of TCP connections. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | diff --git a/docs/checks/commands/check_cpu.md b/docs/checks/commands/check_cpu.md index 3b1e35a8..a8a5f0d8 100644 --- a/docs/checks/commands/check_cpu.md +++ b/docs/checks/commands/check_cpu.md @@ -11,7 +11,7 @@ Checks the CPU usage metrics. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_cpu_utilization.md b/docs/checks/commands/check_cpu_utilization.md index 10122c5a..c4001616 100644 --- a/docs/checks/commands/check_cpu_utilization.md +++ b/docs/checks/commands/check_cpu_utilization.md @@ -11,7 +11,7 @@ Checks the CPU utilization metrics. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_drive_io.md b/docs/checks/commands/check_drive_io.md index 390ae6f7..6c029503 100644 --- a/docs/checks/commands/check_drive_io.md +++ b/docs/checks/commands/check_drive_io.md @@ -11,7 +11,7 @@ Checks the disk I/O on the host. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_drivesize.md b/docs/checks/commands/check_drivesize.md index dd5eb2bd..09bcc2c6 100644 --- a/docs/checks/commands/check_drivesize.md +++ b/docs/checks/commands/check_drivesize.md @@ -11,7 +11,7 @@ Checks the disk drive/volumes usage on a host. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_dummy.md b/docs/checks/commands/check_dummy.md index 0bba20d1..8fb77298 100644 --- a/docs/checks/commands/check_dummy.md +++ b/docs/checks/commands/check_dummy.md @@ -9,7 +9,7 @@ This check simply sets the state to the given value and outputs the remaining ar ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_eventlog.md b/docs/checks/commands/check_eventlog.md index 19a33ba4..1b6c5ab8 100755 --- a/docs/checks/commands/check_eventlog.md +++ b/docs/checks/commands/check_eventlog.md @@ -34,9 +34,9 @@ of the WMI query when possible, the filter is still applied to the returned even ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:------------------:|:-----:|:-------:|:------:| -| :white_check_mark: | | | | +| Windows | Linux | FreeBSD | macOS | +|:------------------:|:-----:|:-------:|:-----:| +| :white_check_mark: | | | | ## Argument Defaults diff --git a/docs/checks/commands/check_files.md b/docs/checks/commands/check_files.md index f55ad7f9..06c8c5ca 100644 --- a/docs/checks/commands/check_files.md +++ b/docs/checks/commands/check_files.md @@ -11,7 +11,7 @@ Checks files and directories. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_index.md b/docs/checks/commands/check_index.md index 18b90994..c99833d2 100644 --- a/docs/checks/commands/check_index.md +++ b/docs/checks/commands/check_index.md @@ -11,7 +11,7 @@ Returns list of all known checks. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_kernel_stats.md b/docs/checks/commands/check_kernel_stats.md index dc290ca0..dae623ae 100644 --- a/docs/checks/commands/check_kernel_stats.md +++ b/docs/checks/commands/check_kernel_stats.md @@ -11,9 +11,9 @@ Checks some metrics of the Linux kernel. Currently supports context switches, pr ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:-------:|:------------------:|:-------:|:------:| -| | :white_check_mark: | | | +| Windows | Linux | FreeBSD | macOS | +|:-------:|:------------------:|:-------:|:-----:| +| | :white_check_mark: | | | ## Argument Defaults diff --git a/docs/checks/commands/check_load.md b/docs/checks/commands/check_load.md index 7e37cd28..b70d7288 100644 --- a/docs/checks/commands/check_load.md +++ b/docs/checks/commands/check_load.md @@ -11,7 +11,7 @@ Checks the CPU load metrics. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_logfile.md b/docs/checks/commands/check_logfile.md index 454fba1d..dbf0a886 100644 --- a/docs/checks/commands/check_logfile.md +++ b/docs/checks/commands/check_logfile.md @@ -24,7 +24,7 @@ See [here](https://github.com/bmatcuk/doublestar#patterns) for details on the pa ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_mailq.md b/docs/checks/commands/check_mailq.md index 08bd69e0..19848018 100644 --- a/docs/checks/commands/check_mailq.md +++ b/docs/checks/commands/check_mailq.md @@ -11,7 +11,7 @@ Checks the mailq. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:-------:|:------------------:|:------------------:|:------------------:| | | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_memory.md b/docs/checks/commands/check_memory.md index 4960f940..9767d8de 100644 --- a/docs/checks/commands/check_memory.md +++ b/docs/checks/commands/check_memory.md @@ -20,7 +20,7 @@ Read more on Windows virtual address space [here](https://learn.microsoft.com/en ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_mount.md b/docs/checks/commands/check_mount.md index ff88469a..a313888f 100644 --- a/docs/checks/commands/check_mount.md +++ b/docs/checks/commands/check_mount.md @@ -11,7 +11,7 @@ Checks the status for a mounted filesystem ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_multi.md b/docs/checks/commands/check_multi.md index b8dca449..22f1336c 100644 --- a/docs/checks/commands/check_multi.md +++ b/docs/checks/commands/check_multi.md @@ -34,7 +34,7 @@ This can be executed with check_multi "config=myscript". ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_network.md b/docs/checks/commands/check_network.md index 4dfacdf7..0c30b57c 100644 --- a/docs/checks/commands/check_network.md +++ b/docs/checks/commands/check_network.md @@ -11,7 +11,7 @@ Checks the state and metrics of network interfaces. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_ntp_offset.md b/docs/checks/commands/check_ntp_offset.md index 4a1933bf..3cda2d58 100644 --- a/docs/checks/commands/check_ntp_offset.md +++ b/docs/checks/commands/check_ntp_offset.md @@ -11,7 +11,7 @@ Checks the NTP offset. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | @@ -33,7 +33,7 @@ Checks the NTP offset. | Argument | Description | | -------- | ---------------------------------------------------------------------------------------------------------- | | server | Fetch offset from these NTP servers. First valid response is used. | -| source | Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm. | +| source | Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, macos, w32tm. | ## Attributes diff --git a/docs/checks/commands/check_omd.md b/docs/checks/commands/check_omd.md index 950ba3b4..ca998478 100644 --- a/docs/checks/commands/check_omd.md +++ b/docs/checks/commands/check_omd.md @@ -11,9 +11,9 @@ Check OMD site status. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:-------:|:------------------:|:-------:|:------:| -| | :white_check_mark: | | | +| Windows | Linux | FreeBSD | macOS | +|:-------:|:------------------:|:-------:|:-----:| +| | :white_check_mark: | | | ## Argument Defaults diff --git a/docs/checks/commands/check_os_updates.md b/docs/checks/commands/check_os_updates.md index 82117dd1..f624b3a9 100644 --- a/docs/checks/commands/check_os_updates.md +++ b/docs/checks/commands/check_os_updates.md @@ -11,7 +11,7 @@ Checks for OS system updates. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | @@ -32,7 +32,7 @@ Checks for OS system updates. | Argument | Description | | ---------------------- | -------------------------------------------------------------------------------------------- | | -m\|--max-metadata-age | Fail with UNKNOWN if the repository metadata (apt/yum/dnf) is older than this duration, e.g. 48h (default: 24h) | -| -s\|--system | Package system: auto, apt, yum, osx and windows (default: auto) | +| -s\|--system | Package system: auto, apt, yum, macos and windows (default: auto) | | -u\|--update | Update package list (if supported, e.g. apt-get update) | ## Attributes diff --git a/docs/checks/commands/check_os_version.md b/docs/checks/commands/check_os_version.md index ad0d656f..7261d13d 100644 --- a/docs/checks/commands/check_os_version.md +++ b/docs/checks/commands/check_os_version.md @@ -11,7 +11,7 @@ Checks the os system version. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_pagefile.md b/docs/checks/commands/check_pagefile.md index 5f00a978..7573abe0 100644 --- a/docs/checks/commands/check_pagefile.md +++ b/docs/checks/commands/check_pagefile.md @@ -11,9 +11,9 @@ Checks the pagefile usage. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:------------------:|:-----:|:-------:|:------:| -| :white_check_mark: | | | | +| Windows | Linux | FreeBSD | macOS | +|:------------------:|:-----:|:-------:|:-----:| +| :white_check_mark: | | | | ## Argument Defaults diff --git a/docs/checks/commands/check_pdh.md b/docs/checks/commands/check_pdh.md index c5ad88a5..e5e275b0 100644 --- a/docs/checks/commands/check_pdh.md +++ b/docs/checks/commands/check_pdh.md @@ -10,9 +10,9 @@ Checks PDH paths and handles wildcard expansion. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:------------------:|:-----:|:-------:|:------:| -| :white_check_mark: | | | | +| Windows | Linux | FreeBSD | macOS | +|:------------------:|:-----:|:-------:|:-----:| +| :white_check_mark: | | | | ## Check Specific Arguments diff --git a/docs/checks/commands/check_ping.md b/docs/checks/commands/check_ping.md index 4b7ca7d7..4db8a372 100644 --- a/docs/checks/commands/check_ping.md +++ b/docs/checks/commands/check_ping.md @@ -11,7 +11,7 @@ Checks the ICMP ping connection. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_process.md b/docs/checks/commands/check_process.md index 644b597a..33743fe4 100644 --- a/docs/checks/commands/check_process.md +++ b/docs/checks/commands/check_process.md @@ -11,7 +11,7 @@ Checks the state and metrics of one or multiple processes. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_service_linux.md b/docs/checks/commands/check_service_linux.md index ce37ab4d..8da51b07 100644 --- a/docs/checks/commands/check_service_linux.md +++ b/docs/checks/commands/check_service_linux.md @@ -13,9 +13,9 @@ There is a specific [check_service for Windows](../check_service_windows) as wel ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:-------:|:------------------:|:-------:|:------:| -| | :white_check_mark: | | | +| Windows | Linux | FreeBSD | macOS | +|:-------:|:------------------:|:-------:|:-----:| +| | :white_check_mark: | | | ## Argument Defaults diff --git a/docs/checks/commands/check_service_windows.md b/docs/checks/commands/check_service_windows.md index 31f1732e..43c7cc9c 100755 --- a/docs/checks/commands/check_service_windows.md +++ b/docs/checks/commands/check_service_windows.md @@ -13,9 +13,9 @@ There is a specific [check_service for Linux](../check_service_linux) as well. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:------------------:|:-----:|:-------:|:------:| -| :white_check_mark: | | | | +| Windows | Linux | FreeBSD | macOS | +|:------------------:|:-----:|:-------:|:-----:| +| :white_check_mark: | | | | ## Argument Defaults diff --git a/docs/checks/commands/check_snclient_version.md b/docs/checks/commands/check_snclient_version.md index 410dc207..ecb48640 100644 --- a/docs/checks/commands/check_snclient_version.md +++ b/docs/checks/commands/check_snclient_version.md @@ -11,7 +11,7 @@ Check and return SNClient version. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_swap_io.md b/docs/checks/commands/check_swap_io.md index a36dc81a..3ed0addf 100644 --- a/docs/checks/commands/check_swap_io.md +++ b/docs/checks/commands/check_swap_io.md @@ -11,7 +11,7 @@ Checks the swap I/O rate on the host. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:-------:|:------------------:|:------------------:|:------------------:| | | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_tasksched.md b/docs/checks/commands/check_tasksched.md index ee0d8e4f..617f478a 100644 --- a/docs/checks/commands/check_tasksched.md +++ b/docs/checks/commands/check_tasksched.md @@ -11,9 +11,9 @@ Check status of scheduled jobs ## Implementation -| Windows | Linux | FreeBSD | MacOSX | -|:------------------:|:-----:|:-------:|:------:| -| :white_check_mark: | | | | +| Windows | Linux | FreeBSD | macOS | +|:------------------:|:-----:|:-------:|:-----:| +| :white_check_mark: | | | | ## Argument Defaults diff --git a/docs/checks/commands/check_temperature.md b/docs/checks/commands/check_temperature.md index f68f2d5b..0698efa5 100644 --- a/docs/checks/commands/check_temperature.md +++ b/docs/checks/commands/check_temperature.md @@ -11,7 +11,7 @@ Check temperature sensors. ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | diff --git a/docs/checks/commands/check_uptime.md b/docs/checks/commands/check_uptime.md index 597d9476..51f6ed16 100644 --- a/docs/checks/commands/check_uptime.md +++ b/docs/checks/commands/check_uptime.md @@ -11,7 +11,7 @@ Check computer uptime (time since last reboot). ## Implementation -| Windows | Linux | FreeBSD | MacOSX | +| Windows | Linux | FreeBSD | macOS | |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/docs/checks/commands/check_wmi.md b/docs/checks/commands/check_wmi.md index 633481c8..e57dccb8 100644 --- a/docs/checks/commands/check_wmi.md +++ b/docs/checks/commands/check_wmi.md @@ -12,9 +12,9 @@ In order to use this plugin, you need to enable CheckWMI in the 0 || check.hasArgsSupplied["type"] || (runtime.GOOS == "darwin" && check.output == OutputInventory) { l.addMemType(check, "swap", swap.Used, swap.Free, swap.Total) } diff --git a/pkg/snclient/check_ntp_offset.go b/pkg/snclient/check_ntp_offset.go index c91699da..444b30ea 100644 --- a/pkg/snclient/check_ntp_offset.go +++ b/pkg/snclient/check_ntp_offset.go @@ -43,7 +43,7 @@ func (l *CheckNTPOffset) Build() *CheckData { }, args: map[string]CheckArgument{ "server": {value: &l.ntpserver, description: "Fetch offset from these NTP servers. First valid response is used."}, - "source": {value: &l.source, isFilter: true, description: "Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm."}, + "source": {value: &l.source, isFilter: true, description: "Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, macos, w32tm."}, }, defaultFilter: "none", defaultWarning: "offset > 50 || offset < -50", @@ -175,10 +175,10 @@ func (l *CheckNTPOffset) addSources(ctx context.Context, check *CheckData) (err } } - if l.source == "auto" || l.source == "osx" { - err = l.addOSX(ctx, check, l.source == "osx") + if l.source == "auto" || l.source == "macos" || l.source == "osx" { + err = l.addOSX(ctx, check, l.source != "auto") if err != nil { - log.Debugf("failed: osx: %s", err.Error()) + log.Debugf("failed: macOS: %s", err.Error()) if l.source != "auto" { return err } @@ -458,10 +458,10 @@ func (l *CheckNTPOffset) parseW32AnyLang(text string) (valid bool, source, offse return valid, source, offset, stratum, errorStr } -// get offset on Mac OSX +// get offset on macOS func (l *CheckNTPOffset) addOSX(ctx context.Context, check *CheckData, force bool) error { if !force && runtime.GOOS != "darwin" { - return fmt.Errorf("this is a mac osx command") + return fmt.Errorf("this is a macOS command") } entry := l.defaultEntry("osx") diff --git a/pkg/snclient/check_ntp_offset_linux_test.go b/pkg/snclient/check_ntp_offset_linux_test.go index 36d4af63..615f5b8c 100644 --- a/pkg/snclient/check_ntp_offset_linux_test.go +++ b/pkg/snclient/check_ntp_offset_linux_test.go @@ -414,7 +414,7 @@ Network Time Server: time.euro.apple.com`, }`, }) defer os.RemoveAll(tmpPath) - res := snc.RunCheck("check_ntp_offset", []string{"source=osx"}) + res := snc.RunCheck("check_ntp_offset", []string{"source=macos"}) assert.Equalf(t, CheckExitOK, res.State, "state OK") assert.Equalf(t, "OK - offset -7.587ms from time.euro.apple.com (10.1.1.1) |'offset'=-7.587078ms;-50:50;-100:100 'stratum'=2;;;0", string(res.BuildPluginOutput()), "output matches") diff --git a/pkg/snclient/check_os_updates.go b/pkg/snclient/check_os_updates.go index 40a8bc2d..5571828e 100644 --- a/pkg/snclient/check_os_updates.go +++ b/pkg/snclient/check_os_updates.go @@ -37,7 +37,7 @@ func (l *CheckOSUpdates) Build() *CheckData { hasInventory: NoCallInventory, result: &CheckResult{}, args: map[string]CheckArgument{ - "-s|--system": {value: &l.system, description: "Package system: auto, apt, yum, osx and windows (default: auto)"}, + "-s|--system": {value: &l.system, description: "Package system: auto, apt, yum, macos and windows (default: auto)"}, "-u|--update": {value: &l.update, description: "Update package list (if supported, e.g. apt-get update)"}, "-m|--max-metadata-age": { value: &l.maxMetadataAge, @@ -90,7 +90,7 @@ func (l *CheckOSUpdates) Check(ctx context.Context, snc *Agent, check *CheckData addedOsBackendCount, osBackendAddErr := l.addOSBackends(ctx, check) if addedOsBackendCount == 0 { - return nil, fmt.Errorf("no suitable package system found, supported systems are apt, yum, osx and windows. found errors: %w", osBackendAddErr) + return nil, fmt.Errorf("no suitable package system found, supported systems are apt, yum, macos and windows. found errors: %w", osBackendAddErr) } if osBackendAddErr != nil { return nil, osBackendAddErr diff --git a/pkg/snclient/check_os_updates_darwin.go b/pkg/snclient/check_os_updates_darwin.go index 277f6180..dc1773ed 100644 --- a/pkg/snclient/check_os_updates_darwin.go +++ b/pkg/snclient/check_os_updates_darwin.go @@ -24,13 +24,13 @@ func (l *CheckOSUpdates) addOSBackends(ctx context.Context, check *CheckData) (i addedCount++ } if osxErr != nil { - err = fmt.Errorf("error when adding osx: %w", err) + err = fmt.Errorf("error when adding macOS: %w", err) } return addedCount, err } -// get packages from osx softwareupdate +// get packages from macOS softwareupdate func (l *CheckOSUpdates) addOSX(ctx context.Context, check *CheckData) (bool, error) { switch l.system { case "auto": @@ -41,7 +41,7 @@ func (l *CheckOSUpdates) addOSX(ctx context.Context, check *CheckData) (bool, er if os.IsNotExist(err) { return false, nil } - case "osx": + case "macos", "osx": default: return false, nil } diff --git a/pkg/snclient/check_os_updates_darwin_test.go b/pkg/snclient/check_os_updates_darwin_test.go index 5fe4887a..6a0334e4 100644 --- a/pkg/snclient/check_os_updates_darwin_test.go +++ b/pkg/snclient/check_os_updates_darwin_test.go @@ -18,7 +18,7 @@ Software Update found the following new or updated software: Title: macOS Sonoma 14.3.1, Version: 14.3.1, Size: 1789479KiB, Recommended: NO, Action: restart,`, }) defer os.RemoveAll(tmpPath) - res := snc.RunCheck("check_os_updates", []string{"--system=osx"}) + res := snc.RunCheck("check_os_updates", []string{"--system=macos"}) assert.Equalf(t, CheckExitWarning, res.State, "state WARNING") assert.Containsf(t, string(res.BuildPluginOutput()), "WARNING - 0 security updates / 1 updates available. |'security'=0;;0;0 'updates'=1;0;;0", "output matches") diff --git a/pkg/snclient/check_ping.go b/pkg/snclient/check_ping.go index 27ae9cab..7194f041 100644 --- a/pkg/snclient/check_ping.go +++ b/pkg/snclient/check_ping.go @@ -229,7 +229,7 @@ func (l *CheckPing) parsePingRTA(entry map[string]string, output string) { return } - // osx 14.7 + // macOS 14.7 // round-trip min/avg/max/stddev = 0.040/0.066/0.095/0.021 ms reRTA = regexp.MustCompile(`round-trip min/avg/max/stddev = ([\d.]+)/([\d.]+)/([\d.]+)/([\d.]+) ms`) rtaList = reRTA.FindStringSubmatch(output) @@ -288,7 +288,7 @@ func (l *CheckPing) parsePingPackets(entry map[string]string, output string) { return } - // osx 14.7 + // macOS 14.7 // 5 packets transmitted, 5 packets received, 0.0% packet loss rePackets = regexp.MustCompile(`(\d+) packets transmitted, (\d+) packets received, ([\d.]+)% packet loss`) packetsList = rePackets.FindStringSubmatch(output) diff --git a/pkg/snclient/check_ping_test.go b/pkg/snclient/check_ping_test.go index 48f8b9fa..a2c47ed4 100644 --- a/pkg/snclient/check_ping_test.go +++ b/pkg/snclient/check_ping_test.go @@ -259,7 +259,7 @@ func TestPingParserOSXOK(t *testing.T) { "pl": "0.0", "ttl": "64", } - // osx 14.7 + // macOS 14.7 out := ` PING localhost (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.040 ms @@ -287,7 +287,7 @@ func TestPingParserOSXBad(t *testing.T) { "pl": "100.0", "ttl": "", } - // osx 14.7 + // macOS 14.7 out := ` PING 10.99.99.99 (10.99.99.99): 56 data bytes Request timeout for icmp_seq 0 diff --git a/pkg/snclient/checkdata.go b/pkg/snclient/checkdata.go index a10d8df6..8430c29f 100644 --- a/pkg/snclient/checkdata.go +++ b/pkg/snclient/checkdata.go @@ -1792,7 +1792,7 @@ func (cd *CheckData) helpImplemented(format ShowHelp) string { {Name: "Windows", Field: "windows", Alignment: "centered"}, {Name: "Linux", Field: "linux", Alignment: "centered"}, {Name: "FreeBSD", Field: "freebsd", Alignment: "centered"}, - {Name: "MacOSX", Field: "osx", Alignment: "centered"}, + {Name: "macOS", Field: "osx", Alignment: "centered"}, } implemented := implTableData{} if cd.implemented&Windows > 0 {