Forum Discussion
Geronimo_Martin
Nimbostratus
Mar 10, 2016External Monitor on Perl
Hi, I have set this External Monitor, on a BIG-IP Virtual, just whit GTM:
use LWP::UserAgent;
my $url = '';
my $timeout = 20;
my $agent = 'MA Performance Test Agent';
my $username ...
CharlesCS
Cirrus
Mar 10, 2016When invoked as an external monitor, the perl "print" command with no other options returns the printed text to the bigd daemon (which invoked the monitor script) rather than displaying the printed text on the console.
The sample perl monitor (/config/monitors/arg_example) shows how to send results to a file instead of return them bigd:
Open the output file
my $outfile = "/var/arg_ex_out";
open( OUTF, ">>$outfile" );
Print the command line args
my $cmdlinearg = 0;
print OUTF "---- Command Line Args ----\n";
while( $cmdlinearg = shift @ARGV ) {
print OUTF $cmdlinearg, "\n";
}
Remember that any data returned via the "print" command to bigd is interpreted as a successful monitor probe:
Arbitrarily tell bigd that the node is up.
print "up\n";
exit(0);
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects