It is now known that almost all Linux commands can be executed using NodeRed. What makes the whole thing particularly practical is that you can then process the returned data using NodeRed.
This allows the read data to be processed. In the following article I use this to read out the last Linux logins on my RaspberryPi and display them in a table. This allows you to clearly display the last logins and show who logged in from where and when on the Linux computer in question. 🙂
Safety instructions
I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/
Affiliate links/advertising links
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂
Requirements
Helpful articles:
So that you can install new nodes, NodeRed should of course already be installed.
How to prepare a RaspberryPi and then install NodeRed on it is described in the following articles.
The following three articles describe what needs to be done to prepare the RaspberryPi:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
Required tool:
-no-
Required material:
In the following list you will find all the parts you need to implement this article.
Log into the NodeRed configuration interface
Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.
Install required nodes
In order for you to be able to use the NodeCode below, you must also have the Dashboard node (NodeRed - Create a user interface with dashboard nodes) also the node
node-red-node-ui-table
to install.
How you can do this is in the article NodeRed – Install new nodes described.
Import node code
To test this code you can simply import the code below into your NodeRed installation. You can find tips on this in the article NodeRed - import and export node code.
Unfortunately, I couldn't insert the NodeCode directly here because the HTML code it contains somewhat “confuses” the look of the website.
You can therefore find the NodeCode here Nerdiy Git:
https://github.com/Nerdiyde/NodeRedSnippets/blob/master/Display%20last%20Linux%20logins.txt
Dashboard view
Have fun with the project
I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂
PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂