Hmmm, dann sollte dies so funktionieren?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/perl
use strict;
use warnings;
my @infos;
while(my $line = <DATA>){
my ($port) = $line =~ /ifLastChange\.(\d+)/;
my ($time) = $line =~ /Timeticks:\s\((\d+)\)/;
push(@infos,$port,$time);
}
#--
# create a chart
#--
my @data = qw(20 25 60 25 40 10 100 35 50 55);
my $result = qx{snmpwalk -v 1 -c public <host> ifLastChange};
my $chart = Chart::Plot->new();
$chart->setData(\@data);
my $output = '/sandia/vol0/home/cheggler/test.gif';
open(GIF,">$output") or die $!;
binmode GIF;
print GIF $chart->draw('gif');
close GIF;
Ich habe wirklich keine Ahnung von Perl....okay, bin nun am lesen des Oreilly Programming Perl....aber das ist ein relativ dicker Schunken... ;-)