Need some idea how i can write shell script for below requirement [closed]
Clash 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
shell-script
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.
add a comment |Â
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
shell-script
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
add a comment |Â
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
shell-script
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
shell-script
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
add a comment |Â
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
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Every n seconds:
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.)
Compare the current list with the previous list, for example using
diff
.If there are differences, interpret them and generate the nice e-mails.
Replace the old list with the current list.
add a comment |Â
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:
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.)
Compare the current list with the previous list, for example using
diff
.If there are differences, interpret them and generate the nice e-mails.
Replace the old list with the current list.
add a comment |Â
up vote
1
down vote
Every n seconds:
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.)
Compare the current list with the previous list, for example using
diff
.If there are differences, interpret them and generate the nice e-mails.
Replace the old list with the current list.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Every n seconds:
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.)
Compare the current list with the previous list, for example using
diff
.If there are differences, interpret them and generate the nice e-mails.
Replace the old list with the current list.
Every n seconds:
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.)
Compare the current list with the previous list, for example using
diff
.If there are differences, interpret them and generate the nice e-mails.
Replace the old list with the current list.
answered Jun 14 at 11:38
AlexP
6,596823
6,596823
add a comment |Â
add a comment |Â
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