Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of perl module #128

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 59 additions & 21 deletions pandora_server/lib/PandoraFMS/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ sub pandora_planned_downtime_set_disabled_elements($$$) {
}

########################################################################
=head2 C<< pandora_planned_downtime_set_quiet_elements (I<$pa_config>, I<$dbh>, <$id_downtime>) >>
=head2 C<< pandora_planned_downtime_unset_disabled_elements (I<$pa_config>, I<$dbh>, <$id_downtime>) >>

Start the planned downtime, the once type.

Expand Down Expand Up @@ -2955,7 +2955,11 @@ sub pandora_create_module ($$$$$$$$$$) {
}

##########################################################################
## Delete a module given its id.
=head2 C<< pandora_delete_module (I<$dbh>, I<$module_id>, I<$conf>) >>

Delete a module given its id.

=cut
##########################################################################
sub pandora_delete_module ($$;$) {
my ($dbh, $module_id, $conf) = @_;
Expand Down Expand Up @@ -3153,7 +3157,11 @@ sub pandora_get_config_value ($$) {


##########################################################################
## Get credential from credential store
=head2 C<< pandora_get_credential (I<$dbh>, I<$identifier>) >>

Get credential from credential store

=cut
##########################################################################
sub pandora_get_credential ($$) {
my ($dbh, $identifier) = @_;
Expand Down Expand Up @@ -4846,7 +4854,7 @@ sub pandora_server_statistics ($$) {
}

##########################################################################
=head2 C<< pandora_process_policy_queue (I<$pa_config>, I<$dbh>) >>
=head2 C<< pandora_process_event_replication (I<$pa_config>) >>

Process groups statistics for statistics table

Expand Down Expand Up @@ -5212,7 +5220,7 @@ sub pandora_self_monitoring ($$) {
}

##########################################################################
=head2 C<< set_master (I<$pa_config>, I<$dbh>) >>
=head2 C<< pandora_set_master (I<$pa_config>, I<$dbh>) >>

Set the current master server.

Expand All @@ -5231,7 +5239,7 @@ sub pandora_set_master ($$) {
}

##########################################################################
=head2 C<< is_master (I<$pa_config>) >>
=head2 C<< pandora_is_master (I<$pa_config>) >>

Returns 1 if this server is the current master, 0 otherwise.

Expand Down Expand Up @@ -5441,7 +5449,7 @@ sub pandora_disable_autodisable_agents ($$) {
}

##########################################################################
=head2 C<< get_module_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>
=head2 C<< pandora_get_module_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>

Get a list of module tags in the format: |tag|tag| ... |tag|

Expand Down Expand Up @@ -5469,7 +5477,7 @@ sub pandora_get_module_tags ($$$) {
}

##########################################################################
=head2 C<< get_module_url_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>
=head2 C<< pandora_get_module_url_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>

Get a list of module tags in the format: |url|url| ... |url|

Expand All @@ -5496,7 +5504,7 @@ sub pandora_get_module_url_tags ($$$) {
}

##########################################################################
=head2 C<< get_module_email_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>
=head2 C<< pandora_get_module_email_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>

Get a list of email module tags in the format: email,email,...,email

Expand Down Expand Up @@ -5525,7 +5533,7 @@ sub pandora_get_module_email_tags ($$$) {
}

##########################################################################
=head2 C<< get_module_phone_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>
=head2 C<< pandora_get_module_phone_tags (I<$pa_config>, I<$dbh>, I<$id_agentmodule>) >>

Get a list of phone module tags in the format: phone,phone,...,phone

Expand Down Expand Up @@ -5555,7 +5563,11 @@ sub pandora_get_module_phone_tags ($$$) {


##########################################################################
# Mark an agent for module status count update.
=head2 C<< pandora_mark_agent_for_module_update (I<$dbh>, I<$agent_id>) >>

Mark an agent for module status count update.

=cut
##########################################################################
sub pandora_mark_agent_for_module_update ($$) {
my ($dbh, $agent_id) = @_;
Expand All @@ -5565,7 +5577,11 @@ sub pandora_mark_agent_for_module_update ($$) {
}

##########################################################################
# Mark an agent for fired alert count update.
=head2 C<< pandora_mark_agent_for_alert_update (I<$dbh>, I<$agent_id>) >>

Mark an agent for fired alert count update.

=cut
##########################################################################
sub pandora_mark_agent_for_alert_update ($$) {
my ($dbh, $agent_id) = @_;
Expand All @@ -5575,14 +5591,22 @@ sub pandora_mark_agent_for_alert_update ($$) {
}

##########################################################################
# Set or unset silent mode.
=head2 C<< pandora_set_event_storm_protection (I<$EventStormProtection>) >>

Set or unset silent mode.

=cut
##########################################################################
sub pandora_set_event_storm_protection ($) {
$EventStormProtection = shift;
}

##########################################################################
# Update the module status count of an agent.
=head2 C<< pandora_update_agent_module_count (I<$pa_config>, I<$dbh>, I<$agent_id>) >>

Update the module status count of an agent.

=cut
##########################################################################
sub pandora_update_agent_module_count ($$$) {
my ($pa_config, $dbh, $agent_id) = @_;
Expand Down Expand Up @@ -5612,7 +5636,11 @@ sub pandora_update_agent_module_count ($$$) {
}

##########################################################################
# Update the fired alert count of an agent.
=head2 C<< pandora_update_agent_alert_count (I<$pa_config>, I<$dbh>, I<$agent_id>) >>

Update the fired alert count of an agent.

=cut
##########################################################################
sub pandora_update_agent_alert_count ($$$) {
my ($pa_config, $dbh, $agent_id) = @_;
Expand All @@ -5626,7 +5654,11 @@ sub pandora_update_agent_alert_count ($$$) {
}

##########################################################################
# Update the secondary group cache.
=head2 C<< pandora_update_secondary_groups_cache (I<$pa_config>, I<$dbh>, I<$agent_id>) >>

Update the secondary group cache.

=cut
##########################################################################
sub pandora_update_secondary_groups_cache ($$$) {
my ($pa_config, $dbh, $agent_id) = @_;
Expand All @@ -5638,8 +5670,12 @@ sub pandora_update_secondary_groups_cache ($$$) {
}

########################################################################
# SUB pandora_get_os (string)
# Detect OS using a string, and return id_os
=head2 C<< pandora_get_os (I<$dbh>, I<$os>) >>

SUB pandora_get_os (string)
Detect OS using a string, and return id_os

=cut
########################################################################
sub pandora_get_os ($$) {
my ($dbh, $os) = @_;
Expand Down Expand Up @@ -5983,7 +6019,7 @@ sub safe_mode($$$$$$) {
}

##########################################################################
=head2 C<< safe_mode_modules_update (I<$pa_config>, I<$agent>, I<$dbh>) >>
=head2 C<< pandora_safe_mode_modules_update (I<$pa_config>, I<$agent>, I<$dbh>) >>

Check if agent safe module is critical and turn all modules to disabled.

Expand All @@ -6007,8 +6043,10 @@ sub pandora_safe_mode_modules_update {

##########################################################################

=head2 C<< message_set_targets (I<$dbh>, I<$pa_config>, I<$notification_id>, I<$users>, I<$groups>) >>
Set targets for given messaje (users and groups in hash ref)
=head2 C<< notification_set_targets (I<$dbh>, I<$pa_config>, I<$notification_id>, I<$users>, I<$groups>) >>

Set targets for given message (users and groups in hash ref)

=cut

##########################################################################
Expand Down