summaryrefslogtreecommitdiffstats
path: root/collectors/macos.plugin
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/macos.plugin')
-rw-r--r--collectors/macos.plugin/README.md2
-rw-r--r--collectors/macos.plugin/macos_fw.c13
-rw-r--r--collectors/macos.plugin/macos_sysctl.c7
3 files changed, 11 insertions, 11 deletions
diff --git a/collectors/macos.plugin/README.md b/collectors/macos.plugin/README.md
index 800eb0e85..92bbf1eb1 100644
--- a/collectors/macos.plugin/README.md
+++ b/collectors/macos.plugin/README.md
@@ -9,4 +9,4 @@ Collects resource usage and performance data on macOS systems
By default, Netdata will enable monitoring metrics for disks, memory, and network only when they are not zero. If they are constantly zero they are ignored. Metrics that will start having values, after Netdata is started, will be detected and charts will be automatically added to the dashboard (a refresh of the dashboard is needed for them to appear though). Use `yes` instead of `auto` in plugin configuration sections to enable these charts permanently. You can also set the `enable zero metrics` option to `yes` in the `[global]` section which enables charts with zero metrics for all internal Netdata plugins.
-[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fmacos.plugin%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>)
+
diff --git a/collectors/macos.plugin/macos_fw.c b/collectors/macos.plugin/macos_fw.c
index 1fa2d39c8..08d1ddadd 100644
--- a/collectors/macos.plugin/macos_fw.c
+++ b/collectors/macos.plugin/macos_fw.c
@@ -35,7 +35,7 @@ int do_macos_iokit(int update_every, usec_t dt) {
RRDSET *st;
- mach_port_t master_port;
+ mach_port_t main_port;
io_registry_entry_t drive, drive_media;
io_iterator_t drive_list;
CFDictionaryRef properties, statistics;
@@ -73,19 +73,22 @@ int do_macos_iokit(int update_every, usec_t dt) {
// NEEDED BY: do_space, do_inodes
struct statfs *mntbuf;
int mntsize, i;
- char mntonname[MNAMELEN + 1];
char title[4096 + 1];
// NEEDED BY: do_bandwidth
struct ifaddrs *ifa, *ifap;
+#if !defined(MAC_OS_VERSION_12_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_12_0)
+#define IOMainPort IOMasterPort
+#endif
+
/* Get ports and services for drive statistics. */
- if (unlikely(IOMasterPort(bootstrap_port, &master_port))) {
+ if (unlikely(IOMainPort(bootstrap_port, &main_port))) {
error("MACOS: IOMasterPort() failed");
do_io = 0;
error("DISABLED: system.io");
/* Get the list of all drive objects. */
- } else if (unlikely(IOServiceGetMatchingServices(master_port, IOServiceMatching("IOBlockStorageDriver"), &drive_list))) {
+ } else if (unlikely(IOServiceGetMatchingServices(main_port, IOServiceMatching("IOBlockStorageDriver"), &drive_list))) {
error("MACOS: IOServiceGetMatchingServices() failed");
do_io = 0;
error("DISABLED: system.io");
@@ -115,7 +118,7 @@ int do_macos_iokit(int update_every, usec_t dt) {
CFRelease(properties);
IOObjectRelease(drive_media);
- if(unlikely(!diskstat.name || !*diskstat.name)) {
+ if(unlikely(!*diskstat.name)) {
IOObjectRelease(drive);
continue;
}
diff --git a/collectors/macos.plugin/macos_sysctl.c b/collectors/macos.plugin/macos_sysctl.c
index b744ebbcc..34d3f0b3e 100644
--- a/collectors/macos.plugin/macos_sysctl.c
+++ b/collectors/macos.plugin/macos_sysctl.c
@@ -70,11 +70,9 @@ int do_macos_sysctl(int update_every, usec_t dt) {
do_uptime = config_get_boolean("plugin:macos:sysctl", "system uptime", 1);
}
- RRDSET *st;
+ RRDSET *st = NULL;
- int system_pagesize = getpagesize(); // wouldn't it be better to get value directly from hw.pagesize?
- int i, n;
- int common_error = 0;
+ int i;
size_t size;
// NEEDED BY: do_loadavg
@@ -96,7 +94,6 @@ int do_macos_sysctl(int update_every, usec_t dt) {
// NEEDED BY: do_tcp...
struct tcpstat tcpstat;
- uint64_t tcps_states[TCP_NSTATES];
// NEEDED BY: do_udp...
struct udpstat udpstat;