diff --git a/sbin/spectre.pl b/sbin/spectre.pl index 884750501..c3b82d1a0 100644 --- a/sbin/spectre.pl +++ b/sbin/spectre.pl @@ -24,6 +24,7 @@ my $daemon; my $run; my $debug; my $test; +my $status; GetOptions( 'help'=>\$help, @@ -31,11 +32,12 @@ GetOptions( 'shutdown'=>\$shutdown, 'daemon'=>\$daemon, 'debug' =>\$debug, + 'status' => \$status, 'run' => \$run, 'test' => \$test ); -if ($help || !($ping||$shutdown||$daemon||$run||$test)) { +if ($help || !($ping||$shutdown||$daemon||$run||$test||$status)) { print <runTests($config); } elsif ($run) { @@ -123,3 +129,19 @@ sub ping { return 0 if ($result eq "pong"); return 1; } + +sub getStatusReport { + my $remote = create_ikc_client( + port=>$config->get("port"), + ip=>$config->get("ip"), + name=>rand(100000), + timeout=>10 + ); + return $POE::Component::IKC::ClientLite::error unless $remote; + my $result = $remote->post_respond('workflow/getStatus'); + return $POE::Component::IKC::ClientLite::error unless defined $result; + $remote->disconnect; + undef $remote; + return $result; +} +