Hi all,

I ran into a problem with the Perl module RRDs on Solaris 10.

I evaluate a software (pnp, [1]), which stores data into RRD databases and visualises it as a graph. So nothing special. This software uses the RRDs perl module, which comes in CSWrrd. It works on Solaris 8 without any problem, on Solaris 10 nothing happends.

After some digging in forums and chats I downloaded a test script (see below, [2]). It's no problem to run this script on Solaris 8 but Solaris 10 it cores. Can anybody reproduce this? And maybe someone has a solution?

The output on Solaris 8 is as follows:

r...@sol8-cswpkg-test :/root/tmp > ./rrdtest
Last 5 minutes:
1080462300: 5.6
1080462360: 5.7
1080462420: 5.8
1080462480: 5.9
1080462540: 6
1080462600: N/A
Last 30 minutes:
1080460800: 3.5
1080461100: 4
1080461400: 4.5
1080461700: 5
1080462000: 5.5
1080462300: 6
1080462600: N/A
r...@sol8-cswpkg-test :/root/tmp >


On Solaris 10 I get:

r...@ja01 [ja01]:/root/tmp > ./rrdtest
zsh: 17975 segmentation fault (core dumped)  ./rrdtest
r...@ja01 [ja01]:/root/tmp >

Juergen


[1] www.pnp4nagios.org
[2] ftp://ftp.linux-magazin.de/pub/listings/magazin/2004/06/Perl/rrdtest (doesn't work sometimes):

#!/opt/csw/bin/perl
###########################################
# Feed test data to RRD
# Mike Schilli, 2004 ([email protected])
###########################################
use warnings;
use strict;

use RRDs;

my $DB    = "/tmp/mydemo.rrd";
my $start = 1080460200;
my $dst   = "MAX";
my $nof_iterations = 40;
my $end   = $start + $nof_iterations * 60;

RRDs::create(
    $DB, "--step=60",
    "--start=" . ($start-10),
    "DS:load:GAUGE:90:0:10.0",
    "RRA:$dst:0.5:1:5",
    "RRA:$dst:0.5:5:10",
) or
    die "Cannot create rrd ($RRDs::error)";

for(0..$nof_iterations) {
    my $time = $start + $_ * 60;
    my $value = 2 + $_ * 0.1;

    RRDs::update(
        $DB, "$time:$value") or
         die "Cannot update rrd ($!)";
}

print "Last 5 minutes:\n";
fetch($end - 5*60, $end, $dst);

print "Last 30 minutes:\n";
fetch($end - 30*60, $end, $dst);

###########################################
sub fetch {
###########################################
    my($start, $end, $dst) = @_;

    my ($dbstart, $step, $names, $data) =
      RRDs::fetch($DB, "--start=$start",
        "--end=$end", $dst);

    foreach my $line (@$data) {
        print "$start: ";
        $start += $step;
        foreach my $val (@$line) {
          $val = "N/A" unless defined $val;
          print "$val\n";
        }
    }
}

--
Juergen Arndt
_______________________________________________
users mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/users

Reply via email to