Hi all,
I have to monitor disk space for the datastage projects on development and production on unix servers daily, I am generally using the commands to monitor disk space, but just to make the job easier I am just thinking of a shell script that would automatically generate a mail to me every 3 or 4 hours.
that how much disk space has been used?
Can anyone of you please suggest a shell script?
Thanks in advance
send mail through shell script
Moderators: chulett, rschirm, roy
You can write a script to find the free space using
Send a mail with mailx
You can schedule your script using cron or other scheduling tools, every 3 or 4 hours or whatever frequency you want.
Code: Select all
df -k . | grep -v used | awk '{ print $2 " " $3 " " $4 " " $5 }'
You can schedule your script using cron or other scheduling tools, every 3 or 4 hours or whatever frequency you want.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
Re: send mail through shell script
There is no pre-written shell script per se. But you can build your own as narasimha advised. A shell is nothing but unix commands bundled up on a file. Read about mailx, coupled that with whatever command you are using for checking disk space, viola, you have a shell script.satisht wrote:
Can anyone of you please suggest a shell script?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Are you sure you have to monitor it? Most businesses will already have such monitoring in place and I've found you typically just need to let them know to include DataStage in that process. Check here every X and alarm when usage hits Y percent. Have you contacted your SAs and asked them? ![Confused :?](./images/smilies/icon_confused.gif)
Our 'DataStage' partition, for example, is checked every 15 minutes... in 3 or 4 hours the damage is more than likely already done.
![Confused :?](./images/smilies/icon_confused.gif)
Our 'DataStage' partition, for example, is checked every 15 minutes... in 3 or 4 hours the damage is more than likely already done.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers