Liste des Groupes | Revenir à col misc |
In comp.os.linux.misc The Natural Philosopher <tnp@invalid.invalid> wrote:No. I didnt think so either. :-(On 23/05/2025 19:44, Rich wrote:Yeah, at least the smart data is not (as far as I am aware) availableIn comp.os.linux.misc The Natural Philosopher <tnp@invalid.invalid> wrote:Sadly the data is not available in /sys or /proc AFAIK.I have a shell script that monitors hardware stuff - it needs to run>
as root and be called by Apache as user www.
>
Bookworm linux on a Pi4.
>
Its all inside a domestic firewall so security is not a huge issue.
What is the quickest and simplest solution to this?
You've been given lots of options already. But not this one.
>
What "hardware stuff" is it monitoring? If it is reading files in
/proc and/or /sys to obtain its "data" then another alternative would
be to setup /proc and /sys to be mounted group or world readable (or to
reset permissions on the necessary files via a rc.local boot script to
group or world readable). That would let the script "monitor" without
being root. Then you could even convert the script into a CGI script
(which Apache is more than able to execute, and doing so for minimal
text output involves the script outputting a handful of HTTP headers
before the monitor data) and get your "monitoring data" back via
Apache.
>
via /proc or /sys.
Another option. You could setup a cronjob, as root, to run your scriptI've used that approach elsewhere, But it means more storage.
on some periodic basis (once per minute, every 10 minutes, etc.) and
save the results into a file that is readable via the 'www' user (or to
save the info directly into a file in the Apache htdocs hierarchy from
where you want to retreive it).
Then you can 'pull' the data via Apache from that file.
You'd have data that is up to date as of the last run of the script,Could do, yes. But this way I get up to the second data.
but you would not have the "exactly now it is Y" aspect (unless your
AJAX pulled just after a cronjob run *and* you were watching the
'meters' at that very moment).
You could even include a "date" as the first line, so you could see if
something got hung by the time value being too far in the past.
Les messages affichés proviennent d'usenet.