CLI dashboard for SNOs

Previous one was with Gnome Terminal and Gruvbox Dark this one with kitty and if I remember correctly Tokyo Night. To be honest and with full respect I realized that I am finding it too flashy, especially when running a series of reading for a few nodes in a row, each node with a different color. The next step I am going to take is to remove all the whites and blend it with the main color. I will leave only the greens, yellows and reds.[This may not happen immediately but this is my intention for the future]. The reason is that I found that after a few refreshes I am only focusing on a few fields and checking if everything is just running. I think it is subjective but for me the most important values are: Name, Up to date version indicator, Quick status, Storj token exchange rate, todays egress and ingress and online and suspension stats. Please do not get me wrong, I believe the other fields are very important, however, they are used sporadically.

But hey, I am wondering if you know:

How to transform date output of <$ver[0].published_at> into <-format "dd-MMM-yyyy HH:mm:ss>?

How to increase GitHub limit? This one from 60? Is there any piece of code and precise GitHub token creation steps you may provide?

And how to make a variable from <127.0.0.1:14002> so

$satData = Invoke-WebRequest 'http://127.0.0.1:14002/api/sno/satellites' | ConvertFrom-Json

can be changed into something like

$satData = Invoke-WebRequest 'http://**$ipport**/api/sno/satellites' | ConvertFrom-Json.

This way or another thanks again.

$nodeAPI = 'http://192.168.10.12:14324/api/sno'
$satData = Invoke-WebRequest ($nodeAPI + '/satellites') -UseBasicParsing | ConvertFrom-Json
1 Like

You can change your dashboard however you want to suit your needs :slight_smile:

Building this dashboard has helped me learn a lot about Powershell. It helped me brush up on my C# too. If it wasn’t for Awesome Alexey’s success script I would have not stumbled upon PowerShell at all. As you can already see he is precise and concise with his code. :heart: it :dark_sunglasses:

I also love your feedback. Keep it coming. I also urge other users, if any, to post their feedback if they want. Any feature request is only going to help me learn more.

1 Like

Xfce4-terminal with Dark Pastels

and

ROXterm with Tango

Building this dashboard has helped me learn a lot about Powershell. It helped me brush up on my C# too.

Cool. I know almost nothing about PowerShell and C#. Are you maybe also interested in Data Parallel C++ or some just in time compiled languages like Julia or Mojo or maybe in subexponential-time quantum algorithms?

I also love your feedback. Keep it coming.

I am not providing you any feedback, I like your dashboard, I am trying to contribute.

If it wasn’t for Awesome Alexey’s success script I would have not stumbled upon PowerShell at all.

Yeah, this would be cool to add success rate data to this dashboard, however, I am afraid that as for this, I guess we would have to make friends with some Storj developers and even then I am not sure if this could be possible at all. As I mentioned before, one of the reasons I like your dashboard is that there is no need for a direct access to database files. It seems that to get success rate data one needs to have a direct access to the log files and rather quite substantial computing and memory resources.

As you can already see he is precise and concise with his code.

Yeah, I noticed, also that he is running some of his nodes on port #14324, that implies a lot of stuff. :slight_smile:

BTW, do you know:

  • What would be the correct for loop syntax if I want to go over a few of my nodes and I have the following (corresponding) variables / values for each of my nodes:
$nameID1 = "storagenode name and hostname"
$nodeAPIID1 = 'http://ip:port/api/sno'
$commentsID1 = "Go here"
# Headers color:
$colorOneID1 = "DarkCyan"
# Values color (make it the same as the headers color if you prefer more subdued appearance):
$colorTwoID1 = "DarkGray"
  • What may be the reason that I started getting such a wired symbols when redirecting the output of this script to a text file:

e]8;;https://github.com/storj/storj/releases/tag/v1.86.1e\1.86.1e]8;;e\

I am getting such symbols only for a) currently installed version, b) current release and c) for wallet address.

  • How to execute PowerShell scripts over crontab? I did some tries, including executing this script over crontab with a full path to PowerShell, however, it seems not to work.

I made it working. Not sure if this is the optimal way but it works. Also not sure if absolute paths are required.

In order to save the output of Nerdboard.ps1 to a text file:

## Install PowerShell on Linux
[https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.3#binary-archives]
## Make a directory
$ mkdir -p /absolute/path/to/logs_nerdboard
## Create nerdboard.sh, make it executable and enter following content:

#!/usr/bin/pwsh

pwsh /absolute/path/to/Nerdboard.ps1 > /absolute/path/to/logs_nerdboard/$(date +%F_%H-%M-%S)_nerdboard.txt
## To run every day at 23:59 
$ crontab -e
59 23 * * * /absolute/path/to/nerdboard.sh

There are debug counters that may help here. Comparing upload_started_count counter and upload_success_count/upload_failure_count/upload_cancel_count will give you the numbers you want.

1 Like

Wow - I was not aware about this fact!

I am handling the code to @nerdatwork, @Alexey and to you.

I hope that maybe you find something to be useful and that may be utilized in your potential future developments.

Btw,

tabby (two panels) with a custom theme:

rxvt-unicode (don’t remember what theme):

and finally VS Code PowerShell with GitHub Dark Dimmed:

:slight_smile:

1 Like

It would be a normal for loop

 for ($i=0; $i -lt (number of nodes); $i++) { 
   $nameID1 = "storagenode name and hostname"
   $nodeAPIID1 = 'http://ip:port/api/sno'
   $commentsID1 = "Go here"
   # Headers color:
   $colorOneID1 = "DarkCyan"
   # Values color (make it the same as the headers color if you prefer more subdued appearance):
   $colorTwoID1 = "DarkGray" 
} 

How are you redirecting the output?

Great job on figuring it out!

It would be a normal for loop.

I will try to follow your advice, however, to be honest, I do not think that initiating an array in such a way will be correctly evaluated by PowerShell. And it looks like a nested for loop is needed by your script in this case. Also wondering if calling variables in global or local scope makes any performance difference in PowerShell. To sum up, I might be wrong, its just a feeling, I know very little about PowerShell. Definitely, I will give it a try. Thanks.

How are you redirecting the output?

Exactly in the way I outlined above with my crontab example.

Great job on figuring it out!

Your move.

:slight_smile:

Update: Oct 1, 2023

Added :point_down:

  • Dashboard creation date at top left of the window
  • Last transaction date and amount on current wallet address.
    The transaction date is :red_square: when there is no transaction from current month. It shows date in :green_circle: when there is a transaction in current month. In short, if you get paid in current month date shows up in green else it shows in red. The amount shown is in Storj token.
  • Monthly bandwidth data
    Its shown in three columns to avoid vertical scrolling. To minimize space “Press space to continue” is shown in same row as last day’s bandwidth data. Egress is in green while ingress is in yellow color.

PS: Thanks to @s-t-o-r-j-user for ideas, feature request and contribution :slight_smile: :heart:

1 Like

great work, also great “themes” from @s-t-o-r-j-user .

2 Likes

Great stuff @nerdatwork. Would you also consider implementing comparison of debug counters like upload_started_count and upload_success_count/upload_failure_count/upload_cancel_count as per information provided above by @Toyoo?

1 Like

It would entail dealing with the log file. This would be a different project altogether.

Would you like to post a screenshot using the latest script? I want to see if it works as intended on other computers too :slight_smile:

Please hide any data you don’t want to show in the screenshot.

loglevel fatal all the way.
anyway

I hope to change your mind with what I can do to logs :slight_smile:

may become handy when i reenable them to search for errors :slight_smile:

How can Powershell be installed in Linux? Is there any small manual?

2 Likes

After reading @Toyoo information above, my initial understanding was that this method does not require access to logs. I admit that until now, I did not take any closer look at this topic. Any additional comments @Toyoo, @Alexey?

I noticed some mismatches related to tabs and spaces but overall it is really useful. In general, my suggestion would be to do additional grouping of items thus making it as simple as possible to read. Using only two colors is making comprehending information faster in my opinion, however, it is a personal taste - I mean two main colors plus the alert ones (red and yellow).