Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sudo #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const debug = require('debug')('signalk-raspberry-pi-monitoring')
const _ = require('lodash')
const spawn = require('child_process').spawn

const gpu_temp_command = 'sudo /opt/vc/bin/vcgencmd measure_temp'
const cpu_temp_command = 'sudo cat /sys/class/thermal/thermal_zone0/temp'
const cpu_util_mpstat_command = 'sudo mpstat -P ALL\|grep \\\:\|grep -v \\\%'
const mem_util_command = 'sudo free'
const gpu_temp_command = '/opt/vc/bin/vcgencmd measure_temp'
const cpu_temp_command = 'cat /sys/class/thermal/thermal_zone0/temp'
const cpu_util_mpstat_command = 'mpstat -P ALL\|grep \\\:\|grep -v \\\%'
const mem_util_command = 'free'
const sd_util_command = 'df \/\|grep -v Used\|awk \'\{print \$5\}\'\|awk \'gsub\(\"\%\"\,\"\"\)\''

module.exports = function(app) {
Expand All @@ -35,7 +35,7 @@ module.exports = function(app) {

plugin.schema = {
type: "object",
description: "The user running node server must have permission to sudo without needing a password",
description: "The user running node server must be in the video group to get GPU temperature",
properties: {
path_cpu_temp: {
title: "SignalK Path for CPU temperature (K)",
Expand Down