# define the scalar to hold (?)
my $cpuload;

# if we're in debugging mode, print message saying where we're at
if( $main::dl>3 )
{
   print "LOADING CPULOAD MODULE!!!\n";
}

# check to see if module is already in memory; if it isn't, load it
unless( $cpuload = $memory{"cpuload_$args{frequency}"} )
{
    &uxmon::load_module( "cpuload" );
    &uxmon::checker(
        $memory{"cpuload_$args{frequency}"} = $cpuload = Monitor::cpuload->new()
    );
    $cpuload->sched_frequency( $args{"frequency"} );
}

# send the monitor program either the passed-in limits, or our pre-defined limits for CPU load warnings
$cpuload->add_check( $args{"cpu_yellow"}?$args{"cpu_yellow"}:10,
$args{"cpu_red"}?$args{"cpu_red"}:20, $args{"alias"}.".".($args{"check"}?$args{"check"}:"cpu") );

# if we're in debugging mode, print message saying where we're at
if( $main::dl>3 )
{
    print "CPULOAD: Made it through Config, anyway ...\n";
}
