http://192.168.1.1/cgi-bin/show-image.cgi?service=test_cpu&host=test_host&width=600&title=Hourly View&start=now-1h
1
2
3
4
#!/usr/bin/perl
use LWP::Simple;
getstore("http://192.168.1.1/cgi-bin/show-image.cgi?service=test_cpu&host=test_host&width=600&title=Hourly View&start=now-1h", "/home/test.jpg");
exit;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use LWP::Simple; my $logged_user = getlogin() or die "Error: Cant fetch logged user's name"; my $url = shift || 'http://192.168.1.1/cgi-bin/show-image.cgi?service=test_cpu&host=test_host&width=600&title=Hourly View&start=now-1h'; my $dest_file = shift || "/home/$logged_user/test.jpg'; my $content = get($url) or die "Error: Cant fetch $url\n"; open (my $fh, ">", $dest_file) or die "Error: open $dest_file # $!\n"; binmode $fh; print $fh $content; close ($fh) or die "Error: close $dest_file # $!\n"; exit;