Menu

#191 Graphs don´t display on Windows 2000

to_be_fixed_later
open
nobody
5
2004-10-15
2004-09-01
jacalvo
No

The graphs aren't displaying using rrdtool-1.0.48. I am
using as server a Windows 2000 with BigSister 0.99b2.

When bsgraph makes it's call to $rrd->rrd_graph(),
dumps the graph to a tmp file and then it´s copied to
STDOUT. But with this version of rrdtool it writes the
image size to STDOUT after creating the graph (i.e.
495x192). This corrupts the STDOUT and makes the
graph undisplayable.

To solve this I have changed the call to $rrd->rrd_graph
() to dump the file to STDOUT and it works. I don´t
know much this can be portable.

Graph file creation and presentation seems like this for
me:
$| = 1;
print "Pragma: no-cache\n";
print "Cache-control: no-cache\n";
print "Content-Type: image/$format\n\n";
# binmode will fail if using FCGI;
eval {
binmode STDOUT;
};
$rrd->rrd_graph( "-", @args );

As you can see I have removed the 'if' sentence based
on '$Platform::has_fork' because there is no diferences
in the call to $rrd->rrd_graph().

Hope this helps,

Good job!

jacalvo

Discussion

  • Super Durand

    Super Durand - 2004-10-05

    Logged In: YES
    user_id=1132747

    hi,

    (sorry for my bad english)

    i have too the same problem, but your post don't solve the
    problem.

    with out your solution, i don't have the graph (picture don't
    display), but not error.

    with your solution, (removed the "if" sentence), i have a error
    for generate the graph.

    do you have any idea ? i have searching for long time now, all
    is working correctly, but not graph. if it's working for you, can
    you help me ?

    my config : bigsister v0.99b2
    active perl 5.8 (+win32 daemon + gd + rrdtool 1.0.48)
    cygwin
    ...
    working on windows XP Pro

    thanks.

     
  • jacalvo

    jacalvo - 2004-10-06

    Logged In: YES
    user_id=1114480

    hi

    Answering to super_durand...

    Sorry, I have not any Windows XP to test at this moment.
    But If you can make the following test I could help you. With
    your browser ask for a graph but directly with the URL that
    invokes the CGI
    like "http://10.1.133.165:8080/bigsis/cgi/bsgraph?
    HOST=jcalvoco&ZOOM=100&MODE=html&GRAPH=jcalvoco.proc
    esstable&GRAPH=jcalvoco.cpu&GRAPH=jcalvoco.memory&GRAP
    H=jcalvoco.netbytes&GRAPH=jcalvoco.packets&DAYS=7" for
    example. This will show a screen probably with errors, dont
    mind. With the option of your browser to see the source code
    of the HTML page you will see the full answer of your CGI and
    what is wrong. This is the way I discovered the malfunction
    and the way to correct it in my case.

    If you want I can help you with the HTML response. Please
    send me the HTML source code and the bsgraph modified with
    my changes. The best way it's to submit it to [bigsister-
    general] mailing list...

    Hope I could help you...

     
  • Super Durand

    Super Durand - 2004-10-06

    Logged In: YES
    user_id=1132747

    thanks for your reply, but your URL is not working actually,
    maybe are you shutdown your computer temporary ?

    for info, when i connect in localhost with
    http://localhost/bigsis/cgi/bsgraph.cgi?
    HOST=gemini&GRAPH=gemini%2eservice_nr%
    53ervices&DAYS=2&MODE=html, the source code is following :

    -------------------------------------
    <HTML>
    <HEAD>
    <TITLE>Big Sister</TITLE>
    </HEAD>

    <FRAMESET framespacing="0" border=0 frameborder="0"
    cols="250,*">
    <FRAME SRC="index1.html" border=0 frameborder=0
    marginheight="20" NAME="Contents"
    TARGET="Text">

    <FRAMESET framespacing="0" border=0 frameborder="0"
    rows="*,50">
    <FRAME SRC="top.html" NAME="Text" border=0
    frameborder=0>
    <FRAME SRC="index3.html" NAME="Legend" scrolling=no
    border=0 frameborder=0>
    </FRAMESET>
    </FRAMESET>

    </HTML>
    -------------------------------------

    there are not error, i have the line "Show XXX at zoom factor
    YYY. UPDATE".
    i have just a cross instead of picture graph, like as picture
    don't exist.

    if you have any time, i can give you access to my xp with
    Terminal Server, but i don't want disturb you, if you don't
    want, i will understand (but if ok, i don't want put HERE my ip
    perso for access, i give it only by mail).

    thanks a lot for help me

    see you soon.

     
  • Super Durand

    Super Durand - 2004-10-11

    Logged In: YES
    user_id=1132747

    hello jacalvo

    have a long time i'm without news from you. i hope your
    always OK for help me, i don't understand why graph don't
    display, but if all is working for you, maybe can you help me ?

    my URL is : http://81.57.214.50/bigsis

    like you can see, all is working correctly ... the only one who
    not working is display graphics.

    if you want access to my computer with tse client, so write
    me to airrass@yahoo.com please, i give you a access if you
    have test to make, it's a test machine, so you can crash
    system, it's not a problem.

    in hope of news from you ...

    thanks.
    David

     
  • jacalvo

    jacalvo - 2004-10-15

    Logged In: YES
    user_id=1114480

    After some commentrs and conversations with super_duran
    I think that I didnt explained well when I wrote the bug
    note. The final code of the sub one_pass modified by me is as
    follows (and there is not more code):

    sub one_pass {

    .... # code of the sub

    # last part of the original code
    my $legend = $graph->{"legend"};
    $legend =~ s/:/ /g;
    if ($graph->{"grtype"} =~ /stack/){
    if ($i == 0){
    push( @args, "AREA:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    } else {
    push( @args, "STACK:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    }
    } elsif ($graph->{"grtype"} =~ /area/){
    push( @args, "AREA:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    } else {
    push( @args, "LINE2:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    }
    }

    # JAC: The original code finish here, following the
    code for Windows systems

    $| = 1;
    print "Pragma: no-cache\n";
    print "Cache-control: no-cache\n";
    print "Content-Type: image/$format\n\n";
    # binmode will fail if using FCGI;
    eval {
    binmode STDOUT;
    };
    $rrd->rrd_graph( "-", @args );
    }
    # end of sub one_pass

    Ending with this, this code works on Windows 2000 and
    Windows XP with Bigsister 0.99b2 and rrdtool 1.0.48.

     
  • jacalvo

    jacalvo - 2004-10-15
    • milestone: 102614 --> to_be_fixed_later
     
  • jacalvo

    jacalvo - 2004-10-15

    Logged In: YES
    user_id=1114480

    After some commentrs and conversations with super_duran
    I think that I didnt explained well when I wrote the bug
    note. The final code of the sub one_pass modified by me is as
    follows (and there is not more code):

    sub one_pass {

    .... # code of the sub

    # last part of the original code
    my $legend = $graph->{"legend"};
    $legend =~ s/:/ /g;
    if ($graph->{"grtype"} =~ /stack/){
    if ($i == 0){
    push( @args, "AREA:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    } else {
    push( @args, "STACK:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    }
    } elsif ($graph->{"grtype"} =~ /area/){
    push( @args, "AREA:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    } else {
    push( @args, "LINE2:v$i#".($colors[$i]).
    ($legend?":$legend":"") );
    }
    }

    # JAC: The original code finish here, following the
    code for Windows systems

    $| = 1;
    print "Pragma: no-cache\n";
    print "Cache-control: no-cache\n";
    print "Content-Type: image/$format\n\n";
    # binmode will fail if using FCGI;
    eval {
    binmode STDOUT;
    };
    $rrd->rrd_graph( "-", @args );
    }
    # end of sub one_pass

    Ending with this, this code works on Windows 2000 and
    Windows XP with Bigsister 0.99b2 and rrdtool 1.0.48.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.