Hi all. I've been recently using osquery 5.2.3 on ...
# macos
s
Hi all. I've been recently using osquery 5.2.3 on a M1 Pro laptop, running macOS 12.3.1. After several hours of the use, the palm reset heat-up (no fan). I queried the table
temperature_sensor
for info and it doesn't seem correct:
Copy code
/usr/local/bin/osqueryi --line "select * from temperature_sensors order by fahrenheit desc;"
       key = TB0T
      name = Battery TS_MAX
   celsius = -1.0
fahrenheit = 30.2

       key = TB1T
      name = Battery 1
   celsius = -1.0
fahrenheit = 30.2

       key = TB2T
      name = Battery 2
   celsius = -1.0
fahrenheit = 30.2

       key = TG0H
      name = GPU Heatsink
   celsius = -1.0
fahrenheit = 30.2

       key = TW0P
      name = Airport Proximity
   celsius = -1.0
fahrenheit = 30.2

       key = Tp0C
      name = Power Supply 1 Alt.
   celsius = -1.0
fahrenheit = 30.2

       key = Ts0P
      name = Palm Rest
   celsius = -1.0
fahrenheit = 30.2
z
Hmm, maybe an M1 issue? cc @sharvil Values seem plausible on my intel MBP
Copy code
/usr/local/bin/osqueryi --line "select * from temperature_sensors order by fahrenheit desc;"
       key = TC0F
      name = CPU 1
   celsius = 69.3
fahrenheit = 156.7

       key = TCXC
      name = PECI CPU
   celsius = 69.0
fahrenheit = 156.2

       key = TC2C
      name = CPU Core 2
   celsius = 68.0
fahrenheit = 154.4

       key = TC0E
      name = CPU 1
   celsius = 67.3
fahrenheit = 153.1

       key = TC1C
      name = CPU Core 1
   celsius = 67.0
fahrenheit = 152.6

       key = TC4C
      name = CPU Core 4
   celsius = 67.0
fahrenheit = 152.6

       key = TCSA
      name = PECI SA
   celsius = 67.0
fahrenheit = 152.6

       key = TC3C
      name = CPU Core 3
   celsius = 66.0
fahrenheit = 150.8
Your values look like placeholders that the API is returning for an error state or something like that
s
That make sense, but the reading is incorrect on my M1 Pro.
z
It's correct on a desktop M1?
s
@zwass thanks for making sense of it. So, it isn't sn issue with osquery?
14" M1 Pro.
z
It could definitely be an issue with osquery
s
ok.
z
So it's correct on 14" M1 Pro and incorrect on another M1 Pro?
s
I don't have another one handy at the moment.
z
I don't have an M1 handy but folks on our team do -- I would guess there's a firmware difference or something that causes the values returned by the API to be incorrect or something like that.
s
ok, I'll update to macOS 12.4 then try again. I'll have another M1 Pro available over the weekend with a fresh install.
z
My Intel MBP on 12.4 is working. But I suspect the issue will be intel vs. M1 rather than 12.4 vs 12.3. Let us know what you find.
s
I have an i9 8-core that shows proper details
m
I've opened an issue for you about this https://github.com/osquery/osquery/issues/7627
👍 1
I have access to an M1 Mac Mini, let's see if it has temperature sensors
Well it has one sensor. Definitely reporting the wrong temperature.
30.2ºF is a straight conversion of -1ºC which is an error
😂 1
1
s
@zwass I did get another M1 Pro laptop this evening, with the latest macOS 12.4, to confirm same symptoms.
s
Yeah, this is not expected to work with Apple Silicon, the temperature sensors/fan speeds on Intel SMC keys, and all the power management is now on the SoC
z
Can we have the table return an error if it's on Apple Silicon rather than bad data?
s
@zwass yeah, I think that should be doable
s
I'd suggest the documentation get a footnote on the schema:
Show only Tables compatible with: macOS
for Intel-only on this table.
m
I just added a link to some Objective C code that will give us the temperature sensors on Apple Silicon, but it's BSD-3 code so I'll let someone else advise on how to borrow or derive from that
s
https://github.com/GuillaumeGomez/sysinfo/issues/456 has some snippets about which apple framework it's coming from. Which is probably enough for a clean implementation.