[Orca-users] Re: possible to use orca for Win2k hosts

Darren Dunham ddunham at taos.com
Tue May 21 17:35:33 PDT 2002


> > I'm not the NT guy, so I don't know how this is set up.
> >
> > I think we're just using some built-in logging functions from NT.  The
> > orca host has a samba share that is mounted on the NT box.  There it
> > constantly creates a <hostname>.tsv file with several parameters.
> > Here's the first line..

Turns out, this is all only working currently on Win2K.  We're trying to
get it to happen on NT too, but it doesn't right now.  Any suggestions
are welcome.  We tried to have a W2K box collect from an NT box, but we
get an error when we try to start the collector.

> > Periodically a perl script parses the data out of that file and puts it
> > in more of a daily log for long-term storage, and into a form that orca
> > likes.  Then orca runs against that data.
>
> Can you send this Perl script to the mailing list?  It looks really
> useful.

Ugh.. Here we go.  I'm a little ashamed of it myself, but I really don't
want to hold you up while I think about straightening it up so noone
else has to see it. 

#!/usr/local/bin/perl

use File::stat;
use Date::Parse;

$srcdir = "/usr/local/cricket/win";
$destdir = "/usr/local/orca/var/orca/windows";
@srcfiles = `ls -R $srcdir/*/*`;

foreach $f (@srcfiles) {
        chomp $f;
        next if not ( -f $f ) ;
        $modtime = stat($f)->mtime;
        $now = time;
        $timediff = $now - $modtime;
        next if ( $timediff > 900 );
        open (SRC, "$f");
        $host = `basename $f`;
        chomp $host;
        $host =~ s/.tsv//;
        open (DEST, ">$destdir/$host/data");
        $i=0;

        while (<SRC>) {
                chomp;
                s/^M//;   # should probably be s/\r//;
                s/" "/0/g;
                s/ /_/g;
                s/"//g;
                s/\\/\//g;
                s/\(/-/g;
                s/\)/-/g;

                @x = split ( "\t", $_);
                $a = @x;

                if ( $i < 1 ) {
                        print DEST "timestamp";
                }
                else {
                        $x[0] =~ s/_/ /;
                        $timestamp = str2time ( $x[0], "PST");
                        print DEST "$timestamp";
                }

                for ( $j=1; $j < $a; $j++ ) {
                        print DEST " $x[$j]";
                }
                print DEST "\n";

                $i++;
        }
close SRC;
close DEST;
}

> Also, if you have a Orca configuration file for this, that would be useful.

I think the plots are the only relevant bit...

[...]

plot {
title                   %g CPU Usage
source                  windows
data                    /Processor-_Total-/%_Processor_Time
#data                   100 - /Processor-_Total-/%_Processor_Time
line_type               area
#line_type              stack
color                   ff0000
legend                  CPU Utilization
#legend                 CPU Idle
y_legend                Percent
data_min                0
data_max                100
#plot_min               0
#plot_max               100
#rigid_min_max          1
}

plot {
title                   %g Interface bits/sec
source                  windows
data                    8 * /Network_Interface-(.*)-/Bytes_Received/sec
data                    8 * /Network_Interface-(.*)-/Bytes_Sent/sec
line_type               area
line_type               line1
legend                  Input
legend                  Output
y_legend                Bits/s
data_min                0
data_max                100000000
}

plot {
title                   %g Memory Available
source                  windows
data                    /Memory/Available_Bytes
line_type               area
color                   00aa00
legend                  Available Memory
y_legend                Bytes
base                    1024
data_min                0
}

plot {
title                   %g Disk Read Time
source                  windows
data                    /PhysicalDisk-_Total-/%_Disk_Read_Time
line_type               area
color                   a020f0
legend                  Disk Read Time
y_legend                Percent
data_min                0
data_max                100
}

plot {
title                   %g Disk Write Time
source                  windows
data                    /PhysicalDisk-_Total-/%_Disk_Write_Time
line_type               area
color                   ffa500
legend                  Disk Write Time
y_legend                Percent
data_min                0
data_max                100
}
plot {
title                   %g Disk Idle Time
source                  windows
data                    /PhysicalDisk-_Total-/%_Idle_Time
line_type               area
color                   7df5cb
legend                  Disk Idle Time
y_legend                Percent
data_min                0
data_max                100
}

plot {
title                   %g Paging File Usage
source                  windows
data                    /Paging_File-_Total-/%_Usage
line_type               area
color                   be711d
legend                  Paging File Usage
y_legend                Percent
data_min                0
data_max                100
}

plot {
title                   %g Web Server Connections
source                  windows
data                    /Web_Service-_Total-/Current_Connections
line_type               line1
color                   19a48a
legend                  Web Connections
y_legend                No. of Connections
data_min                0
}



--
Darren Dunham                                           ddunham at taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >



More information about the Orca-users mailing list