{
my @check;

if( Platforms::iswin32() ) {
    my $inst;
    my( $filesys );

    $args{"_eval"} = "net";
    do "_evaluator";
    $args{"object"} = "Network Interface";
    do "_perflib";
    my $perflib = $memory{"perflib_$args{host}_$args{frequency}"};
    $perflib->check( "Network Interface" );

    my $root = $uxmon::monitor_variables{$args{"alias"}};
    my $proot = "perflib.Network_Interface";
    foreach my $instance (@{$root->{"$proot.Instances"}}) {
	my $name = $root->{"$proot.$instance.InstanceName"};
	my $bandwidth = $root->{"$proot.$instance.Current_Bandwidth"};
	if( $bandwidth < 1 ) {$bandwidth = 1;}

	push( @check , (

	    "%interface $name receive usage", sub {
		my( $vars ) = @_;
		return(undef) unless( defined $vars->{"perflib.Network_Interface.$instance.Current_Bandwidth"} );
		return ( $vars->{"perflib.Network_Interface.$instance.Bytes_Received/sec"} * 100 / 
			 $vars->{"perflib.Network_Interface.$instance.Current_Bandwidth"} );
	    },
	    100, 0,

	    "%interface $name transmit usage", sub {
		my( $vars ) = @_;
		return(undef) unless( defined $vars->{"perflib.Network_Interface.$instance.Current_Bandwidth"} );
		return ( $vars->{"perflib.Network_Interface.$instance.Bytes_Sent/sec"} * 100 / 
			 $vars->{"perflib.Network_Interface.$instance.Current_Bandwidth"} );
	    },
	    100, 0
	) );
    }

#    @check = ( 
#	"%free committed", sub { 
#	    my( $vars ) = @_;
#	    return(undef) unless( defined $vars->{"perflib.Memory.$inst.%_Committed_Bytes_In_Use"} );
#	    100-$vars->{"perflib.Memory.$inst.%_Committed_Bytes_In_Use"};
#	}, $freecomit,
#	"avail mem MB", sub {
#	    my( $vars ) = @_; 
#	    return(undef) unless( defined $vars->{"perflib.Memory.$inst.Available_Bytes"} );
#	    $vars->{"perflib.Memory.$inst.Available_Bytes"} /1024/1024;
#	}, $freepage
#    );
}

while( @check ) {
    my $text = shift( @check );
    my $val = shift( @check );
    my $limit = shift( @check );
    my $updown = shift( @check );
    $args{"_evaluator"}->add_check( ($args{"check"}?$args{"check"}:"net"), sub {
	my( $vars ) = @_;

	my $val = &$val($vars);
	return( 2, "(no data available)" ) unless( defined $val );
	$val = int($val+0.5);
	if( $updown ) {
	    if( $val > $limit ) {
		return( 3, $text." = $val" );
	    }
	    if( $val > $limit/2 ) {
		return( 1, $text."(<) $val" );
	    }
	    return( 0, $text."(<<) $val" );
	}
	else {
	    if( $val > $limit ) {
		return( 0, $text."(>>) $val" );
	    }
	    if( $val > $limit/2 ) {
		return( 1, $text."(>) $val" );
	    }
	    return( 3, $text." = $val" );
	}
      } );
}

}

1;
