Sponsored Content
Operating Systems HP-UX Need script to monitor "ALL" Disk Spaces Post 302848361 by RavinderSingh13 on Thursday 29th of August 2013 05:26:19 AM
Old 08-29-2013
Hello,

Could you please use the following code with
Code:
 awk

.
I am in AIX server but you can use
Code:
 awk

to find out only free space. Here is an example for same.


Code:
$ df -kP | awk '{print$3}'

Output will be as follows.
Code:
 
Used
112736
4233904
193776
35380




Thanks,
R. Singh
 

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
vxchg_rootid(1M)														  vxchg_rootid(1M)

NAME
vxchg_rootid - set up VxVM root disk that has been cloned or copied from another operational VxVM root disk SYNOPSIS
/etc/vx/bin/vxchg_rootid [-g new_dg] [-N] [-R] [-S] [-s script_path] [-v] new_host_name new_root_da DESCRIPTION
The vxchg_rootid command sets up a VxVM root disk that has been freshly cloned by using the dd command, or by using a hardware-based proce- dure such as EMC Symmetrix BCV cloning. The disk ID and disk group ID fields in the private region header and the configuration records are changed from their cloned values to ensure that they are unique. The new host name is written to the host ID fields of the private region header and to the /etc/vx/volboot file. Script files in /etc, /usr and /var, that contain hard-coded host name values, are modified to use the new host name (new_host_name). If no options are specified, values in the /etc/rc.config.d/netconf file are initialized such that when the new root disk is first booted, the "set_parms initial" dialog menu is displayed. This allows you to enter the system host name and network parameters manually. OPTIONS
-g new_dg Specifies the name of the disk group for the new root disk. If this option is not used, the new root disk remains in the same disk group as the source disk. -N Provides a method of updating a current host for a new release of the HP-UX operating system. The command attempts to use NFS to mount the root directory of the current root disk from which new_host_name was booted. This assumes that the specified host already exists and is accessible over the network. The root directory is temporarily mounted using the new_host_name:/ syntax. For this to work, the /etc/exports file on the target system must have been edited to contain an entry for /, and the exportfs command must have been run to give root permission to the host on which the vxchg_rootid command is to be invoked. When the old root file system has been mounted, and the freshly cloned root file system has also been temporarily imported and mounted, system-specific files are copied from the old to the new root file system. The files that are copied include: /etc/exports /etc/fstab /etc/hosts /etc/lvmtab /etc/passwd /etc/rc.config.d/netconf /etc/resolv.conf /etc/vx/elm/* /etc/vx/licenses/* -R Provides a method of obtaining and updating machine-specific information on a remote target host. When the new disk ID and disk group ID fields have been changed on the cloned disk, the command uses remsh to execute appropriate commands to find the new root disk as it is enumerated on the remote host. Once a match has been found, the name and hardware path of the new disk as it exists on the remote host are extracted. The disk name information is used to update the /stand/bootconf file with the correct value. The hardware path information is used with the setboot command to set the boot device in the target host's NVRAM. The criteria for making the setboot changes are as follows: o If the -v option was specified, the current primary and alternate boot device values are displayed. o The hardware path of the new root on the remote host is set as the primary boot path. o The hardware path of the current primary boot device is set as the alternate boot path. As successful operation of remsh depends on having permission to access the remote host, vxchg_rootid executes a simple remsh command to test this before any configuration changes have been made. An entry for the host name of the maintenance server and the user run- ning the command (such as root) must exist in the /.rhosts file on the remote host. See the hosts.equiv(4) manual page for further information. -S Starts an interactive Bourne shell when the new root file system has been temporarily mounted. This allows manual changes to be made to the configuration before it is booted on the new host. When the changes have been completed, exit the shell to allow the vxchg_rootid command to continue to completion. Immediately before starting the shell, a message is output to indicate the mount point of the temporarily mounted new root file system. -s script_path Runs the specified shell script after the new root file system has been temporarily mounted. This allows you to make any automated changes to the configuration files that are required. When the script exits, the vxchg_rootid command continues to completion if a 0 exit status is received, or aborts if a non-zero exit status is received. If any command arguments are required to the script, place script_path and its arguments in quotes. To allow operational control from the invoked shell script, the new host name and the temporary mount point of the new root file sys- tem are passed to the script as the last two arguments. Thus, the calling sequence for the invoked shell script is: user_script script_arguments host_name mount_point For example, the calling sequence for the script, patch_db, which takes the internal arguments db_path and token would be: patch_db db_path token newhost temp_mount -v Outputs verbose messages, including a time stamp, which indicates the major operations that are being performed. ARGUMENTS
new_host_name The host name of that target machine that is to inherit the newly cloned disk as its root disk when accessed via a SAN boot. new_root_da The disk access name (CTD name) of the freshly cloned root. NOTES
The order in which any optional operations are completed is important as it may determine what can be accomplished in a script, or what must be done manually. This is the order of operations that are performed by vxchg_rootid: 1. Perform sanity checks on the arguments and options specified. These checks include: o Check that Veritas Volume Manager is running. o If the -s option was specified, check that the specified script_path exists. o Check that the new_root_da argument refers to a real disk. o Check that the disk group name on the freshly cloned disk is rootdg. o Check that the rootdg disk group contains one disk. 2. If the -N option was specified, attempt to mount the current root file system over NFS. If the target host does not grant access, the mount is unsuccessful and the vxchg_rootid command exits without performing any configuration operations. 3. The main operations of the vxchg_rootid command are accomplished up to the unmounting of the file systems on the new root. These operations include: o Patching the private region to provide unique disk ID and disk group ID values. o Temporarily importing the new root disk clone, running fsck, and temporarily mounting the new root file system and all file systems under it. o Initializing values in the /etc/rc.config.d/netconf file on the new root file system. o Patching the new host ID into the /etc/vx/volboot file on the new root file system. o Updating the /stand/bootconf file with the appropriate disk name. o Updating the host name value in files in the /etc, /usr and /var directories. 4. If the -N option was specified, system-specific files (listed in the DESCRIPTION section) are copied from the old to the new root file system. 5. If the -s option was specified, the script file is executed. 6. If the -S option was specified, start an interactive Bourne shell. This allows the contents of the new root file system and all of its subordinate file systems to be inspected, and any required manual operations to be performed. When the shell exits, the vxchg_rootid command runs to completion. 7. All temporarily mounted file systems are unmounted. 8. The new root disk clone is deported. 9. The host ID value in the new root disk clone's private region is patched with the specified value. 10. The vxchg_rootid command exits. When the vxchg_rootid command is executed, messages similar to the following may be displayed on the system console: vxvm:vxconfigd: WARNING: Group rootdg: Duplicate virtual device number(s): Volume standvol remapped from 2,5 to 2,8388607 Volume swapvol remapped from 2,1 to 2,8388606 Volume rootvol remapped from 2,0 to 2,8388605 Volume tmpvol remapped from 2,6 to 2,8388604 Volume homevol remapped from 2,7 to 2,8388603 Volume optvol remapped from 2,8 to 2,8388602 Volume usrvol remapped from 2,9 to 2,8388601 Volume varvol remapped from 2,10 to 2,8388600 These messages are the normal consequence of temporarily importing the cloned rootdg disk group and starting its volumes. The minor device numbers of the indicated volumes are changed, but only for the period that they are temporarily imported. EXAMPLES
This example shows the vxchg_rootid command being invoked in its simpliest form: /etc/vx/bin/vxchg_rootid new_host c5t12d0 The next example shows the vxchg_rootid command being invoked with the -s option. Note that quoted script arguments are also specified. In this case, the test_script script echoes each of the four arguments: vxchg_rootid -s "/test_script arg1 arg2" furnace c5t12d0 test_script: Args are arg1 arg2 furnace /tmp/tmpmnt1.6523 The next example is similar to the one above, except that the -N, -R and -v options are also specified. (The time stamp is usually placed on the line as each message, but this output has been edited for clarity.) # cd /etc/vx/bin # ./vxchg_rootid -RNvs "/test_script arg1 arg2" hpilb09 c8t4d4 vxchg_rootid 16:29: Checking configuration of cloned disk and disk group vxchg_rootid 16:29: Mounting hpilb09:/ on /tmp/tmpmnt2.6376 vxchg_rootid 16:29: Checking remsh remote access vxchg_rootid 16:29: Patching disk ID and disk group ID values on disk c8t4d4 vxchg_rootid 16:29: Rescanning the configuration vxchg_rootid 16:29: Temporarily importing new root as rootdg.6376 disk group vxchg_rootid 16:29: Checking & mounting root FS on /tmp/tmpmnt1.6376 vxchg_rootid 16:29: Checking & mounting stand FS on /tmp/tmpmnt1.6376/stand vxchg_rootid 16:29: Checking & mounting opt FS on /tmp/tmpmnt1.6376/opt vxchg_rootid 16:29: Checking & mounting tmp FS on /tmp/tmpmnt1.6376/tmp vxchg_rootid 16:29: Checking & mounting var FS on /tmp/tmpmnt1.6376/var vxchg_rootid 16:29: Checking & mounting home FS on /tmp/tmpmnt1.6376/home vxchg_rootid 16:29: Checking & mounting usr FS on /tmp/tmpmnt1.6376/usr vxchg_rootid 16:29: Initializing netconf & Veritas license files. vxchg_rootid 16:29: Setting host name into volboot and other selected files. vxchg_rootid 16:29: Copying selected files from NFS mounted host. vxchg_rootid 16:29: Finding cloned root on remote host hpilb09 vxchg_rootid 16:29: Disk c8t4d4 will appear as c7t4d4 on target host hpilb09 vxchg_rootid 16:29: HW path of c7t4d4 on target host is 0/4/0/0.1.3.0.0.4.4 vxchg_rootid 16:29: Setting devpath in /stand/bootconf file to /dev/dsk/c7t4d4 vxchg_rootid 16:29: Current setboot values for remote host hpilb09: vxchg_rootid 16:29: Primary: 0/4/0/0.1.3.0.0.4.3 vxchg_rootid 16:29: Alternate: 0/4/0/0.1.3.0.0.4.2 vxchg_rootid 16:29: Making disk c7t4d4 (0/4/0/0.1.3.0.0.4.4) the primary boot disk vxchg_rootid 16:29: Making Alternate boot disk old primary (0/4/0/0.1.3.0.0.4.3) vxchg_rootid 16:29: Calling /test_script arg1 arg2 hpilb09 /tmp/tmpmnt1.6376. test_script: Args are arg1 arg2 hpilb09 /tmp/tmpmnt1.6376 vxchg_rootid 16:29: Unmounting temporarily mounted file systems. vxchg_rootid 16:29: Deporting rootdg.6376 disk group vxchg_rootid 16:29: Patching Private Region hostid to hpilb09 on disk c8t4d4. vxchg_rootid 16:29: Disk c8t4d4 is now suitable for booting on host hpilb09 SEE ALSO
dd(1), remsh(1), setboot(1M), hosts.equiv(4) VxVM 5.0.31.1 24 Mar 2008 vxchg_rootid(1M)
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy