jamiebegin / metrics2mqtt

Publish cross-platorm system performance metrics to a MQTT broker.
MIT License
63 stars 9 forks source link

Create com.jamiebegin.metrics2mqtt.service.plist #12

Open seaniedan opened 3 years ago

seaniedan commented 3 years ago

Launcher daemon for MacOS. Needs to be copied to /Library/LaunchDaemons/com.jamiebegin.metrics2mqtt.service.plist

  1. Replace xxx's with your hostname (see note below), broker, username and password
  2. Make sure permissions are correct: sudo chmod 600 /Library/LaunchDaemons/com.jamiebegin.metrics2mqtt.service.plist
  3. Test with: sudo launchctl load /Library/LaunchDaemons/com.jamiebegin.metrics2mqtt.service.plist then test it's running: sudo launchctl list | grep com.jamiebegin.metrics2mqtt.service You should see something like: 1265 0 com.jamiebegin.metrics2mqtt.service If not, debug with: sudo tail -n 1000 /var/log/system.log|grep com.jamiebegin.metrics2mqtt.service
  4. Load permanently with: sudo launchctl load -w /Library/LaunchDaemons/com.jamiebegin.metrics2mqtt.service.plist

NOTE: homeassistant is picky about naming in sensors. If your machine has .local, apostrophes or hyphens in the name, it won't be discovered. Message Home Assistant if that's an issue for you!

seaniedan commented 3 years ago

Just noticed the plist has "/" for the disk space: this won't work. Please remove the quotes so the line in plist reads --du=/ -many thanks