-
Notifications
You must be signed in to change notification settings - Fork 8
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
Resolves #9 SD card utilisation locale fix #10
base: master
Are you sure you want to change the base?
Resolves #9 SD card utilisation locale fix #10
Conversation
Resolves issue with different locale when using "grep -v Used". The suggestion is based on only querying the sd card utilization on root file level and then uses the only available stats line with relying on 'tail'.
Looking at your fix and incorporating it into my new version of this plugin, now called signalk-rpi-monitor. Looking at the man page for the df command on raspberry pi bullseye release, the -m option to df is not mentioned. It also doesn't appear to be needed to get the percentage of free space available. I like your idea of requesting just the / file system and using tail -1 to get rid of the header line. I see the --output=pcent option to return only the percent of space used, on a line by itself. But still need to get rid of the % symbol. So I propose the following command: What do you think? Will this work in your local? Do you see any problems with this strategy? |
According to discussion in nmostovoy#10. Removed the unnecessary"-m" parameter and added the parameter "--output=pcent" according to idea from @sberl.
Thanks for having a look at it and for the quick response.
The word "Used" does not appear in my locale "de". Instead the word "Verw" appears which is the abbreviation of "Verwendet", the german word for "Used". Other locales might have their own description too. This it what is shown when executing "df /":
You are right the parameter "-m" is currently not documented (anymore?). While analysing the absolute disk space, I used the parameter "-m" to get a more human readable output (which is using 1048576-byte (1-Mbyte) blocks rather than the default). I agree it is unnecessary in this relative (%) context.
I like your adjustment, as this simplifies the command even more. This is also working well in my locale:
I included this in my latest commit if this is ok with you. |
The idea now is to deprecate nmostovoy/signalk-raspberry-pi-monitoring.
This is because nmostovoy has not incorporated any pull requests, or
responded to any attempts to communicate for a while now.
I have a new plugin "signalk-rpi-monitor" which I published version 1.0.0
of a few days ago. I hope to support this for the future, adding
enhancements, etc.
Version 1.1.0 should be out soon and will include this fix, and all the
other pull requests that were pending for
nmostovoy/signalk-raspberry-pi-monitoring.
You may consider switching to is newer one.
Any other data you'd like to see reported? I'm considering adding some
network traffic stats. Also some more static data such as what hardware is
running, physical disk and RAM sizes, and OS version. Maybe add some alarms
for low disk space, or excessive swapping (not enough memory),
overtemperature, etc.
Might also have some use for signalk server version, list of installed
plugins with their versions. But that might need to go into a different
part of the path tree structure.
I'm also seeing that the only thing here that is actually Raspberry Pi
specific is GPU temperature. Everything else is generic Linux. Could
probably be extended to work on other operating systems without too much
trouble, but not looking at that just yet.
Thoughts?
…On Fri, May 13, 2022 at 12:36 PM hailigsblechle ***@***.***> wrote:
Thanks for having a look at it and for the quick response.
I'd like to understand the problem you were having. Is the issue that the
word "Used" does not appear in the header line when local is set to some
values?
The word "Used" does not appear in my locale "de". Instead the word "Verw"
appears which is the abbreviation of "Verwendet", the german word for
"Used". Other locales might have their own description too.
This it what is shown when executing "df /":
$ df /
Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
/dev/root 14991820 10155084 4171172 71% /
Looking at the man page for the df command on raspberry pi bullseye
release, the -m option to df is not mentioned. It also doesn't appear to be
needed to get the percentage of free space available.
You are right the parameter "-m" is currently not documented (anymore?).
While analysing the absolute disk space, I used the parameter "-m" to get a
more human readable output (which is using 1048576-byte (1-Mbyte) blocks
rather than the default). I agree it is unnecessary in this relative (%)
context.
$ df -m /
Dateisystem 1M-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
/dev/root 14641 9919 4072 71% /
I see the --output=pcent option to return only the percent of space used,
on a line by itself. But still need to get rid of the % symbol.
So I propose the following command:
df --output=pcent / | tail -1 | awk 'gsub("%","")'
What do you think? Will this work in your local? Do you see any problems
with this strategy?
I like your adjustment, as this simplifies the command even more. This is
also working well in my locale:
$ df --output=pcent / | tail -1 | awk 'gsub("%","")'
71
I included this in my latest commit if this is ok with you.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHXLEN45ANPPHZYLWSCUELVJ2VLJANCNFSM5VOYHIHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
-steve
|
Your suggestions sound good. My thoughts are statistics such as:
CPU load across all cores
Disk I/O total read
Disk I/O total written
Network total received data
Network total sent data
RAM available
Raspberry Pi uptime
Under-voltage (is the power supply weak/defective) -> lightning symbol
SD card manufacturing date +health?
apt-get updates availability
Cheers
@hailigsblechle
… Am 13.05.2022 um 23:17 schrieb Steve Berl ***@***.***>:
The idea now is to deprecate nmostovoy/signalk-raspberry-pi-monitoring.
This is because nmostovoy has not incorporated any pull requests, or
responded to any attempts to communicate for a while now.
I have a new plugin "signalk-rpi-monitor" which I published version 1.0.0
of a few days ago. I hope to support this for the future, adding
enhancements, etc.
Version 1.1.0 should be out soon and will include this fix, and all the
other pull requests that were pending for
nmostovoy/signalk-raspberry-pi-monitoring.
You may consider switching to is newer one.
Any other data you'd like to see reported? I'm considering adding some
network traffic stats. Also some more static data such as what hardware is
running, physical disk and RAM sizes, and OS version. Maybe add some alarms
for low disk space, or excessive swapping (not enough memory),
overtemperature, etc.
Might also have some use for signalk server version, list of installed
plugins with their versions. But that might need to go into a different
part of the path tree structure.
I'm also seeing that the only thing here that is actually Raspberry Pi
specific is GPU temperature. Everything else is generic Linux. Could
probably be extended to work on other operating systems without too much
trouble, but not looking at that just yet.
Thoughts?
On Fri, May 13, 2022 at 12:36 PM hailigsblechle ***@***.***>
wrote:
> Thanks for having a look at it and for the quick response.
>
> I'd like to understand the problem you were having. Is the issue that the
> word "Used" does not appear in the header line when local is set to some
> values?
>
> The word "Used" does not appear in my locale "de". Instead the word "Verw"
> appears which is the abbreviation of "Verwendet", the german word for
> "Used". Other locales might have their own description too.
>
> This it what is shown when executing "df /":
>
> $ df /
>
> Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
>
> /dev/root 14991820 10155084 4171172 71% /
>
>
> Looking at the man page for the df command on raspberry pi bullseye
> release, the -m option to df is not mentioned. It also doesn't appear to be
> needed to get the percentage of free space available.
>
> You are right the parameter "-m" is currently not documented (anymore?).
> While analysing the absolute disk space, I used the parameter "-m" to get a
> more human readable output (which is using 1048576-byte (1-Mbyte) blocks
> rather than the default). I agree it is unnecessary in this relative (%)
> context.
>
> $ df -m /
>
> Dateisystem 1M-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
>
> /dev/root 14641 9919 4072 71% /
>
>
> I see the --output=pcent option to return only the percent of space used,
> on a line by itself. But still need to get rid of the % symbol.
>
> So I propose the following command:
> df --output=pcent / | tail -1 | awk 'gsub("%","")'
>
> What do you think? Will this work in your local? Do you see any problems
> with this strategy?
>
> I like your adjustment, as this simplifies the command even more. This is
> also working well in my locale:
>
> $ df --output=pcent / | tail -1 | awk 'gsub("%","")'
>
> 71
>
>
> I included this in my latest commit if this is ok with you.
>
> —
> Reply to this email directly, view it on GitHub
> <#10 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAHXLEN45ANPPHZYLWSCUELVJ2VLJANCNFSM5VOYHIHA>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
-steve
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Resolves issue with different locale when using "grep -v Used". The suggestion is based on only querying the sd card utilization on root file level and then uses the only available stats line with relying on 'tail'.
Resolves #9