I've got it setup as a data input method and a data source, but, I can't work out quite what to put where when I'm creating the graph. It'll only ever return 1 or 0 but I want to plot that so I can see historically when it's up and down.
Please can you advise how I'd setup the graph in graph management.
This is the perl file (might not be grate as I'm no perl dev)...
Code: Select all
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
my $content;
my $urlvar = $ARGV[0];
my $ua = new LWP::UserAgent;
$ua->timeout(3);
$ua->agent("WLD-Monitor/1.0");
my $req = new HTTP::Request GET => $urlvar;
my $res = $ua->request($req);
if ($res->is_success)
{
$content= $res->content;
if($content =~ m/verified/i) {
print "1";
} else {
print "0";
}
}
else
{
die "0";
}
Thanks in advance,
Ian