A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

147 Responses

  1. Ariel says:

    Hi. I’m looking at the script and see ‘\E[32m’ before almost every echo string. Should it actually be there? What about support for other os types?

    • Ravi Saive says:


      The updated version of script is available at Github, the link can be found at the bottom of the article, and about compatibility, yes it works on almost all flavors of Linux distributions..

    • @Ariel, those are scape codes that make certain messages appear in color. Making the script work on other UNIXES (*BSD, AIX or Solaris) is not my priority. When I have time I’ll be testing it on AIX, that I have availiable.

  2. Immanuel says:

    Just tested the script. I made the following changes to get in working on Ubuntu and derivatives.

    removed the use of su.

    sudo cp $scriptname /usr/bin/monitor && echo “Congratulations! Script Installed, now run monitor Command” || echo “Installation failed”

    Added virtual hard disk and multiple hard disk.

    df -h| grep ‘Filesystem\|/dev/[s|v]d[a-z]*’ > /tmp/diskusage

    • Ravi Saive says:


      Thanks for making the script compatible for Ubuntu and its derivatives, hope it will help all Ubuntu users…

  3. ex_rat says:

    Hi, i like your script ! :)

    # Check Disk Usages
    df -h| grep ‘Filesystem\|/dev/sda*’ > /tmp/diskusage

    Disk Usages :
    /dev/sda2 439G 71M 417G 1% /home

    i change >>

    df -h| grep ‘Filesystem\|/dev’| sed ‘/tmpfs/d’ > /tmp/diskusage

    Disk Usages :
    /dev/root 20G 661M 18G 4% /
    /dev/sda2 439G 71M 417G 1% /home

    Bye Ex.

  4. Andres Tarallo says:


    I’ve discovered your script a month ago, thanks a former colleague. I’ve executed it on SuSE Enterprise (SLES), with some failures. I’m debugging it and making capable of running on other Linux other than Ubuntu.

    I want to upload the original script to GITHUB, to upload there my contributions. May I count with your blessing to do so?

    • Ravi Saive says:


      Thanks for making the script compatible for all Linux distributions, but make sure you should give credit to Tecmint.

      • Andres Tarallo says:

        I’ll credit Tecmint. It’s not my intention to delete the header or remove references to Tecmint.

        As said before it would be nice to have your blessing to upload the original Script to GITHUB, then I’ll be uploading there my changes.

        Feel free to write me a private message, the original script is great.

      • tushar jambhekar says:

        HI Ravi,

        I’m also using SuSE Enterprise 11 Sp3 & getting many incorrect out-put.Here I’m attaching it:

        OS Name : OS Version : Architecture : x86_64
        Kernel Release : 3.0.76-0.11-default
        Hostname : DC1SAPCSSRT
        hostname: invalid option — ‘I’
        Usage: hostname [-v] {hostname|-F file} set hostname (from file)
        domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
        hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
        hostname [-v] display hostname

        hostname -V|–version|-h|–help print info and exit

        dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

        -s, –short short host name
        -a, –alias alias names
        -i, –ip-address addresses for the hostname
        -f, –fqdn, –long long host name (FQDN)
        -d, –domain DNS domain name
        -y, –yp, –nis NIS/YP domainname
        -F, –file read hostname or NIS domainname from given file

        This command can read or set the hostname or the NIS domainname. You can
        also read the DNS domain or the FQDN (fully qualified domain name).
        Unless you are using bind or NIS for host lookups you can change the
        FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
        part of the FQDN) in the /etc/hosts file.
        Internal IP :
        External IP :
        Name Servers : Before static /etc/sysconfig/network/config NETCONFIG_DNS_STATIC_SEARCHLIST NETCONFIG_DNS_STATIC_SERVERS NETCONFIG_DNS_FORWARDER or NETCONFIG_DNS_POLICY=” See Note: may only, file Please intelenetglobal.com
        Logged In users :
        tushar pts/0 Jul 22 10:35 (
        free: invalid option — ‘h’
        usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
        -b,-k,-m,-g show output in bytes, KB, MB, or GB
        -l show detailed low and high memory statistics
        -o use old format (no -/+buffers/cache line)
        -t display total for RAM + swap
        -s update every [delay] seconds
        -c update [count] times
        -V display version information and exit
        Ram Usages :
        Swap Usages :
        Disk Usages :
        Filesystem Size Used Avail Use% Mounted on
        /dev/sda1 18G 12G 5.1G 70% /
        /dev/sda3 9.9G 1.2G 8.3G 12% /tmp
        /dev/sda5 9.9G 2.5G 6.9G 27% /usr/sap/SRT
        /dev/sda6 5.0G 970M 3.8G 21% /sapmnt/SRT
        /dev/sda7 2.0G 172M 1.7G 9% /usr/sap/hostctrl
        /dev/sda8 9.9G 1.4G 8.0G 15% /usr/sap/trans
        /dev/sda10 1.4T 1.2T 140G 90% /oracle
        /dev/sda9 20G 5.1G 14G 27% /oracle/SRT/112_64
        Load Average : loadaverage:0.24,
        System Uptime Days/(HH:MM) : 21 days

        • Ravi Saive says:


          You just need to change the options available on your Linux distribution in the script to make it compatible with your Linux OS, because every Linux flavor has different options, so just use accordingly..

        • Hi !!!!

          I’ve been working on fixing that Issues on SuSE. I have them working on the script uploaded to github: https://github.com/atarallo/TECMINT_MONITOR/

          The fixes that are specific to SuSE/OpenSuSE are in the Development branch. Please take the script from there, you’re also welcome to contribute code and suggestions.

          • Ravi Saive says:


            Thanks for putting your efforts in making the script compatible with SuSE distribution, I haven’t yet checked the script on SuSE, but will certainly give a try today and see how it works..

          • Ravi Saive says:


            I’ve included the Github link to script in the article, so that users can download and keep further development of script under Tecmint license..

  5. emmanuelbuhay says:

    At first my public ip address wasn’t displaying so i changed ipecho.net to myipaddress.com via vim but still didn’t work, found out i didn’t install curl yet because i did a “curl -s ipecho.net” or was it “curl -s myipaddress.com” and it didn’t recognize curl, since i changed tecmint.sh and forgot the exact syntax in the “curl -s ipecho.net” line, i just re-downloaded it and re-executed it and it finally worked! was happy to see all values, i had fun hahaha thanks and keep the educational contents coming! :)

    • Andres Tarallo says:

      CURL is not mandatory to any distro I’m aware off. It’s very popular so many people think that it’s installed by default.

      I’ll add to the modified script (I’m working actually) to check for CURL availability.

    • I’ve added a check for availiability of CURL, you can find the script on:https://github.com/atarallo/TECMINT_MONITOR/ .Please download the development branch, all bugfixes and contributions are there.

      • Ravi Saive says:


        Thanks a ton for uploading the script to Github and also making the script available for development, will download and test it, if its works perfectly on all Linux distributions, will replace the current script with this new one..

Got something to say? Join the discussion.

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

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?