#! /usr/bin/perl use strict; use warnings; my @infos; while(my $line = ){ 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 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;