Sponsored Content
Top Forums Shell Programming and Scripting Error while executing disk space script in AIX Post 302520313 by rajeshw61 on Friday 6th of May 2011 11:46:27 AM
Old 05-06-2011
Error while executing disk space script in AIX

Code:
#!/bin/ksh for AIX

used=0
mount=${1:-"/mountpoint"}
threshold=${2:-80}
#message="hello"
#SUBJECT="Disk Space Alert"
#EMAIL="xyz@abcinc.com"
used=`df -k $mount | grep % | awk '{print $5}' | sed 's/%//g'`

#echo "Free Space available under \"$mount\" is `expr 100 - $used`%.\n">$message

if [ $used -ge $threshold ]; # at this point am getting error#
then
echo "Space Utilization on \"$mount\" has exceeded the threshhold of ${threshold}%.\n" | mail -s "Disk Space Alert" xyz@abcinc.com

#/bin/mail -s "$SUBJECT" "$EMAIL" < $message
fi


*at if operator it gives "./disk.sh[14]: 180533: unknown test operator" error

can any one help guys ,thanks in advance.

Last edited by Franklin52; 05-07-2011 at 09:19 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[AIX] executing script

Hello! I need to run a script from the root user as the other user. I know that I can issue the following command: su - user_name -c "/path_to_script/script_name.sh" But there is a small problem with the above command. I must export a environment variable before I run the script. In the... (1 Reply)
Discussion started by: piooooter
1 Replies

2. AIX

Disk space error.

Dear All, I am working on AIX 5.2, and I have allocated 3072M disk space to /home filesystem. Now system has no free space at /home filesystem. But when I checked data on /home, I have only 900M data. Please if anybody can tell me about this difference and how this can be resolved. Thank You.... (9 Replies)
Discussion started by: system-admin
9 Replies

3. Shell Programming and Scripting

Disk space script

Hi all, Can any one help me in making a disk space script in solaris 8/9 for instance i only want to get those partitions whose diskspace has exceed 70%. Any volunteer? Cheers! BR/asad (8 Replies)
Discussion started by: asadlone
8 Replies

4. Shell Programming and Scripting

Script for Disk space

:( Hi All, i have 4 linux server for which i want set up script to monitor the disk space ... here my problem is i want the output like graph... also it should reflect in monitor ...as non stop process.. can any one suggest me any way where i can implement the script? ... (3 Replies)
Discussion started by: Shahul
3 Replies

5. AIX

AIX Free disk space

Hello, I would like to free some space to install gcc with is about 50M large, and I have no free space on my system. What can I delete? Filesystem 1024-blocks Used Free %Used Iused Ifree %Iused Mounted on /dev/hd4 262144 145436 116708 56% 7981 ... (10 Replies)
Discussion started by: aixn00b
10 Replies

6. AIX

Determine disk space in AIX

Hi I need to extend a FS in AIX but Im not sure on how to calculate the free space Please advise if my math is correct: -------PP SIZE: 64 megabyte(s) --------TOTAL PPs: 1086 (69504 megabytes) so the total size of volume is 64 * 1086 = 69504 MB (695GB) Free PP is-- FREE... (4 Replies)
Discussion started by: hedkandi
4 Replies

7. Shell Programming and Scripting

disk space utilization script

Hi, I wrote the following script for monitoring disk space and inform the concerned team accordingly. But script gives me below error syntax error at line 70 : `<' unmatched #!/bin/ksh . /home/scr/.profile . /home/scr/.infa_env # Get the list of Integration Services ... (6 Replies)
Discussion started by: svajhala
6 Replies

8. AIX

Error while executing command in aix box

Hi Folks I get the below error in my aix box. Im not sure if this is an AIX issue or a TWS issue. Please advice me cbspsdb01:/opt/TWS/bin # ./conman status exec(): 0509-036 Cannot load program ./conman because of the following errors: 0509-150 Dependent module... (6 Replies)
Discussion started by: newtoaixos
6 Replies

9. Red Hat

Subject: value out of range error on a disk with free 40 GB space

Hi, I installed RHEL 6.0 OS on vmware with CREATE CUSTOM LAYOUT option. And I gave the space to different mount points as mentioned below: / 15360MB /boot 200MB /tmp 3072 MB swap 1024 MB fdisk -cul command shows the disk size as 64.4 GB. But when I try to create partion of 10 GB with... (1 Reply)
Discussion started by: GAURAV SRIVASTA
1 Replies

10. UNIX for Beginners Questions & Answers

Disk space script

i have 3 servers and i am checking for the disk space of a specific mount-point, should not be more than 85 % considering example as below server1 mountpoint_1 has 70% diskutilization server2 mountpoint_1 has 80% diskutilization server3 mountpoint_1 has 7% diskutilization now when it... (6 Replies)
Discussion started by: abhaydas
6 Replies
HALEVT-MOUNT(1) 					      General Commands Manual						   HALEVT-MOUNT(1)

NAME
halevt-mount/halevt-umount - Mount or umount device through HAL SYNOPSIS
halevt-mount [options] [-w] mountpoint|device|udi halevt-mount [options] <-c | -r> <-a | mountpoint | device | udi> halevt-mount [options] <-l | -s> halevt-umount [options] < -a | mountpoint | device | udi> DESCRIPTION
halevt-mount Mount or umount device through HAL and keep a track of devices handled. When called as halevt-umount the default is to unmount, when called as halevt-mount the default is to mount. Option -c, -l, -r, -s or -w changes the operation performed. Additional argument is considered to be a mount point, a device or an udi when unmounting or removing. If the commands are not called with -s after changes in the state of the devices (after mounting, unmounting, removing devices), the infor- mation available for halevt-mount and halevt-umount may become out of sync with the state of the system. When run as user halevt (or as root), no uid= argument is passed to HAL when mounting, otherwise this option is passed, if the filesystem allows it. OPTIONS
-a When listing, list all the existing devices. For the other operations, perform the operation on all the handled devices. -c Remove the handled device. -d device Use device device. -f file Use file file to store information about the handled devices instead of the default. -h Help message and options summary. -i directory Use lock file and device information file in the directory directory (if they are not already specified). -l List handled devices. Formatted with, on each line, udi:device:mountpoint. -p mountpoint Use mountpoint mountpoint. -m umask Set mount umask to umask if run as a system user, and the filesystem supports it. -n file Use file file as lock file. -o option Add the option option to the mount call. -r Umount. -s Sync the information about the handled devices with the informations known by HAL. -u udi Use udi udi. -w Add to the handled devices. SEE ALSO
halevt(1), gnome-mount(1), pmount(1) VERSION
This is halevt-mount version 0.1.6.2. AUTHOR
Main author is Patrice Dumas pertusus at free dot fr. AVAILABILITY
The latest version of this program can be found at: http://www.nongnu.org/halevt/ COPYRIGHT
Copyright (C) 2007-2008 Patrice Dumas <pertusus at free dot fr>, There is NO warranty. You may redistribute this software under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. For more information about these matters, see the file named COPYING. 7th Edition HALEVT-MOUNT(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy