| 1 | <!--startmeta |
| 2 | custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/macos.plugin/README.md" |
| 3 | meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/macos.plugin/metadata.yaml" |
| 4 | sidebar_label: "macOS" |
| 5 | learn_status: "Published" |
| 6 | learn_rel_path: "Collecting Metrics/Collectors/Operating Systems" |
| 7 | keywords: ['macos', 'apple', 'darwin'] |
| 8 | message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" |
| 9 | endmeta--> |
| 10 | |
| 11 | # macOS |
| 12 | |
| 13 | |
| 14 | <img src="https://netdata.cloud/img/macos.svg" width="150"/> |
| 15 | |
| 16 | |
| 17 | Plugin: macos.plugin |
| 18 | Module: mach_smi |
| 19 | |
| 20 | <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> |
| 21 | |
| 22 | ## Overview |
| 23 | |
| 24 | Monitor macOS metrics for efficient operating system performance. |
| 25 | |
| 26 | The plugin uses three different methods to collect data: |
| 27 | - The function `sysctlbyname` is called to collect network, swap, loadavg, and boot time. |
| 28 | - The functtion `host_statistic` is called to collect CPU and Virtual memory data; |
| 29 | - The function `IOServiceGetMatchingServices` to collect storage information. |
| 30 | |
| 31 | |
| 32 | This collector is only supported on the following platforms: |
| 33 | |
| 34 | - macOS |
| 35 | |
| 36 | This collector only supports collecting metrics from a single instance of this integration. |
| 37 | |
| 38 | |
| 39 | ### Default Behavior |
| 40 | |
| 41 | #### Auto-Detection |
| 42 | |
| 43 | This integration doesn't support auto-detection. |
| 44 | |
| 45 | #### Limits |
| 46 | |
| 47 | The default configuration for this integration does not impose any limits on data collection. |
| 48 | |
| 49 | #### Performance Impact |
| 50 | |
| 51 | The default configuration for this integration is not expected to impose a significant performance impact on the system. |
| 52 | |
| 53 | ## Setup |
| 54 | |
| 55 | |
| 56 | ### Prerequisites |
| 57 | |
| 58 | No action required. |
| 59 | |
| 60 | ### Configuration |
| 61 | |
| 62 | #### Options |
| 63 | |
| 64 | There are three sections in the file which you can configure: |
| 65 | |
| 66 | - `[plugin:macos:sysctl]` - Enable or disable monitoring for network, swap, loadavg, and boot time. |
| 67 | - `[plugin:macos:mach_smi]` - Enable or disable monitoring for CPU and Virtual memory. |
| 68 | - `[plugin:macos:iokit]` - Enable or disable monitoring for storage device. |
| 69 | |
| 70 | |
| 71 | <details open><summary>Config options</summary> |
| 72 | |
| 73 | |
| 74 | |
| 75 | | Option | Description | Default | Required | |
| 76 | |:-----|:------------|:--------|:---------:| |
| 77 | | enable load average | Enable or disable monitoring of load average metrics (load1, load5, load15). | yes | no | |
| 78 | | system swap | Enable or disable monitoring of system swap metrics (free, used). | yes | no | |
| 79 | | bandwidth | Enable or disable monitoring of network bandwidth metrics (received, sent). | yes | no | |
| 80 | | ipv4 TCP packets | Enable or disable monitoring of IPv4 TCP total packets metrics (received, sent). | yes | no | |
| 81 | | ipv4 TCP errors | Enable or disable monitoring of IPv4 TCP packets metrics (Input Errors, Checksum, Retransmission segments). | yes | no | |
| 82 | | ipv4 TCP handshake issues | Enable or disable monitoring of IPv4 TCP handshake metrics (Established Resets, Active Opens, Passive Opens, Attempt Fails). | yes | no | |
| 83 | | ECN packets | Enable or disable monitoring of ECN statistics metrics (InCEPkts, InNoECTPkts). | auto | no | |
| 84 | | TCP SYN cookies | Enable or disable monitoring of TCP SYN cookies metrics (received, sent, failed). | auto | no | |
| 85 | | TCP out-of-order queue | Enable or disable monitoring of TCP out-of-order queue metrics (inqueue). | auto | no | |
| 86 | | TCP connection aborts | Enable or disable monitoring of TCP connection aborts metrics (Bad Data, User closed, No memory, Timeout). | auto | no | |
| 87 | | ipv4 UDP packets | Enable or disable monitoring of ipv4 UDP packets metrics (sent, received.). | yes | no | |
| 88 | | ipv4 UDP errors | Enable or disable monitoring of ipv4 UDP errors metrics (Recieved Buffer error, Input Errors, No Ports, IN Checksum Errors, Ignore Multi). | yes | no | |
| 89 | | ipv4 icmp packets | Enable or disable monitoring of IPv4 ICMP packets metrics (sent, received, in error, OUT error, IN Checksum error). | yes | no | |
| 90 | | ipv4 icmp messages | Enable or disable monitoring of ipv4 ICMP messages metrics (I/O messages, I/O Errors, In Checksum). | yes | no | |
| 91 | | ipv4 packets | Enable or disable monitoring of ipv4 packets metrics (received, sent, forwarded, delivered). | yes | no | |
| 92 | | ipv4 fragments sent | Enable or disable monitoring of IPv4 fragments sent metrics (ok, fails, creates). | yes | no | |
| 93 | | ipv4 fragments assembly | Enable or disable monitoring of IPv4 fragments assembly metrics (ok, failed, all). | yes | no | |
| 94 | | ipv4 errors | Enable or disable monitoring of IPv4 errors metrics (I/O discard, I/O HDR errors, In Addr errors, In Unknown protos, OUT No Routes). | yes | no | |
| 95 | | ipv6 packets | Enable or disable monitoring of IPv6 packets metrics (received, sent, forwarded, delivered). | auto | no | |
| 96 | | ipv6 fragments sent | Enable or disable monitoring of IPv6 fragments sent metrics (ok, failed, all). | auto | no | |
| 97 | | ipv6 fragments assembly | Enable or disable monitoring of IPv6 fragments assembly metrics (ok, failed, timeout, all). | auto | no | |
| 98 | | ipv6 errors | Enable or disable monitoring of IPv6 errors metrics (I/O Discards, In Hdr Errors, In Addr Errors, In Truncaedd Packets, I/O No Routes). | auto | no | |
| 99 | | icmp | Enable or disable monitoring of ICMP metrics (sent, received). | auto | no | |
| 100 | | icmp redirects | Enable or disable monitoring of ICMP redirects metrics (received, sent). | auto | no | |
| 101 | | icmp errors | Enable or disable monitoring of ICMP metrics (I/O Errors, In Checksums, In Destination Unreachable, In Packet too big, In Time Exceeds, In Parm Problem, Out Dest Unreachable, Out Timee Exceeds, Out Parm Problems.). | auto | no | |
| 102 | | icmp echos | Enable or disable monitoring of ICMP echos metrics (I/O Echos, I/O Echo Reply). | auto | no | |
| 103 | | icmp router | Enable or disable monitoring of ICMP router metrics (I/O Solicits, I/O Advertisements). | auto | no | |
| 104 | | icmp neighbor | Enable or disable monitoring of ICMP neighbor metrics (I/O Solicits, I/O Advertisements). | auto | no | |
| 105 | | icmp types | Enable or disable monitoring of ICMP types metrics (I/O Type1, I/O Type128, I/O Type129, Out Type133, Out Type135, In Type136, Out Type145). | auto | no | |
| 106 | | space usage for all disks | Enable or disable monitoring of space usage for all disks metrics (available, used, reserved for root). | yes | no | |
| 107 | | inodes usage for all disks | Enable or disable monitoring of inodes usage for all disks metrics (available, used, reserved for root). | yes | no | |
| 108 | | bandwidth | Enable or disable monitoring of bandwidth metrics (received, sent). | yes | no | |
| 109 | | system uptime | Enable or disable monitoring of system uptime metrics (uptime). | yes | no | |
| 110 | | cpu utilization | Enable or disable monitoring of CPU utilization metrics (user, nice, system, idel). | yes | no | |
| 111 | | system ram | Enable or disable monitoring of system RAM metrics (Active, Wired, throttled, compressor, inactive, purgeable, speculative, free). | yes | no | |
| 112 | | swap i/o | Enable or disable monitoring of SWAP I/O metrics (I/O Swap). | yes | no | |
| 113 | | memory page faults | Enable or disable monitoring of memory page faults metrics (memory, cow, I/O page, compress, decompress, zero fill, reactivate, purge). | yes | no | |
| 114 | | disk i/o | Enable or disable monitoring of disk I/O metrics (In, Out). | yes | no | |
| 115 | |
| 116 | |
| 117 | </details> |
| 118 | |
| 119 | |
| 120 | |
| 121 | #### via File |
| 122 | |
| 123 | The configuration file name for this integration is `netdata.conf`. |
| 124 | |
| 125 | The file format is a modified INI syntax. The general structure is: |
| 126 | |
| 127 | ```ini |
| 128 | [section1] |
| 129 | option1 = some value |
| 130 | option2 = some other value |
| 131 | |
| 132 | [section2] |
| 133 | option3 = some third value |
| 134 | ``` |
| 135 | You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the |
| 136 | Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory). |
| 137 | |
| 138 | ```bash |
| 139 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 140 | sudo ./edit-config netdata.conf |
| 141 | ``` |
| 142 | |
| 143 | ##### Examples |
| 144 | |
| 145 | ###### Disable swap monitoring. |
| 146 | |
| 147 | A basic example that discards swap monitoring |
| 148 | |
| 149 | <details open><summary>Config</summary> |
| 150 | |
| 151 | ```yaml |
| 152 | [plugin:macos:sysctl] |
| 153 | system swap = no |
| 154 | [plugin:macos:mach_smi] |
| 155 | swap i/o = no |
| 156 | |
| 157 | ``` |
| 158 | </details> |
| 159 | |
| 160 | ###### Disable complete Machine SMI section. |
| 161 | |
| 162 | A basic example that discards swap monitoring |
| 163 | |
| 164 | <details open><summary>Config</summary> |
| 165 | |
| 166 | ```yaml |
| 167 | [plugin:macos:mach_smi] |
| 168 | cpu utilization = no |
| 169 | system ram = no |
| 170 | swap i/o = no |
| 171 | memory page faults = no |
| 172 | disk i/o = no |
| 173 | |
| 174 | ``` |
| 175 | </details> |
| 176 | |
| 177 | |
| 178 | |
| 179 | ## Alerts |
| 180 | |
| 181 | |
| 182 | The following alerts are available: |
| 183 | |
| 184 | | Alert name | On metric | Description | |
| 185 | |:------------|:----------|:------------| |
| 186 | | [ interface_speed ](https://github.com/netdata/netdata/blob/master/src/health/health.d/net.conf) | net.net | network interface ${label:device} current speed | |
| 187 | |
| 188 | |
| 189 | ## Metrics |
| 190 | |
| 191 | Metrics grouped by *scope*. |
| 192 | |
| 193 | The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. |
| 194 | |
| 195 | |
| 196 | |
| 197 | ### Per macOS instance |
| 198 | |
| 199 | These metrics refer to hardware and network monitoring. |
| 200 | |
| 201 | |
| 202 | This scope has no labels. |
| 203 | |
| 204 | Metrics: |
| 205 | |
| 206 | | Metric | Dimensions | Unit | |
| 207 | |:------|:----------|:----| |
| 208 | | system.cpu | user, nice, system, idle | percentage | |
| 209 | | system.ram | active, wired, throttled, compressor, inactive, purgeable, speculative, free | MiB | |
| 210 | | mem.swapio | io, out | KiB/s | |
| 211 | | mem.pgfaults | memory, cow, pagein, pageout, compress, decompress, zero_fill, reactivate, purge | faults/s | |
| 212 | | system.load | load1, load5, load15 | load | |
| 213 | | mem.swap | free, used | MiB | |
| 214 | | system.ipv4 | received, sent | kilobits/s | |
| 215 | | ipv4.tcppackets | received, sent | packets/s | |
| 216 | | ipv4.tcperrors | InErrs, InCsumErrors, RetransSegs | packets/s | |
| 217 | | ipv4.tcphandshake | EstabResets, ActiveOpens, PassiveOpens, AttemptFails | events/s | |
| 218 | | ipv4.tcpconnaborts | baddata, userclosed, nomemory, timeout | connections/s | |
| 219 | | ipv4.tcpofo | inqueue | packets/s | |
| 220 | | ipv4.tcpsyncookies | received, sent, failed | packets/s | |
| 221 | | ipv4.ecnpkts | CEP, NoECTP | packets/s | |
| 222 | | ipv4.udppackets | received, sent | packets/s | |
| 223 | | ipv4.udperrors | RcvbufErrors, InErrors, NoPorts, InCsumErrors, IgnoredMulti | events/s | |
| 224 | | ipv4.icmp | received, sent | packets/s | |
| 225 | | ipv4.icmp_errors | InErrors, OutErrors, InCsumErrors | packets/s | |
| 226 | | ipv4.icmpmsg | InEchoReps, OutEchoReps, InEchos, OutEchos | packets/s | |
| 227 | | ipv4.packets | received, sent, forwarded, delivered | packets/s | |
| 228 | | ipv4.fragsout | ok, failed, created | packets/s | |
| 229 | | ipv4.fragsin | ok, failed, all | packets/s | |
| 230 | | ipv4.errors | InDiscards, OutDiscards, InHdrErrors, OutNoRoutes, InAddrErrors, InUnknownProtos | packets/s | |
| 231 | | ipv6.packets | received, sent, forwarded, delivers | packets/s | |
| 232 | | ipv6.fragsout | ok, failed, all | packets/s | |
| 233 | | ipv6.fragsin | ok, failed, timeout, all | packets/s | |
| 234 | | ipv6.errors | InDiscards, OutDiscards, InHdrErrors, InAddrErrors, InTruncatedPkts, InNoRoutes, OutNoRoutes | packets/s | |
| 235 | | ipv6.icmp | received, sent | messages/s | |
| 236 | | ipv6.icmpredir | received, sent | redirects/s | |
| 237 | | ipv6.icmperrors | InErrors, OutErrors, InCsumErrors, InDestUnreachs, InPktTooBigs, InTimeExcds, InParmProblems, OutDestUnreachs, OutTimeExcds, OutParmProblems | errors/s | |
| 238 | | ipv6.icmpechos | InEchos, OutEchos, InEchoReplies, OutEchoReplies | messages/s | |
| 239 | | ipv6.icmprouter | InSolicits, OutSolicits, InAdvertisements, OutAdvertisements | messages/s | |
| 240 | | ipv6.icmpneighbor | InSolicits, OutSolicits, InAdvertisements, OutAdvertisements | messages/s | |
| 241 | | ipv6.icmptypes | InType1, InType128, InType129, InType136, OutType1, OutType128, OutType129, OutType133, OutType135, OutType143 | messages/s | |
| 242 | | system.uptime | uptime | seconds | |
| 243 | | system.io | in, out | KiB/s | |
| 244 | |
| 245 | ### Per disk |
| 246 | |
| 247 | |
| 248 | |
| 249 | This scope has no labels. |
| 250 | |
| 251 | Metrics: |
| 252 | |
| 253 | | Metric | Dimensions | Unit | |
| 254 | |:------|:----------|:----| |
| 255 | | disk.io | read, writes | KiB/s | |
| 256 | | disk.ops | read, writes | operations/s | |
| 257 | | disk.util | utilization | % of time working | |
| 258 | | disk.iotime | reads, writes | milliseconds/s | |
| 259 | | disk.await | reads, writes | milliseconds/operation | |
| 260 | | disk.avgsz | reads, writes | KiB/operation | |
| 261 | | disk.svctm | svctm | milliseconds/operation | |
| 262 | |
| 263 | ### Per mount point |
| 264 | |
| 265 | |
| 266 | |
| 267 | This scope has no labels. |
| 268 | |
| 269 | Metrics: |
| 270 | |
| 271 | | Metric | Dimensions | Unit | |
| 272 | |:------|:----------|:----| |
| 273 | | disk.space | avail, used, reserved_for_root | GiB | |
| 274 | | disk.inodes | avail, used, reserved_for_root | inodes | |
| 275 | |
| 276 | ### Per network device |
| 277 | |
| 278 | |
| 279 | |
| 280 | This scope has no labels. |
| 281 | |
| 282 | Metrics: |
| 283 | |
| 284 | | Metric | Dimensions | Unit | |
| 285 | |:------|:----------|:----| |
| 286 | | net.net | received, sent | kilobits/s | |
| 287 | | net.packets | received, sent, multicast_received, multicast_sent | packets/s | |
| 288 | | net.errors | inbound, outbound | errors/s | |
| 289 | | net.drops | inbound | drops/s | |
| 290 | | net.events | frames, collisions, carrier | events/s | |
| 291 | |
| 292 |