tracking high water usage of mount point


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting tracking high water usage of mount point
# 1  
Old 10-02-2012
tracking high water usage of mount point

Oracle Linux 5.6 x86-64

This may or may not end up being a strictly 'scripting' issue, but I'll start here.

I'm looking for a way of establishing the 'max' or 'high water' useage of a given mount point over a period of a week. My first thought was for a cron job, as:

Code:
*/5 * * * * df -h | grep /backup | >> /home/me/dfhist.lis

which works fine as far as it goes, but it would be nice to be able to append the current date/time to each. While ultimately what I need is to establish the high and low usage points during a week, but would be nice to also see the pattern.

If a completely different approach will work, I'm all ears, but I'm not the SA and don't have root access.

Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.

Last edited by Corona688; 10-02-2012 at 01:23 PM..
# 2  
Old 10-02-2012
Quote:
Originally Posted by edstevens
This may or may not end up being a strictly 'scripting' issue, but I'll start here.
Rest assured, it is scripting.


Quote:
but it would be nice to be able to append the current date/time to each. While ultimately what I need is to establish the high and low usage points during a week, but would be nice to also see the pattern.
No problem: the commands you have in cron now go into a script, along with a call to "/usr/bin/date". You might probably want to put the output of both commands into variables and mince them through some text filter (awk, sed, ... pick your choice) to achieve the output format you want. Test the script on the command line until you are satisfied with its output. It should output exactly one line.

Then put into cron a call to your script instead of the call to "df" with a redirection as you already had it.

Quote:
but I'm not the SA and don't have root access.
You don't have to be. Every user has his own crontab (not sure where it is located in Oracle Linux - in AIX it is located in "/var/spool/cron/crontabs/<user>" and probably it is in some similar location). Put it there and you are all fine. It is theoretically possible to block a users access to the cron facility ("/etc/cron.deny"), but this is rarely done.

If you need help writing such a script, report back - i didn't want to spoil the fun of writing it yourself.

I hope this helps.

bakunin
# 3  
Old 10-02-2012
Quote:
Originally Posted by bakunin
Rest assured, it is scripting.
Oh, I know my immediate question is. I was leaving open the possibility that there was some built-in capability/utility that was already tracking this information - something of which I was/am totally unaware. Somehting like "gee, you don't need to script that at all, just execute the 'chkframbo' command.


Quote:
No problem: the commands you have in cron now go into a script, along with a call to "/usr/bin/date". You might probably want to put the output of both commands into variables and mince them through some text filter (awk, sed, ... pick your choice) to achieve the output format you want. Test the script on the command line until you are satisfied with its output. It should output exactly one line.
Then put into cron a call to your script instead of the call to "df" with a redirection as you already had it.
That I can do. I was hoping to be able to just concatenate/stream the returned value of the call to date (`date +format`) into my redirection. I'd played around with piping to awk before redirecting the final output, but got nowhere.



Quote:
You don't have to be. Every user has his own crontab (not sure where it is located in Oracle Linux - in AIX it is located in "/var/spool/cron/crontabs/<user>" and probably it is in some similar location). Put it there and you are all fine. It is theoretically possible to block a users access to the cron facility ("/etc/cron.deny"), but this is rarely done.
Oh, I'm quite familiar with cron. My comment about not being an SA and not having root goes back to my being open to getting the information I need with some unknown (to me) os utility ... implying that if such utility exists but requires root access, I wouldn't be able to use it.

Quote:
If you need help writing such a script, report back - i didn't want to spoil the fun of writing it yourself.

I hope this helps.

bakunin
I think I can handle the script. Was hoping to get something I could do in a single (with piping and redirection) command.

Thanks for the response.
# 4  
Old 10-02-2012
Quote:
Originally Posted by edstevens
I think I can handle the script. Was hoping to get something I could do in a single (with piping and redirection) command.
You can do that:

Code:
/usr/bin/printf "[%s] %s\n" "$(/usr/bin/date +"<format>")" "$(/usr/bin/df -h /backup | /usr/bin/tail -1)"

See "man date" for suitable format options. Once the output suits you put it into cron with a redirection to your logfile.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 5  
Old 10-02-2012
MySQL

That got it. I was just working from the wrong end -- trying to get the df output first. Thanks for the assist. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Mount Point is locked

Hi there, I have a mount point that is locked. How do I unlocked it? (1 Reply)
Discussion started by: alvinoo
1 Replies

2. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies

3. Shell Programming and Scripting

Mount point usage

Hi Guys, I have Solaris 9 and RHEL 5 boxes I implemented script to send me an email when my mount point is > 90. Now the ouput id like these: /dev/dsk/emcpower20a 1589461168 1509087840 64478720 96% /data1 /dev/dsk/emcpower21a 474982909 451894234 18338846 97% /data2... (2 Replies)
Discussion started by: Phuti
2 Replies

4. Solaris

Mount point in a server

Hi , How to find out mount point in a server ? OS -- SunOS 5.6 Generic sun4u sparc SUNW Thanks (4 Replies)
Discussion started by: Maddy123
4 Replies

5. AIX

Change Mount point

Deart All, can any one help to do this, i need to change mount point in AIX 6 /opt/OM should be /usr/lpp/OM, how do i do.... Please help me Urgent issue (2 Replies)
Discussion started by: gulamibrahim
2 Replies

6. Solaris

Size of Mount Point

Hi, On Solaris 5.10, I have a following mount point: /dev/dsk/emcpower0a 492G 369G 118G 76% /u02 In /u02, from the du -h command, I can see that only 110G is used by couple of directories. I am wondering where the rest of 259G has gone? Any ideas please? How can I check... (17 Replies)
Discussion started by: fahdmirza
17 Replies

7. UNIX for Advanced & Expert Users

Sun: High kernel usage & very high load averages

Hi, I am seeing very high kernel usage and very high load averages on my system (Although we are not loading much data to our database). Here is the output of top...does anyone know what i should be looking at? Thanks, Lorraine last pid: 13144; load averages: 22.32, 19.81, 16.78 ... (4 Replies)
Discussion started by: lorrainenineill
4 Replies

8. UNIX for Dummies Questions & Answers

mount point

hi people, I'm trying to create a mount point, but am having no sucess at all, with the following: mount -F ufs /dev/dsk/diskname /newdirectory but i keep getting - mount-point /newdirectory doesn't exist. What am i doing wrong/missing? Thanks Rc (1 Reply)
Discussion started by: colesy
1 Replies

9. UNIX for Advanced & Expert Users

mount point lost

hi , I was applying patches after that when i reboot i get these message. I did not do anything other thatn this. Now i am unable to start my oracle . Tell me how to solve this These are the error messages forceload of /drv/rdriver failed /drv/rdmexus failed ... (7 Replies)
Discussion started by: sathiya
7 Replies
Login or Register to Ask a Question