heholord / falconstats Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
After moving motd.js to start.js, the bin-part of the json must be adjusted
A config.json file is now in the root directory of the repository
Reading it from Javascript isn't an issue and scripts can be easily reconfigured to use values from that in the code. Bash scripts however will need some utility like JQ to read from the json file.
I timed the scripts in the repo last night and bash came ahead consistantly around 5-10 times faster than nodejs scripts. I think we should aim to keep the runtime down as much as possible to avoid too much bloat. We could also cache nodejs scripts at a specific interval for scripts that aren't very quick to change anyway.
What do people think is the best way to do this? I feel like this project would be better if you could edit a config file for appearance, key values, and so on.
In the instructions it says:
"ln -s falcon-motd /etc/update-motd/falconstats"
However on Ubuntu Server 18.04 the directory is "/etc/update-motd.d/"
Unless there's something I'm missing or doing wrong?
I get the following error output when running "node init.js" as shown in the directions:
module.js:549
throw err;
^
Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/abdulhakeem/FalconStats/init.js:1:83)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
let [name, temp] = match.slice(1);
^
SyntaxError: Unexpected token [
Don't have any experience with nodejs but it seems like you can't define two variables in one line, or at least not like this.
I noticed this project doesn't have a license associated with it.
By the Free Software Foundation's definition, software without a license is not free. It looks like the intent is to have this be a free software project, based on the fact that you have been accepting code from a few contributors.
I suggest you add a suitable license to this repository, to clarify that the code is free software. Choosealicense.com is a good resource for selecting a suitable license.
I personally recommend the GNU GPL v3.
Modifying the file to change /home to something else seems to work fine though.
I'm not sure if I should create a pull request, so I thought I just create an issue and let you guys decide if you are interested.
I converted the ssl, discspace and hddtemp script from nodejs to bash, which lightens this whole thing as nodejs would not be required to run this and still get a beautifull MOTD output.
The hddtemp script currently does not display the temperatures in columns, but this could probably implemented.
You can find the scripts here.
What is missing is a simple configuration wizzard, but I added all the configuration options to ./scripts/config.sh
which is included by the scripts when they run.
Just some suggestions, really like the effort here :-)
FalconStats installation notes
OS: Ubuntu 20.04 LTS x86_64
Kernel: 5.4.0-40-generic
git clone https://github.com/Heholord/FalconStats
cd FalconStats/
Cloned repo, cd'd to folder
sudo apt install nodejs npm
sudo npm install -g
Had to install nodejs and npm packages, weren't already installed
ln -s falcon-motd /etc/update-motd.d/falconstats
sudo ln -s falcon-motd /etc/update-motd.d/falconstats
ls
The directions seem to imply that there will be a 'falcon-motd' file/folder created, but this folder does not seem to exist anywhere. Tried searching with locate/mlocate but 'falcon-motd' doesn't seem to exist anywhere. So what is supposed to be symlinked?
Maybe the 'falcon-motd' folder is actually supposed to be the 'scripts' folder?
sudo node init.js
Completed the initial config
Drives:
/dev/sda,/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde,/dev/sdf,/dev/sdg
Services:
FAHClient,apache2,cups,lvm2,mysql,named,nmbd,openvpn,rsync,smbd,ssh,transmission-daemon,ufw,virtualbox,webmin
falcon-motd
'falcon-motd' does actually run the test, so it must be an executable somewhere right? So maybe that symlink from before will actually do something
got the problem with the services.sh script, but fixed with #21
Now falcon-motd executable seems to be working, but hddtemp not working because of sudo
sudo chmod u+s /usr/sbin/hddtemp
hddtemp still not working, although I confirmed I can run it as my user without sudo. Will have to revisit issue, not a problem with FalconStats.
Attempting symlink to see if falcon-motd will work upon logout/login
sudo ln -s falcon-motd /etc/update-motd.d/falconstats
After doing the symlink, /etc/update-motd.d/ shows the falconstats -> falcon-motd symlink but it's red w/ black background indicating a broken link, so something is going wrong at this point
So how to actually get the scripts to work with the update-motd.d directory? What exactly is running when falcon-motd
is executed? I'm not sure what I'm missing here but the point of failure seems to be this symlink thing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.