perfSONAR_PS::Services::MP::Agent::Script - A module that will run a given script and return it's output.
Inherited perfSONAR_PS::Services::MP::Agent::Base class that allows a command to be executed. Specific tools should inherit from this class and override parse() in order to be able to format the command line output in a well understood data structure.
# create and setup a new Agent my $agent = perfSONAR_PS::Services::MP::Agent::Script( $command, $options ); $agent->init(); # collect the results (i.e. run the command) if( $mp->collectMeasurements() == 0 ) { # get the raw datastructure for the measurement print "Results:\n" . $self->results() . "\n"; } # opps! something went wrong! :( else { print STDERR "Command: '" . $self->commandString() . "' failed with result '" . $self->results() . "': " . $agent->error() . "\n"; }
Creates a new agent class
$command = complete path to command line tool to run, eg /bin/myScript.pl $arguments = string of arguments to supply to above script.
accessor/mutator function for the script to execute
accessor/mutator function for the arguments to be supplied to the script
does anything necessary before running the collect() such as modifying the options etc. Check to see that the script exists
Runs the command with the options specified in constructor.
Returns:
-1 = something failed 0 = command ran okay
on success, this method should call the parse() method to determine the relevant performance output from the script.
To install IEPM::PingER::Statistics::RTT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IEPM::PingER::Statistics::RTT
CPAN shell
perl -MCPAN -e shell install IEPM::PingER::Statistics::RTT
For more information on module installation, please visit the detailed CPAN module installation guide.