Skip to content

Commit

Permalink
agents: set useful graph source
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Oct 24, 2024
1 parent f978206 commit 13b920f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ sub _extract_checks {
'_AGENT_AUTO_CHECK' => $chk->{'id'},
};
$chk->{'svc_conf'}->{'parents'} = $chk->{'parent'} if $chk->{'parent'};
$chk->{'svc_conf'}->{'_GRAPH_SOURCE'} = $chk->{'_GRAPH_SOURCE'} if $chk->{'_GRAPH_SOURCE'};
$chk->{'args'} = "";

for my $attr (qw/contacts contactgroups/) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sub get_checks {
'name' => 'agent inventory',
'check' => 'inventory',
'parent' => 'agent version',
'_GRAPH_SOURCE' => 'duration',
};
push @{$checks}, {
'id' => 'version',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sub get_checks {
'check' => 'check_cpu',
'parent' => 'agent version',
'info' => Thruk::Agents::SNClient::make_info($inventory->{'cpu'}->[0]),
'_GRAPH_SOURCE' => 'total',
};
}
if($inventory->{'cpu_utilization'}) {
Expand All @@ -42,6 +43,7 @@ sub get_checks {
'check' => 'check_cpu_utilization',
'parent' => 'agent version',
'info' => Thruk::Agents::SNClient::make_info($inventory->{'cpu_utilization'}->[0]),
'_GRAPH_SOURCE' => 'total',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sub get_checks {
'args' => { "inet" => $conn->{'inet'} },
'info' => Thruk::Agents::SNClient::make_info($conn),
'disabled' => Thruk::Utils::Agents::check_disable($conn, $disabled_config, 'connections'),
'_GRAPH_SOURCE' => 'total',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sub get_checks {
'parent' => 'agent version',
'info' => Thruk::Agents::SNClient::make_info($omd),
'disabled' => Thruk::Utils::Agents::check_disable($omd, $disabled_config, 'omd'),
'_GRAPH_SOURCE' => 'service_checks_rate',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ sub get_checks {
'args' => $args,
'parent' => 'agent version',
'info' => Thruk::Agents::SNClient::make_info($p),
'_GRAPH_SOURCE' => 'cpu',
};
}
}
Expand Down

0 comments on commit 13b920f

Please sign in to comment.