Sponsored Content
Full Discussion: Monitor Disk Space
Top Forums Shell Programming and Scripting Monitor Disk Space Post 302165762 by vivsiv on Friday 8th of February 2008 05:56:58 PM
Old 02-08-2008
here's a script

#!/bin/ksh
TEMPDIR=$HOME
FILE=mail.log
sendemail=-1
HOSTNAME="vivek" ###ur unix server name
space=`df -bhk /users/directory |awk '{print$5}'` ## dir were u want to monitor
echo "$space is the file size percent"
#capacity=${space%?}
#capacity=$space|/usr/xpg4/bin/awk -F"[%]" '{ print $1}'
capacity=`df -bhk /users/directory| grep directory |awk '{print $5}'|sed 's/\%//'`

echo "capacity in $HOSTNAME is $capacity " >> $TEMPDIR/$FILE
if [ $capacity -gt 90 ]; then
echo "alert space in $HOSTNAME getting full "
echo > $TEMPDIR/$FILE
echo "*************************************************" >> $TEMPDIR/$FILE
echo "Problem with siebel disk space on $HOSTNAME" >> $TEMPDIR/$FILE
/usr/bin/mailx -s "ALERT: Problem with file space on $HOSTNAME " "vivek@unix.com" < $TEMPDIR/$FILE
else
echo "enough space available"
fi
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

paging space & monitor

Hi folks, Lately my RS 6000 server is giving some problems. Needs a reboot from time to time (4-8 days):mad: Specs: IBM/RS6000 Unix 4.3 3 gigabyte memory I keep getting messages like : " The fork function failed " I have raised the paging space from 1 gigabyte to 3 gigabyte,... (2 Replies)
Discussion started by: Erik Rooijmans
2 Replies

2. Shell Programming and Scripting

Automatic monitor disk-space

Hello, I am trying to find a shell script to monitor diskspace. When the script encounteres a disk which above the treashold, I want an email notification. My system runs on a Sun Solaris. Is there anybode around who can help me with such a script? Norbert (3 Replies)
Discussion started by: nfbeerse
3 Replies

3. Filesystems, Disks and Memory

Automatic monitor disk-space

Hello, I am trying to find a shell script to monitor diskspace of all the directories in the server. When the script encounteres a disk which above the treashold, I want an email notification. My system runs on AIX. Is there anybody around who can help me with such a script? ... (3 Replies)
Discussion started by: anuradha
3 Replies

4. Shell Programming and Scripting

Shell script partitions space monitor

Hello friends, I'm newbie in shell scripting... Until now i have this script: #!/bin/sh emailok = email1@domain.com emailissue = email2@domain.com limit="50" df -h | grep -vE '^Filesystem' | awk '{print $1 " " $4 " " $5}'|while read val do partition=$(echo $val | awk '{print... (9 Replies)
Discussion started by: john_doe
9 Replies

5. Shell Programming and Scripting

script to monitor disk space usage

Some times my disk space is used upto 100% due to the application logs . So this script is to monitor the disk space usage and wall message to the users about the disk space usage if it exceeds the limit set in the script. Here for example the limit is set to 80%. This job is added in cron to... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. Shell Programming and Scripting

need help for scrip to monitor disk utilization

Hi, I need help to write a script which will monitor disk utilization. Please suggest the best approach to achive this. I am thinking of having sleep inside the script which will run for(eg.) 60 secs and then disk utilization will be checked and depends on the % usage of disk mail will... (1 Reply)
Discussion started by: sunilmenhdiratt
1 Replies

7. Infrastructure Monitoring

Using SNMP to monitor remote processes and disk space

snmpget -v 1 -c COMMUNITYSTR hostname OID what OIDs would I use to get information on all the processes and disk space information that are on a particular host. where can i find out information on all of this? thanks (3 Replies)
Discussion started by: SkySmart
3 Replies

8. Programming

Disk Monitor

#!/usr/bin/perl use strict; use warnings; use Filesys::DiskSpace; # file system to monitor my $dir = "/opt"; # warning level my $warning_level=10; # email setup my $to='mail@mail.com'; my $subject='Low Disk Space'; # get df my ($fs_type, $fs_desc, $used, $avail, $fused,... (1 Reply)
Discussion started by: sdhn1900
1 Replies

9. UNIX for Dummies Questions & Answers

how to monitor swap space paging activity?

hi guys My tivoli monitoring tools is reporting the monitor parameters says Pages Paged out is too high 1600 so it is a critical warning (threshold 400) now according to them this usually happens at dawn so is there a way to monitor this? during the time I am not working? ans something... (1 Reply)
Discussion started by: karlochacon
1 Replies

10. Shell Programming and Scripting

Script to monitor the disk space details in HP-UX

Hi, I need to monitor the disk space details in HP-UX . I need a command on how to display the information on below format File System Total_Space_KB Used_Space_KB Available_Space_KB %Used /u05 524288000 376235344 138799427 73% /u02 ... (0 Replies)
Discussion started by: ali560045
0 Replies
vrb_capacity(3) 					      VRB Programmer's Manual						   vrb_capacity(3)

NAME
vrb_capacity - return the buffer capacity LIBRARY
-lvrb SYNOPSIS
#include <vrb.h> size_t vrb_capacity(vrb_p vrb); DESCRIPTION
vrb_capacity returns the total buffer capacity (after any rounding up during initialization) of the given virtual ring buffer. ARGUMENTS
vrb_p vrb specifies the virtual ring buffer to obtain the capacity of. If a NULL or invalid pointer is given, results are unpredictable and are likely to be disasterous. RETURN VALUE
size_t The total capacity of the virtual ring buffer is returned. SEE ALSO
vrb(3), vrb_data_len(3), vrb_data_ptr(3), vrb_destroy(3), vrb_get(3), vrb_get_min(3), vrb_give(3), vrb_init(3), vrb_init_opt(3), vrb_is_empty(3), vrb_is_full(3), vrb_is_not_empty(3), vrb_is_not_full(3), vrb_move(3), vrb_new(3), vrb_new_opt(3), vrb_put(3), vrb_put_all(3), vrb_read(3), vrb_read_min(3), vrb_resize(3), vrb_space_len(3), vrb_space_ptr(3), vrb_take(3), vrb_uninit(3), vrb_write(3), vrb_write_min(3) vrb 2002-09-30 vrb_capacity(3)
All times are GMT -4. The time now is 06:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy