Skip to content

Commit

Permalink
Merge pull request #134 from ARGOeu/devel
Browse files Browse the repository at this point in the history
Version 0.4.12
  • Loading branch information
themiszamani authored Feb 1, 2021
2 parents 445d07c + 9c5aa6d commit c2a71ed
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 30 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
The ARGO NCG is the core component of ARGO Monitoring Engine and it is responsible for the generation of the Nagios configuration based on information from main sources of truth - topology database (e.g. GOCDB, XML feed) and ARGO POEM. NCG enriches topology information with extra attributes and credential information in needed by Nagios to successfully run probes. Finally, NCG configures Nagios to publish metric results to AMS via component argo-nagios-ams-publisher.

ARGO is a service jointly developed and maintained by [CNRS](http://www.cnrs.fr/en), [GRNET](https://grnet.gr/en/) and [SRCE](https://www.srce.unizg.hr/en/) co-funded by [EOSC-Hub](http://eosc-hub.eu/) (Horizon 2020) under Grant number 777536 and [EGI.eu Foundation](http://egi.eu/). <img src="https://wiki.eosc-hub.eu/download/attachments/1867786/eu%20logo.jpeg?version=1&modificationDate=1459256840098&api=v2" height="24"> <img src="https://wiki.eosc-hub.eu/download/attachments/18973612/eosc-hub-web.png?version=1&modificationDate=1516099993132&api=v2" height="24">
4 changes: 3 additions & 1 deletion argo-ncg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Summary: ARGO Nagios config generator
Name: argo-ncg
Version: 0.4.11
Version: 0.4.12
Release: 1%{?dist}
License: ASL 2.0
Group: Network/Monitoring
Expand Down Expand Up @@ -95,6 +95,8 @@ if [ -f /etc/init.d/ncg ] ; then
fi

%changelog
* Mon Feb 1 2021 Emir Imamagic <[email protected] - 0.4.12-1
- Version bump
* Fri May 8 2020 Emir Imamagic <[email protected] - 0.4.11-1
- Version bump
* Fri Apr 10 2020 Emir Imamagic <[email protected]> - 0.4.10-1
Expand Down
2 changes: 2 additions & 0 deletions src/modules/NCG/LocalMetrics/Hash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ sub getData {
if ($self->{INCLUDE_PROXY_CHECKS} && $service eq 'NAGIOS') {
push @{$WLCG_NODETYPE->{$self->{PROFILE}}->{$service}}, 'hr.srce.GridProxy-Valid';
push @{$WLCG_NODETYPE->{$self->{PROFILE}}->{$service}}, 'hr.srce.GridProxy-Get';
push @{$WLCG_NODETYPE->{$self->{PROFILE}}->{$service}}, 'argo.OIDC.RefreshToken';
push @{$WLCG_NODETYPE->{$self->{PROFILE}}->{$service}}, 'argo.OIDC.CheckRefreshTokenValidity';
}

foreach my $metric (@{$WLCG_NODETYPE->{$self->{PROFILE}}->{$service}}) {
Expand Down
1 change: 1 addition & 0 deletions src/modules/NCG/LocalMetricsAttrs/Active.pm
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ sub _setDefaultPorts {
$self->{SITEDB}->globalAttribute("STOMP_SSL_PORT", 6162);
$self->{SITEDB}->globalAttribute("OPENWIRE_PORT", 6166);
$self->{SITEDB}->globalAttribute("OPENWIRE_SSL_PORT", 6167);
$self->{SITEDB}->globalAttribute("HTCondorCE_PORT", 9619);
}

# TODO:
Expand Down
53 changes: 26 additions & 27 deletions src/modules/NCG/LocalMetricsAttrs/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package NCG::LocalMetricsAttrs::File;

use NCG::LocalMetricsAttrs;
use strict;
use Text::CSV_XS;
use vars qw(@ISA);

@ISA=("NCG::LocalMetricsAttrs");
Expand Down Expand Up @@ -70,39 +71,37 @@ sub _loadMetricAttrs {
my $services = shift;
my $line;
my $fileHndl;
my $csv = Text::CSV_XS->new( {sep_char=>'!'} );

foreach my $file (keys %{$self->{DB_FILES}}) {
if (!open ($fileHndl, $file)) {
$self->error("Cannot open static file!");
return 0;
}
while ($line = <$fileHndl>) {
next if ($line =~ /^\s*#.*$/);
if ($line =~ /^\s*(\S+?)!(\S+?)!(\S.*?)(!(\S.*?))?(!(\S.*?))?\s*$/) {
my $action = $1;
if ($action eq "ATTRIBUTE") {
$attributes->{global}->{$2} = $3;
} elsif ($action eq "HOST_ATTRIBUTE") {
$hosts->{global}->{$2}->{$3} = $5;
} elsif ($action eq "SERVICE_ATTRIBUTE") {
$services->{global}->{$2}->{$3} = $5;
} elsif ($action eq "VO_ATTRIBUTE") {
$attributes->{vo}->{$2}->{$3} = $5;
} elsif ($action eq "VO_HOST_ATTRIBUTE") {
$hosts->{vo}->{$2}->{$3}->{$5} = $7;
} elsif ($action eq "VO_SERVICE_ATTRIBUTE") {
$services->{vo}->{$2}->{$3}->{$5} = $7;
} elsif ($action eq "GLOBAL_ATTRIBUTE") {
$globalAttributes->{global}->{$2} = $3;
} elsif ($action eq "VO_GLOBAL_ATTRIBUTE") {
$globalAttributes->{vo}->{$2}->{$3} = $5;
} elsif ($action eq "HOST_ARRAY_ATTRIBUTE") {
$hosts->{array}->{$2}->{$3} = $5;
} elsif ($action eq "VO_HOST_ARRAY_ATTRIBUTE") {
$hosts->{vo_array}->{$2}->{$3}->{$5} = $7;
} else {
$self->debug("Unknown command found: $1");
}
while (my $row = $csv->getline ($fileHndl)) {
my $action = $row->[0];
if ($action eq "ATTRIBUTE") {
$attributes->{global}->{$row->[1]} = $row->[2];
} elsif ($action eq "HOST_ATTRIBUTE") {
$hosts->{global}->{$row->[1]}->{$row->[2]} = $row->[3];
} elsif ($action eq "SERVICE_ATTRIBUTE") {
$services->{global}->{$row->[1]}->{$row->[2]} = $row->[3];
} elsif ($action eq "VO_ATTRIBUTE") {
$attributes->{vo}->{$row->[1]}->{$row->[2]} = $row->[3];
} elsif ($action eq "VO_HOST_ATTRIBUTE") {
$hosts->{vo}->{$row->[1]}->{$row->[2]}->{$row->[3]} = $row->[4];
} elsif ($action eq "VO_SERVICE_ATTRIBUTE") {
$services->{vo}->{$row->[1]}->{$row->[2]}->{$row->[3]} = $row->[4];
} elsif ($action eq "GLOBAL_ATTRIBUTE") {
$globalAttributes->{global}->{$row->[1]} = $row->[2];
} elsif ($action eq "VO_GLOBAL_ATTRIBUTE") {
$globalAttributes->{vo}->{$row->[1]}->{$row->[2]} = $row->[3];
} elsif ($action eq "HOST_ARRAY_ATTRIBUTE") {
$hosts->{array}->{$row->[1]}->{$row->[2]} = $row->[3];
} elsif ($action eq "VO_HOST_ARRAY_ATTRIBUTE") {
$hosts->{vo_array}->{$row->[1]}->{$row->[2]}->{$row->[3]} = $row->[4];
} else {
$self->debug("Unknown command found: $action");
}
}
close ($fileHndl);
Expand Down

0 comments on commit c2a71ed

Please sign in to comment.