Monday, June 11, 2012

Shell script in Solaris for disk monitoring and sending an email...

Hi can some one post me a script that calculates the disk space and sends an email alert if it exceed 85% . 

I found some script online but i think it is not for Solaris. I am getting (`usep=$' unexpected) error when i run the script.


Some thing like this 

# put info to file 
df -kl > disk_space 
# mail file 
mailx -s "disk usage" [mail address] < disk_space
Hi, 

or doing some more automation you can start the disk-alarm.sh below in 
the background as: 
disk-alarm.sh 85 & 

the script ( cat disk-alarm.sh ): 
#!/usr/bin/ksh 

0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM