-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCTASK0050554 Merge pull request #115 from veorlo/master
SCTASK0050554 New bugfix version for Cisco CPU collections
- Loading branch information
Showing
11 changed files
with
180 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ dist/* | |
# Editor tempfiles | ||
~* | ||
*~ | ||
*.bak | ||
*.swp | ||
redis_config.xml | ||
conf/redis_config.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NAME=simp | ||
VERSION=1.4.1 | ||
VERSION=1.4.2 | ||
|
||
.PHONY: dist | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
log4perl.rootLogger = DEBUG, SYSLOG, STDOUT | ||
|
||
log4perl.appender.SYSLOG = Log::Dispatch::Syslog | ||
log4perl.appender.SYSLOG.min_level = info | ||
log4perl.appender.SYSLOG.facility = LOCAL0 | ||
log4perl.appender.SYSLOG.layout = PatternLayout | ||
log4perl.appender.SYSLOG.layout.ConversionPattern = [%d] %F %L %c - %m%n | ||
|
||
log4perl.appender.STDOUT = Log::Log4perl::Appender::Screen | ||
log4perl.appender.STDOUT.min_level = debug | ||
log4perl.appender.STDOUT.ident = $YOUR_APPLICATION_NAME | ||
log4perl.appender.STDOUT.facility = LOCAL0 | ||
log4perl.appender.STDOUT.layout = PatternLayout | ||
log4perl.appender.STDOUT.layout.ConversionPattern = [%d] %L %c - %m%n | ||
|
||
log4perl.filter.RMQ = sub{ !/(on_response_[bcd]{2})|(Pending Responses)|(RabbitMQ)|(Method Name:)|(Binding Simp)|(QoS)|(Topic: Simp)|(Correlation ID:)|(Moving on\.\.\.)|(Running name)|(total time:)|(Params: \$VAR1 \=)/} | ||
|
||
log4perl.appender.STDOUT.Filter = RMQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Time::HiRes qw(usleep gettimeofday tv_interval); | ||
use Data::Dumper; | ||
use GRNOC::RabbitMQ::Client; | ||
use AnyEvent; | ||
use Getopt::Long; | ||
|
||
# Command line usage and parameters | ||
sub usage { | ||
my $text = <<"EOM"; | ||
Usage: $0 [--composite <composite_name>] [--hosts <host names comma-separated] [--iter <iterations>] | ||
EOM | ||
print $text; | ||
exit( 1 ); | ||
} | ||
|
||
my $composite; | ||
my $hosts; | ||
my $iter; | ||
my $help; | ||
GetOptions( | ||
'composite|c=s' => \$composite, | ||
'hosts=s' => \$hosts, | ||
'iter|i=s' => \$iter, | ||
'help|h|?' => \$help | ||
) or usage(); | ||
|
||
usage() if $help; | ||
|
||
# RabbitMQ Client Setup | ||
my $client = GRNOC::RabbitMQ::Client->new( | ||
host => "RabbitMQ HOST IP", | ||
port => 5672, | ||
user => "RabbitMQ USERNAME", | ||
pass => "RabbitMQ PASSWORD", | ||
exchange => 'Simp', | ||
timeout => 60, | ||
debug => 1, | ||
topic => 'Simp.Comp' | ||
); | ||
|
||
# An array of hosts to request data for | ||
my @nodes = ( | ||
'hostname1', | ||
'hostname2' | ||
); | ||
|
||
# Continue to request data from Simp.Comp on "interval" seconds | ||
my $timer = AnyEvent->timer( | ||
interval => 30, | ||
cb => sub { get(\@nodes); } | ||
); | ||
|
||
AnyEvent->condvar->recv; | ||
|
||
sub get { | ||
|
||
my $nodes = shift; | ||
|
||
# Request data for each node | ||
foreach my $node (@{$nodes}) { | ||
|
||
# Send RabbitMQ request for Simp.Comp to compute data for COMPOSITE_NAME | ||
my $data = $client->COMPOSITE_NAME( | ||
node => $node, | ||
period => 30, | ||
async_callback => sub { warn Dumper(shift); } | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters