&uxmon::load_module( "bb" );

my $bb;

&uxmon::reporter(
    $bb = Monitor::bb->new( $args{"host"}, $args{"timeout"}, $args{"port"} )
);
$bb->sched_frequency( $args{"frequency"} );

if( $args{"fqdn"} ) {
    $bb->fqdn( $args{"fqdn"} =~ /^n/i );
}
else {
    $bb->fqdn( $uxmon::FQDN );
}

if( $args{"bind"} ) {
    $bb->bind_ip( $args{"bind"} );
}

if( $args{"cmd"} =~ /^bb/ ) {
    $bb->bb_compat(1);
}
else {
    $bb->perfdata( $args{"perfdata"} ) if( $args{"perfdata"} );
    if( $args{"options"} ) {
	$bb->options( split( ",", $args{"options"} ) );
    }
}
