Need some idea how i can write shell script for below requirement [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-2
down vote

favorite












Write a bash script for below :



We have a requirement to monitor and the track the changes of all the mounts points on linux server. If there are any changes on mount point, these should get alerted to IT team via email. Also, the script should be able to provide the space utilization of the respective mount point where there is an issue.
i.e example alert :
1. Changes detected on mount point /mnt/app1, it is newly added mount point with current usage of 90 GB out of allocated 200GB
1. Changes detected on mount point /mnt/app0, it was mounted earlier however it is not mounted now







share|improve this question











closed as too broad by Jeff Schaller, G-Man, Rui F Ribeiro, Thomas, agc Jun 18 at 3:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
    – Rui F Ribeiro
    Jun 14 at 17:59














up vote
-2
down vote

favorite












Write a bash script for below :



We have a requirement to monitor and the track the changes of all the mounts points on linux server. If there are any changes on mount point, these should get alerted to IT team via email. Also, the script should be able to provide the space utilization of the respective mount point where there is an issue.
i.e example alert :
1. Changes detected on mount point /mnt/app1, it is newly added mount point with current usage of 90 GB out of allocated 200GB
1. Changes detected on mount point /mnt/app0, it was mounted earlier however it is not mounted now







share|improve this question











closed as too broad by Jeff Schaller, G-Man, Rui F Ribeiro, Thomas, agc Jun 18 at 3:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
    – Rui F Ribeiro
    Jun 14 at 17:59












up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











Write a bash script for below :



We have a requirement to monitor and the track the changes of all the mounts points on linux server. If there are any changes on mount point, these should get alerted to IT team via email. Also, the script should be able to provide the space utilization of the respective mount point where there is an issue.
i.e example alert :
1. Changes detected on mount point /mnt/app1, it is newly added mount point with current usage of 90 GB out of allocated 200GB
1. Changes detected on mount point /mnt/app0, it was mounted earlier however it is not mounted now







share|improve this question











Write a bash script for below :



We have a requirement to monitor and the track the changes of all the mounts points on linux server. If there are any changes on mount point, these should get alerted to IT team via email. Also, the script should be able to provide the space utilization of the respective mount point where there is an issue.
i.e example alert :
1. Changes detected on mount point /mnt/app1, it is newly added mount point with current usage of 90 GB out of allocated 200GB
1. Changes detected on mount point /mnt/app0, it was mounted earlier however it is not mounted now









share|improve this question










share|improve this question




share|improve this question









asked Jun 14 at 11:12









Lakshmi

1




1




closed as too broad by Jeff Schaller, G-Man, Rui F Ribeiro, Thomas, agc Jun 18 at 3:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by Jeff Schaller, G-Man, Rui F Ribeiro, Thomas, agc Jun 18 at 3:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
    – Rui F Ribeiro
    Jun 14 at 17:59
















  • This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
    – Rui F Ribeiro
    Jun 14 at 17:59















This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
– Rui F Ribeiro
Jun 14 at 17:59




This is a Unix group, not order-my-script site. Please detail what you have done and what can we explain to you.
– Rui F Ribeiro
Jun 14 at 17:59










1 Answer
1






active

oldest

votes

















up vote
1
down vote













Every n seconds:




  1. Make a list of mounted mount points with their disk usage:



    LC_ALL=C df -h $(
    LC_ALL=C mount |
    grep '^/S+ on S+' |
    sed -Ee 's/^S+s+ons+(S+).*/1/'
    ) | tail -n +2


    (Don't use the example code in production as is; you will of course want to sanitize the list of mounted mount points.)



  2. Compare the current list with the previous list, for example using diff.


  3. If there are differences, interpret them and generate the nice e-mails.


  4. Replace the old list with the current list.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Every n seconds:




    1. Make a list of mounted mount points with their disk usage:



      LC_ALL=C df -h $(
      LC_ALL=C mount |
      grep '^/S+ on S+' |
      sed -Ee 's/^S+s+ons+(S+).*/1/'
      ) | tail -n +2


      (Don't use the example code in production as is; you will of course want to sanitize the list of mounted mount points.)



    2. Compare the current list with the previous list, for example using diff.


    3. If there are differences, interpret them and generate the nice e-mails.


    4. Replace the old list with the current list.






    share|improve this answer

























      up vote
      1
      down vote













      Every n seconds:




      1. Make a list of mounted mount points with their disk usage:



        LC_ALL=C df -h $(
        LC_ALL=C mount |
        grep '^/S+ on S+' |
        sed -Ee 's/^S+s+ons+(S+).*/1/'
        ) | tail -n +2


        (Don't use the example code in production as is; you will of course want to sanitize the list of mounted mount points.)



      2. Compare the current list with the previous list, for example using diff.


      3. If there are differences, interpret them and generate the nice e-mails.


      4. Replace the old list with the current list.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        Every n seconds:




        1. Make a list of mounted mount points with their disk usage:



          LC_ALL=C df -h $(
          LC_ALL=C mount |
          grep '^/S+ on S+' |
          sed -Ee 's/^S+s+ons+(S+).*/1/'
          ) | tail -n +2


          (Don't use the example code in production as is; you will of course want to sanitize the list of mounted mount points.)



        2. Compare the current list with the previous list, for example using diff.


        3. If there are differences, interpret them and generate the nice e-mails.


        4. Replace the old list with the current list.






        share|improve this answer













        Every n seconds:




        1. Make a list of mounted mount points with their disk usage:



          LC_ALL=C df -h $(
          LC_ALL=C mount |
          grep '^/S+ on S+' |
          sed -Ee 's/^S+s+ons+(S+).*/1/'
          ) | tail -n +2


          (Don't use the example code in production as is; you will of course want to sanitize the list of mounted mount points.)



        2. Compare the current list with the previous list, for example using diff.


        3. If there are differences, interpret them and generate the nice e-mails.


        4. Replace the old list with the current list.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jun 14 at 11:38









        AlexP

        6,596823




        6,596823












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?