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
PERLOS400(1)						 Perl Programmers Reference Guide					      PERLOS400(1)

NAME
README.os400 - Perl version 5 on OS/400 DESCRIPTION
This document describes various features of IBM's OS/400 operating system that will affect how Perl version 5 (hereafter just Perl) is compiled and/or runs. By far the easiest way to build Perl for OS/400 is to use the PASE (Portable Application Solutions Environment), for more information see http://www.iseries.ibm.com/developer/factory/pase/index.html This environment allows one to use AIX APIs while programming, and it provides a runtime that allows AIX binaries to execute directly on the PowerPC iSeries. Compiling Perl for OS/400 PASE The recommended way to build Perl for the OS/400 PASE is to build the Perl 5 source code (release 5.8.1 or later) under AIX. The trick is to give a special parameter to the Configure shell script when running it on AIX: sh Configure -DPASE ... The default installation directory of Perl under PASE is /QOpenSys/perl. This can be modified if needed with Configure parameter -Dprefix=/some/dir. Starting from OS/400 V5R2 the IBM Visual Age compiler is supported on OS/400 PASE, so it is possible to build Perl natively on OS/400. The easier way, however, is to compile in AIX, as just described. If you don't want to install the compiled Perl in AIX into /QOpenSys (for packaging it before copying it to PASE), you can use a Configure parameter: -Dinstallprefix=/tmp/QOpenSys/perl. This will cause the "make install" to install everything into that directory, while the installed files still think they are (will be) in /QOpenSys/perl. If building natively on PASE, please do the build under the /QOpenSys directory, since Perl is happier when built on a case sensitive filesystem. Installing Perl in OS/400 PASE If you are compiling on AIX, simply do a "make install" on the AIX box. Once the install finishes, tar up the /QOpenSys/perl directory. Transfer the tarball to the OS/400 using FTP with the following commands: > binary > site namefmt 1 > put perl.tar /QOpenSys Once you have it on, simply bring up a PASE shell and extract the tarball. If you are compiling in PASE, then "make install" is the only thing you will need to do. The default path for perl binary is /QOpenSys/perl/bin/perl. You'll want to symlink /QOpenSys/usr/bin/perl to this file so you don't have to modify your path. Using Perl in OS/400 PASE Perl in PASE may be used in the same manner as you would use Perl on AIX. Scripts starting with #!/usr/bin/perl should work if you have /QOpenSys/usr/bin/perl symlinked to your perl binary. This will not work if you've done a setuid/setgid or have environment variable PASE_EXEC_QOPENSYS="N". If you have V5R1, you'll need to get the latest PTFs to have this feature. Scripts starting with #!/QOpenSys/perl/bin/perl should always work. Known Problems When compiling in PASE, there is no "oslevel" command. Therefore, you may want to create a script called "oslevel" that echoes the level of AIX that your version of PASE runtime supports. If you're unsure, consult your documentation or use "4.3.3.0". If you have test cases that fail, check for the existence of spool files. The test case may be trying to use a syscall that is not implemented in PASE. To avoid the SIGILL, try setting the PASE_SYSCALL_NOSIGILL environment variable or have a handler for the SIGILL. If you can compile programs for PASE, run the config script and edit config.sh when it gives you the option. If you want to remove fchdir(), which isn't implement in V5R1, simply change the line that says: d_fchdir='define' to d_fchdir='undef' and then compile Perl. The places where fchdir() is used have alternatives for systems that do not have fchdir() available. Perl on ILE There exists a port of Perl to the ILE environment. This port, however, is based quite an old release of Perl, Perl 5.00502 (August 1998). (As of July 2002 the latest release of Perl is 5.8.0, and even 5.6.1 has been out since April 2001.) If you need to run Perl on ILE, though, you may need this older port: http://www.cpan.org/ports/#os400 Note that any Perl release later than 5.00502 has not been ported to ILE. If you need to use Perl in the ILE environment, you may want to consider using Qp2RunPase() to call the PASE version of Perl. AUTHORS
Jarkko Hietaniemi <jhi@iki.fi> Bryan Logan <bryanlog@us.ibm.com> David Larson <larson1@us.ibm.com> perl v5.12.5 2012-11-03 PERLOS400(1)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy