
#                                      Copyright 2024 WebPros International, LLC
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.

package Whostmgr::360Monitoring::Agent::Settings::Agent;

use cPstrict;
use Moo;
use Whostmgr::360Monitoring::Moo;
use Types::Common qw(PositiveNum PositiveInt NonEmptyStr Enum);

extends 'Whostmgr::360Monitoring::Agent::Settings';

conf_has 'max_data_span' => (
    isa     => PositiveInt,
    coerce  => 1,
    default => 60,
);

conf_has 'max_data_age' => (
    isa     => PositiveInt,
    coerce  => 1,
    default => 600,
);

conf_has 'max_cached_collections' => (
    isa     => PositiveInt,
    coerce  => 1,
    default => 10,
);

conf_has 'server' => (
    isa => NonEmptyStr,
);

conf_has 'user' => (
    isa => NonEmptyStr,
);

conf_has 'plugins' => (
    isa => NonEmptyStr,
);

# Default is logging.INFO which is 20
# https://docs.python.org/3/howto/logging.html#custom-levels
conf_has 'logging_level' => (
    isa     => NonEmptyStr,
    default => 20
);

conf_has 'log_file' => (
    isa     => NonEmptyStr,
    default => '/var/log/agent360.log'
);

conf_has 'log_file_mode' => (
    isa     => Enum [ 'w', 'a' ],
    default => 'a'
);

conf_has 'interval' => (
    isa     => PositiveNum,
    default => 0.5
);

1;
