if( Platforms::iswin32() ) {
    my @fs;
    my( $filesys );

    $args{"_eval"} = "disk";
    do "_evaluator";
    $args{"object"} = "LogicalDisk";
    do "_perflib";
    @fs = split(",",$args{"fs"} );
    my $perflib = $memory{"perflib_$args{host}_$args{frequency}"};
    $perflib->check( "LogicalDisk" );
    my $found = 0;
    if( @fs ) {
	foreach $filesys (@fs) {
	    my $name = $filesys;
	    $name =~ s/\(.*//;
	    my $instance;
	    foreach $instance (@{$uxmon::monitor_variables{$args{"alias"}}->{"perflib.LogicalDisk.Instances"}}) {
		if( $uxmon::monitor_variables{$args{"alias"}}->{"perflib.LogicalDisk.$instance.InstanceName"} eq $name ) {
		    $filesys =~ s/^\Q$name/$instance/;
		    $found++;
		    last;
		}
	    }
	}
    }
    if( ! $found ) {
	@fs = () unless( @fs );
	my $instance;
	foreach $instance (@{$uxmon::monitor_variables{$args{"alias"}}->{"perflib.LogicalDisk.Instances"}}) {
	    unless( $uxmon::monitor_variables{$args{"alias"}}->{"perflib.LogicalDisk.$instance.InstanceName"} =~ /total/i ) {
		push( @fs, $instance );
	    }
	}
    }
    my $red_default = 2;
    my $yellow_default = 5;
    foreach $filesys ( @fs ) {
	my $red;
	my $yellow;
	if( ($filesys =~ /\((.*)-(.*)\)/) || ($filesys =~ /\((.*)\)/ ) ) {
	    $red = $1;
	    $yellow = $2;
	    $filesys = $`;
	}
	$red = $red_default unless( length($red) );
	$yellow = $yellow_default unless( length($yellow) );
	if( ($filesys eq "all") || ($filesys eq "all-ntfs") || ($filesys eq "all-fat") ) {
	    $red_default = $red;
	    $yellow_default = $yellow;
	    next;
	}
	if( $filesys =~ /^all/ ) {
	    next;
	}
	$red =~ s/\%//;
	$yellow =~ s/\%//;
	my $name = $uxmon::monitor_variables{$args{"alias"}}->{"perflib.LogicalDisk.$filesys.InstanceName"};
	$evaluator->add_check( "disk", sub {
	    my( $vars ) = @_;
	    my $text .= "$name ";
	    $text .= ($vars->{"perflib.LogicalDisk.$filesys.%_Free_Space.fraction"})."MB (";
	    $text .= int(0.5+$vars->{"perflib.LogicalDisk.$filesys.%_Free_Space"})."%) of ";
	    $text .= ($vars->{"perflib.LogicalDisk.$filesys.%_Free_Space.base"})."MB free";
	    if( ! defined $vars->{"perflib.LogicalDisk.$filesys.%_Free_Space"} ){
		return( 2, "$filesys (no data available)" );
	    }
	    if( $vars->{"perflib.LogicalDisk.$filesys.%_Free_Space"} <= $red ) {
		return( 0, $text );
	    }
	    elsif( $vars->{"perflib.LogicalDisk.$filesys.%_Free_Space"} <= $yellow ) {
		return( 1, $text );
	    }
	    return( 3, $text );
	  } );
    }
		
}
else {
    my $fs;
    my $type;

    uxmon::test_deprecated( \%args );
    $type = $args{"type"}?$args{"type"}:"ufs";

    my( $fscomm, $maybecomm );

    foreach $fs ( "df -k -B", "bdf -t $type", "df -t $type", "df -k -F $type", "df -k -I" ) {
	my $tst = `sh -c '$fs' 2>/dev/null`;
	next if( $? || ! $tst );
	if( $tst =~ /ilesystem/ ) {
	    $fscomm = $fs;
	    last;
	} 
	$maybecomm = $fs;
    } 
    if( $maybecomm && ! $fscomm ) {
	$fscomm = $maybecomm;
    }
    unless( $fscomm ) {
	BigSister::common::log( "warn", "no compliant df command/options found" );
	die();
    }

    print "diskfree: using $fscomm\n" if( $BigSister::common::dl>2 );

    unless( $fs = $memory{"fs.$type.$args{frequency}"} ) {
	&uxmon::load_module( "fs" );
	&uxmon::checker(
	    $memory{"fs.$type.$args{frequency}"} = $fs = Monitor::fs->new($type,$fscomm)
	);
	$fs->sched_frequency( $args{"frequency"} );
    }
    my( $filesys, $red, $yellow );

    my( @fs );

    if ( $args{"fs"} ) {
	@fs = split(",",$args{"fs"} );
    } else {
	@fs = ("all");
    }
		
    foreach $filesys ( @fs ) {
        undef $red;
        undef $yellow;
	if( ($filesys =~ /\((.*)-(.*)\)/) || ($filesys =~ /\((.*)\)/ ) ) {
	    $red = $1;
	    $yellow = $2;
	    $filesys = $`;
	}
	$red = undef unless( length($red) );
	$yellow = undef unless( length($yellow) );
	$fs->add_check( $filesys, $args{"alias"}.".disk", $yellow, $red );
    }
}

1;
