Sponsored Content
Top Forums Shell Programming and Scripting view partition name using script Post 302214509 by adzuanamir on Monday 14th of July 2008 07:30:57 AM
Old 07-14-2008
view partition name using script

Hi All..
Previously i've posted my question regarding this script and i managed to solve the problem but i need to modified my script so it will meet the new requirement.
Below is the script and output:
--------------------------------------------------------------
-bash-3.00$ more check_oracle_filesystem.ksh
#!/bin/ksh

for i in `df -k|grep /ek_|awk '{ print $4 }'`
do
# Convert the file size to a numeric value
filesize=`expr i`

#Display the partiton name that less than 6000000k
df -k|grep /ek_ > /ek_bkup/alert/part_info.txt

# If any filesystem has less than 6000000k, issue an alert
if [ $filesize -lt 6000000 ]

then
mailx -r oraadm@juwpkl.gov.my -c "encass@nc.com.my technical@precisionportal.com.my"\
-s "Oracle filesystem $i has less than 6000000k free"\
fauzi@precisionportal.com.my < /ek_bkup/alert/part_info.txt

fi
done
------------------------------------------------------------------
output :

User will receive email that state at the subject email with "Oracle filesystem 0 has less than 6000000k free" with email content from part_info.txt

So my question is, how to show the partition name instead of 1234567?
Based on this command below, i want to show the "Mounted on" instead of "avail"

Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d301 141168826 23093091 116664047 17% /ek_bkup
/dev/md/dsk/d402 10210996 5820267 4288620 58% /ek_logs1
/dev/md/dsk/d401 10323964 10220725 0 100% /ek_ora
/dev/md/dsk/d403 10210996 5631195 4477692 56% /ek_logs2
/dev/md/dsk/d404 10210996 7008404 3100483 70% /ek_logs3

Soon when the user receive the email, it will state "Oracle filesystem ek_ora has less than 6000000k free"

Thats all...hopefully somebody that really expert in ksh will assist me...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at http://www.gnu.org/software/parted/manual/parted.html is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies

2. Shell Programming and Scripting

Shell script to view logs of a server

Please share a shell script to collect logs of a server (like cpu utilization, memory etc) for a perticular time interval by giving date, time and server name as input. (1 Reply)
Discussion started by: abhishek27
1 Replies

3. Shell Programming and Scripting

Clearcase set into a view with script

Hi Friends, How do i set into a view and continue with make via a script. I could do both separately but when i try both in a single script, it stops after setting into the view. below is the sample "ap_script", first two execute, but the third one command doesn't. echo $USER cleartool... (2 Replies)
Discussion started by: arunp46
2 Replies

4. Solaris

How can i view or edit atteched script file.

I have a binary code that writen with C language. This code had edited and converted to script file. I want to viewing and editing this script file. Script file is atteched. And how can i convert the binary code to script file. Thanks in advance. (0 Replies)
Discussion started by: getrue
0 Replies

5. Shell Programming and Scripting

trying to view contents of an existing script

root#pwd /opt/tools root# cat check_traffic /opt/tools/utils/commands $1 /opt/tools/utils/DIR/check_traffic root# cat /opt/tools/utils/DIR/check_traffic gew "check_traffic -v" Hi above script works for checking traffic for an ip address im trying to view the check_traffic script by... (5 Replies)
Discussion started by: slashbash
5 Replies

6. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

7. Shell Programming and Scripting

How to view a running Shell Script?

I ran a script, and then I closed SSH. I want to go back and view it as if I just ran it. Is this possible? (2 Replies)
Discussion started by: slayr288
2 Replies

8. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

9. Shell Programming and Scripting

Help with Shell Script to View Logs

Hi I'm very new to unix shell scripting. Im also new here in this forum. I'm a SQL Server DBA but I'm slowly learning Oracle and Sybase DB. Our Oracle and Sybase are on Unix platforms. Im slowly learning Linux Admin and Shell Scripting to automate tasks. I'm writing a script to view DB error... (4 Replies)
Discussion started by: Ricky777
4 Replies

10. What is on Your Mind?

Moving from Desktop View to Mobile View

See attached video for a demo on how to move back and forth from the desktop view to the mobile view. Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on. Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies
WWW::Topica::Reply(3pm) 				User Contributed Perl Documentation				   WWW::Topica::Reply(3pm)

NAME
WWW::Topica::Index - parse a single Topic mailing list index SYNOPSIS
my $index = WWW::Topic::Index->new($index_html); foreach my $message_id ($index->message_ids) { # the mail has some information and also provides a link to the reply ... my $mail = WWW::Topica::Mail->new($topica->fetch_mail($mess_id), $mess_id); # which has other information (like the un-htmled mail and the email address) ... my $reply = WWW::Topica::Reply->new($topica->fetch_reply($mail->id, $mail->eto), $mail->id, $mail->eto); } print "Next offset is ".$index->next." "; print "Previous offset is ".$index->prev." "; DESCRIPTION
Used to parse a single reply page from Topica.com's mailing list indexes. Reply pages have the body of the email (albeit quoted) and potentially a full email address. METHODS
new <page html> <message id> <eto> Takes the html of the page, the eto and the message-id and parses the html. parse <html> Parse the html to get the subject, email address and body of the email. id Get the message id eto Get the message eto email Get the email address parsed out. subject Get the email subject parsed out. body Get the email body parsed out. AUTHOR
Simon Wistow <simon@thegestalt.org> COPYRIGHT
Copyright (c) 2004, Simon Wistow perl v5.10.1 2006-01-03 WWW::Topica::Reply(3pm)
All times are GMT -4. The time now is 11:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy