Sponsored Content
Operating Systems HP-UX Need script to monitor "ALL" Disk Spaces Post 302848729 by krishmaths on Friday 30th of August 2013 12:05:11 AM
Old 08-30-2013
Quote:
Originally Posted by mohtashims
It works for most but does not work for some. Please see my output below.

Code:
/opt/app/optier (/dev/vx/dsk/dgd1grn1m1app1/optier) : 4 100 allocation free
/dev/odm (/dev/odm ) : 100 % free
/etc/vx/cbr/bk (/dev/vg00/cbr ) : 95 % free
/home (/dev/vg00/home ) : 19 % free
/opt/app/d1grn1m1/app1/bea (/dev/vx/dsk/dgd1grn1m1bea/bea) : 31 100 allocation free
/opt/app/d1grn1m1/app1 (/dev/vx/dsk/dgd1grn1m1app1/app1) : 12 100 allocation free
/opt/app/ndm (/dev/vx/dsk/dgd1grn1m1app1/ndm) : 11 100 allocation free
/opt (/dev/vg00/opt ) : 22 % free
/tmp (/dev/vg00/tmp ) : 95 % free
/usr/local/EMC (/dev/vg00/emc ) : 97 % free
/usr/local/opt/introscope (/dev/vx/dsk/dgd1grn1m1intro/introscope) : 10 100 allocation free
/usr/localcw/opt/patrol (/dev/vg00/patrol ) : 68 % free
/usr/localcw (/dev/vg00/localcw ) : 77 % free
/usr (/dev/vg00/usr ) : 33 % free
/var/adm/crash (/dev/vg00/crash ) : 99 % free
/var/adm/sw (/dev/vg00/sw ) : 41 % free
/var (/dev/vg00/var ) : 87 % free
/stand (/dev/vg00/stand ) : 54 % free
/ (/dev/vg00/root ) : 69 % free

The BOLD does not show percentages. Can you please explain and help fix?
When I see the difference between the BOLDed output lines and correct output lines, the difference is that the mount point having a space before ")" gives correct output. The space is important for awk command to interpret positional arguments properly. To fix this, let us insert a blank space before ")" so that the BOLDed output lines get fixed. Please use below command.

Code:
df -k | awk -F":" '/^\//{sub(/)/," )");a=a$1" : ";next} /%/ {a=a$1"\n"} END{print a}' | awk '(NF>0){$5=100-$5; $7="free"; $8=""} 1'

 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

How to remove "New line characters" and "spaces" at a time

Dear friends, following is the output of a script from which I want to remove spaces and new-line characters. Example:- Line1 abcdefghijklmnopqrstuvwxyz Line2 mnopqrstuvwxyzabcdefghijkl Line3 opqrstuvwxyzabcdefdefg Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies

3. Shell Programming and Scripting

script to read a line with spaces bet " " and write to a file

Hi, I need a command in UNIX KSH below is the description... MAPPING DESCRIPTION ="Test Mapping for the calid inputs" ISVALID ="YES" NAME ="m_test_xml" OBJECTVERSION ="1" VERSIONNUMBER ="1" unix ksh command to read the DESCRIPTION and write to a file Test Mapping for the calid inputs... (3 Replies)
Discussion started by: perlamohan
3 Replies

4. Solaris

Help:"Bad checksum in disk label" and "Can't open disk label package"?

Hello, I'm brand new to Sun/Solaris. I have a Sun Blade 150, with SunOS 5.8. I wanted to make a backup to prevent future data loss, so I put the disk in a normal PC with Windows XP to try to make a backup with Norton Ghost, the disk was detected, but not the file volume, so I place the disk... (6 Replies)
Discussion started by: Resadija
6 Replies

5. Shell Programming and Scripting

How to replace "®" "™" "with Spaces in UNIX

do U know how to replace the registered trademark "®" symbol or trade Mark "™" "with Spaces in UNIX (4 Replies)
Discussion started by: MMeari
4 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
VGIMPORTCLONE(8)					      System Manager's Manual						  VGIMPORTCLONE(8)

NAME
vgimportclone - import and rename duplicated volume group (e.g. a hardware snapshot) SYNOPSIS
vgimportclone [-n|--basevgname VolumeGroupName] [-i|--import] PhysicalVolume [PhysicalVolume...] DESCRIPTION
vgimportclone is used to import a duplicated VG (e.g. hardware snapshot). Duplicate VG(s) and PV(s) are not able to be used until they are made to coexist with the origin VG(s) and PV(s). vgimportclone renames the VG associated with the specified PV(s) and changes the associ- ated VG and PV UUIDs. OPTIONS
See lvm(8) for common options. -n, --basevgname VolumeGroupName By default the snapshot VG will be renamed to the original name plus a numeric suffix to avoid duplicate naming (e.g. 'test_vg' would be renamed to 'test_vg1'). This option will override the base VG name that is used for all VG renames. If a VG already exists with the specified name a numeric suffix will be added (like the previous example) to make it unique. -i, --import Import exported Volume Groups. Otherwise VGs that have been exported will not be changed (nor will their associated PVs). ENVIRONMENT VARIABLES
LVM_BINARY The LVM2 binary to use. Defaults to "lvm". Examples The origin VG "vg00" has origin PVs "/dev/sda" and "/dev/sdb" and the respective snapshot PVs are "/dev/sdc" and "/dev/sdd". To rename the VG associated with "/dev/sdc" and "/dev/sdd" from "vg00" to "vg00_snap" (and to change associated VG and PV UUIDs) do: vgimportclone --basevgname vg00_snap /dev/sdc /dev/sdd SEE ALSO
lvm(8), vgrename(8) Red Hat, Inc. LVM TOOLS 2.02.105(2)-RHEL7 (2014-03-26) VGIMPORTCLONE(8)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy