I'm really, really new to writing scripts, but have been asked to generate a report that will show available space for a disk, space used by particular subdirectories on the disk and totals. I can get the information I need with du and df and output it to a text file but I'm stumped as to how to format it.
The output I'm looking for should be similar to the attached text file (done because when I previewed my posting I lost all the formatting).
-and then repeating for each Database SID and each disk. Any tips will be greatly appreciated -better yet, if anybody has a script that does something similar that I could borrow and modify I'm certain it would improve your karma deleted attachment and pasted in post --oombera
Does anyone had an issue with AIX reporting huge CPU Usage Times for jobs? I am seeing process using ps that are reporting billions for the CPU Times. This only seems to happen once in awhile. (0 Replies)
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Hi all,
FreeBSD7.1 @ sh.
In a backup script I am trying to get the blocks used by the backup once completed.
I am using the function:
#!/bin/sh
spaceused()
{
du -d 0 "${1}" | awk -F"+" '{ print $1 }
}
to return the blocks used of said directory and contents.
Via. command line... (7 Replies)
Issue with disk space usage
I have the following line in my "df -h" output:
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 496M 495M -39M 109% /
What is the issue with having 9% excess utilisation? How can I find out what this partition is... (2 Replies)
How to remove any space around a specific charachter from a string using sed.
for exmple :
the string is like following
str1='"name", "roll", "addr","job", "pay",'
I need to remove all the spaces aronnd the commas. (8 Replies)
Hi all,
Can you please tell me the command, with which one can know the amount of space a specific directory has used.
df -k . ---> Displays, the amount of space allocated, and used for a directory.
du -k <dir name> - gives me the memory used of all the files inside <dir>
But i... (2 Replies)
hi,
In HP unix, how can check the space usage in Mb
bdf will give me the output in Bytes i guess.
Also, how can i check the directory size in hp unix.
Thx (4 Replies)
Hello.
I have a clean-up script that deletes > 5days old files on /archive/idocs directory. This script runs twice a week, Tuesday and Friday. This creates a log file that shows the current space usage before and after the files were deleted from the directory.
On Feb 3, the script ran and... (2 Replies)
Hi everyone,
Got an interesting one (well, interesting to me)
I have a box with a 5Gb / mount point. Checking for large files I found nothing and in fact when I did a full du I found that there was only 1.6Gb in use! And yet 100% used in /
So there's an unaccounted 3.4Gb somewhere!
The... (3 Replies)
Hi all,
I am looking for help with a script for displaying the space available from a df - h command for / (root).
The problem is: If it is below 700 MB I have jobs that are failing... Is there a way I can do a calculation? If it above 700 MB it is good, if it is below 700 MB it will fail.... (5 Replies)
Discussion started by: gartie
5 Replies
LEARN ABOUT DEBIAN
sys::statistics::linux::memstats
Sys::Statistics::Linux::MemStats(3pm) User Contributed Perl Documentation Sys::Statistics::Linux::MemStats(3pm)NAME
Sys::Statistics::Linux::MemStats - Collect linux memory information.
SYNOPSIS
use Sys::Statistics::Linux::MemStats;
my $lxs = Sys::Statistics::Linux::MemStats->new;
my $stat = $lxs->get;
DESCRIPTION
Sys::Statistics::Linux::MemStats gathers memory statistics from the virtual /proc filesystem (procfs).
For more information read the documentation of the front-end module Sys::Statistics::Linux.
MEMORY INFORMATIONS
Generated by /proc/meminfo.
memused - Total size of used memory in kilobytes.
memfree - Total size of free memory in kilobytes.
memusedper - Total size of used memory in percent.
memtotal - Total size of memory in kilobytes.
buffers - Total size of buffers used from memory in kilobytes.
cached - Total size of cached memory in kilobytes.
realfree - Total size of memory is real free (memfree + buffers + cached).
realfreeper - Total size of memory is real free in percent of total memory.
swapused - Total size of swap space is used is kilobytes.
swapfree - Total size of swap space is free in kilobytes.
swapusedper - Total size of swap space is used in percent.
swaptotal - Total size of swap space in kilobytes.
swapcached - Memory that once was swapped out, is swapped back in but still also is in the swapfile.
active - Memory that has been used more recently and usually not reclaimed unless absolutely necessary.
inactive - Memory which has been less recently used and is more eligible to be reclaimed for other purposes.
On earlier kernels (2.4) Inact_dirty + Inact_laundry + Inact_clean.
The following statistics are only available by kernels from 2.6.
slab - Total size of memory in kilobytes that used by kernel for data structure allocations.
dirty - Total size of memory pages in kilobytes that waits to be written back to disk.
mapped - Total size of memory in kilbytes that is mapped by devices or libraries with mmap.
writeback - Total size of memory that was written back to disk.
committed_as - The amount of memory presently allocated on the system.
The following statistic is only available by kernels from 2.6.9.
commitlimit - Total amount of memory currently available to be allocated on the system.
METHODS
new()
Call "new()" to create a new object.
my $lxs = Sys::Statistics::Linux::MemStats->new;
It's possible to set the path to the proc filesystem.
Sys::Statistics::Linux::MemStats->new(
files => {
# This is the default
path => '/proc',
meminfo => 'meminfo',
}
);
get()
Call "get()" to get the statistics. "get()" returns the statistics as a hash reference.
my $stat = $lxs->get;
EXPORTS
No exports.
SEE ALSO proc(5)REPORTING BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>.
AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
COPYRIGHT
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-03-09 Sys::Statistics::Linux::MemStats(3pm)