atarallo / TECMINT_MONITOR

A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux. Originally published on http://www.tecmint.com
Apache License 2.0
248 stars 145 forks source link

Ubuntu is based on Debian, how does the script react to that ? #14

Closed Sim4n6 closed 8 years ago

Sim4n6 commented 8 years ago

Hi folks,

I just want to mention that based on this introductory article Debian is Linux distribution. So knowing that Ubuntu is also a linux distro based on Debian. I think the script ought to give each distro its merit.

That's why I 've been searching on the web for a reference that summarize all available distros and I found something interesting : Linux Distribution Timeline available on Linux Timeline on github

Thereby, we can make this script great (again). I am opening a discussion for improvement :+1:

Sim4n6 commented 8 years ago

for instance we can mention debian based system or redhat based system ... something like this.

atarallo commented 8 years ago

You mean instead of saying Ubuntu putting something like Debian Based System? Even Debian or redhat derivatives inherit a lot from original distributions I like to consider them as specific distributions.

Ubuntu has many specific things on it's own.

Sim4n6 commented 8 years ago

I mean : mentionning both, for instance Ubuntu as a disto, and Debian as based system or upstream distro or even say something like debian family . So we need to clean up the OSSTR variable.

This discussion can be an occasion to put it together and decide the right names for :

OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"

.... ?

Sim4n6 commented 8 years ago

OS Version contain OSSTR variable :

  1. OS point to uname -s
  2. DIST point to the Distro
  3. REV point to uname -r
  4. PSUEDONAME the name of what ? I have no idea ...
  5. KERNEL point to uname -r twice
  6. MACH point to uname -m

Just before OSSTR there is OS Type and after that the Architecture and Kernel version are displayed. so there is redondance here.

I suggest first to [ ] rename the os variable to ostype. and then [ ] OSSTR contain only DistroName+Version+DistroUpstreamName+OSTYPE That will give something like Ubuntu 16.10 LTS Debian based system GNU/Linux. In the Kernel part [ ] we make kernel name, release and kernel version using uname.

What do you think Atarallo ? seems a good start :+1:

Sim4n6 commented 8 years ago

Can you assign this task to me too ? thx

Sim4n6 commented 8 years ago

kernel="$(uname --kernel-name) $(uname --kernel-release) $(uname --kernel-version)"

Ex : Linux 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016

Sim4n6 commented 8 years ago

ostype=$(uname -o) Ex: GNU/LINUX

Sim4n6 commented 8 years ago

until now the PullRequest #16 fix this ...

Let focus on OSSTR now

OSSTR="$DITRO $DISTROVERSION $DISTROUPSTREAM based system $OSTYPE"

for example : Ubuntu 16.10 LTS Debian based system Gnu/Linux

Sim4n6 commented 8 years ago

so I need your opinion first before made the last change :+1: @atarallo

atarallo commented 8 years ago

Hi !!! Thanks for your interest and entusiasm. I was quite busy yesterday, I'll be reading all your comments and suggestions today.

Take into account that this scripts it's also useful outside linux, In a near future I hope to test it on AIX (that i have on hand) maybe on Solaris (with help of a collegue). All that peace of code (that detects kernel an distro) should be improved. It seemed to me that it was contributed from previous work, may need refactoring and testing.

The Upstream distro is not a very relevant info, at least for me. As said before, I will be reading all your comments again prior giving further input.

Sim4n6 commented 8 years ago

Take your time ⌚

atarallo commented 8 years ago

Hi I've been reading back and forth this on the "Operating system Type" LABEL/text.

There, it will be nice to have something like "GNU/Linux (Debian Based)" or "GNU/Linux (RedHat Based)". In the OSSTR string it distracts, at least for me.

Take into account that in the DEVELOPMENT branch I've cleaned up code relevant to this.

Please let me know what do you think.

Sim4n6 commented 8 years ago

why not, "GNU/Linux (Debian Based)" for instance, seems okey.

So you prefer that I pull request in the Development branch. I close the PR #16 and redirect it to the Dev branch.