[Orca-users] clear multiple disk run data

Julian R C Briggs j.briggs at sheffield.ac.uk
Fri Nov 16 05:55:00 PST 2001


Dear All,

If, like us, you are unable to plot:

Disk Run Percent
Disk Space Percent Usage
Disk Inode Percent Usage

because you have multiple graphs of each, then you may find this
useful.

To throw away old Disk (Run, Space, Inode) data (so we can plot
single graphs), do this:

cd /export/orca
rm orcallator/*/*{disk_runp_,mntP_,mntp_}*.rrd
orcaproc */orcallator-*[0-9]
perl -pi.bak -e 's/\s+(disk_runp_|mntP_|mntp_)//og' orcallator/orca.state

Julian
------------------------------------------------------------------
#!/usr/local/bin/perl -nwi.bak
#	-*-perl-*-
#(@)Delete disk run (etc) fields from orcallator data files
#JRCB 15-nov-01

BEGIN()
{
    $\="\n";
    $REGEXP="disk_runp_|mntP_|mntp_"; 		#disk run (etc) 
}

#Split into fields (including LEADING space of field)
@FIELD = /(\s*\S+)/og;

#Identify fields to Keep
if (/^\s?timestamp/){
    @KEEP=();
    foreach $I (0 .. $#FIELD){
	push(@KEEP, $I) unless ($FIELD[$I] =~ /$REGEXP/o);
    }
} 

print @FIELD[@KEEP];

-- 
Julian Briggs, System Administrator, Department of Computer Science, 
University of Sheffield, Regent Court, 211 Portobello St, Sheffield S1 4DP, UK
Phone +44 (0) 114-222-1851. Fax +44 (0) 114-222-1810
j.briggs at sheffield.ac.uk  http://www.dcs.shef.ac.uk/~julian



More information about the Orca-users mailing list