Skip to content

Instantly share code, notes, and snippets.

@boneskull
Last active April 21, 2024 20:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save boneskull/e6d57d6793804f3e5f171cd5518cb08b to your computer and use it in GitHub Desktop.
Save boneskull/e6d57d6793804f3e5f171cd5518cb08b to your computer and use it in GitHub Desktop.
Run glances webserver as a user service (agent) on macOS

com.boneskull.glances-web

This launch agent will automatically start a glances web server

Installation

  1. Install Homebrew.
  2. Install glances. Execute brew install glances.
  3. Copy the .plist file in this gist into ~/Library/LaunchAgents/.
  4. EDIT the .plist: change /Users/boneskull/ to /Users/<you>/
  5. Execute launchctl load ~/Library/LaunchAgents/com.boneskull.glances-web.plist. Do not run this command with superuser privileges.

Notes

  • You can also just install glances via pip3 if you have it.
  • This may be better installed as a global daemon instead of a user agent.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.boneskull.glances-web</string>
<key>ProcessType</key>
<string>Interactive</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/glances</string>
<string>-w</string>
</array>
<key>StandardErrorPath</key>
<string>/Users/boneskull/Library/Logs/com.boneskull.glances-web.err.log</string>
<key>StandardOutPath</key>
<string>/Users/boneskull/Library/Logs/com.boneskull.glances-web.log</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment