Script that shows information from our system

When you have servers, automating tasks is always useful, it saves us time and also helps with fault tolerance, you know… «do such a thing in case of low ram » ... "restart such service if such socket fails»... etc, the detail is that to automate tasks, the first thing is to know the current status of the server.

Script to display information from our system

I had told you about a script which was showing Apache RAM consumption statistics, this time I will tell you about a script that displays this information:

  • Is or is not connected to the internet
  • Operating system
  • Distro
  • Architecture
  • Kernel
  • Hostname
  • Internal IP
  • External IP
  • DNS you use
  • Logged users
  • RAM and SWAP statistics
  • HDD space
  • Time it took for the script to display the information
  • Uptime

How to obtain Script that shows information from our system

The first thing is to download it, then give it execution permissions, finally we execute it with the -I parameter so that it is installed in our system and it is easier to execute it in the future. Open a terminal and put the following commands:

wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh chmod + x tecmint_monitor.sh ./tecmint_monitor.sh -I

It will ask us for the password, we type it, press Enter and that's it, we can see the information of our system by executing:

monitor

Examples of information provided by the Script:

monitor-script-screenshot

As you can see in the commands, the author of the script is TecMint.com, thanks Avishek Kumar for post it.

Well I hope nothing will be useful to you 😉


28 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Aurelio janeiro said

    Hey.

    I followed the steps described and when I wrote ./tecmint_monitor.sh -I it tells me that the option is invalid… The message is ./tecmint_monitor.sh: illegal option - I

    Can you help me?

    regards

    1.    Edgar perez said

      It is lowercase i.

    2.    Jose Miguel Folgueira said

      The parameter is an i-latin, not an ele 🙂

      Anyway, the script fails me because of the line containing "su -c", since in Ubuntu sudo is used to obtain root permissions.

      1.    pepper said

        and what happens that the «sudo su -« does not work

    3.    KZKG ^ Gaara said

      Edit the file (sudo nano / usr / bin / monitor) and on line 75 it says "hostname -I" ... remove the -I and you're done

    4.    Javier Espinoza said

      try this way
      ./tecmint_monitor.sh -i

    5.    Jose Miguel Folgueira said

      Anyway, if you run the script without parameters, it gives you the corresponding information. What it does internally is copy the script "tecmint_monitor.sh" in / usr / bin / with name "monitor" (with execution permissions).

  2.   brito9112 said

    i put it on a ubuntu server 12.04 and i get this error

    Downloads / tecmint_monitor.sh: 26: Downloads / tecmint_monitor.sh: [[: not found
    Downloads / tecmint_monitor.sh: 36: Downloads / tecmint_monitor.sh: [[: not found
    Downloads / tecmint_monitor.sh: 43: Downloads / tecmint_monitor.sh: [[: not found

    I have execution permissions and I put the parameter -I, what could be the cause of the problem?

  3.   NedHard said

    Interesting Post, a good way to automate requests for information, while saving time that can be used on other issues.
    off topic: @ KZKG ^ Gaara, can you please reply to the emails, which is not that complicated.
    GREETINGS

    1.    KZKG ^ Gaara said

      What emails? 😀

      1.    Diaz said

        great article.

        but as I find myself?

        wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh
        chmod + x tecmint_monitor.sh
        ./tecmint_monitor.sh -I

        I'm not going ..

      2.    NedHard said

        The two that I sent you a few weeks ago did not bounce back, so the email you gave me in FLISOL is correct ...

      3.    KZKG ^ Gaara said

        Write me again to see 0_oU

      4.    NedHard said

        Check to see if it arrived

  4.   Ruben Cotera said

    Great!! It's great, although it could be supplemented with extra information. Although yes, it is easy to customize. Thanks for sharing!

  5.   Leandro said

    A very useful tool that is also used to monitor services and resources, in addition to being able to set actions based on things, as well as sending alerts for example is monit:

    https://mmonit.com/monit/

  6.   eliotime3000 said

    SHUT UP AND TAKE MY FIRE KEY!

  7.   NaM3leSS said

    http://pastebin.com/uKRsrPvZ

    in case it is more understandable 😉
    regards

  8.   koratsuki said

    apt-get install inxi
    run in console:

    inxi-Fxz

    And ready…

  9.   wake up said

    the "./tecmint_monitor.sh -I" gives me an error, I changed it to lowercase as @Edgar Pérez said but then "monitor" appears as an unknown command: /
    What am I doing wrong? u__ú

    1.    lesco said

      It seems that it is incorrectly installed. I have Debian, but I have sudo configured as in Ubuntu, that is, I do not have a password assigned to the root user and, therefore, I do not have the password that I am asked to enter during installation. If I enter my username, the installation fails, because it is not the root password. This worked for me:

      chmod + x tecmint_monitor.sh
      sudo su
      ./tecmint_monitor.sh -i

      Thus it was effectively installed. Then just run in any terminal: monitor

  10.   Katekyo said

    mmm ... it will be time to try it

  11.   lesco said

    The script is good, but in the RAM memory used it marks a not very credible value. When in any system monitor I see that I have used 370 MB, this script indicates that it is 991 MB (?).

  12.   brutal said

    The script is fine but with inxi it shows you more data.

  13.   JoRgE-1987 said

    Excellent!!

    It is perfect for me to stop pulling the commands one by one in the console when I have to perform an administration task. 🙂

    Too bad it is not on GitHub to be able to forge it and be able to work on the script more comfortably.

    Regards!

  14.   viddeveloper said

    Deluxe.

    Thanks for sharing.

    Regards!

  15.   stalker said

    this is fine, although not quite