Indeed htmlspecialchars will do that however it's not used in stacked.php at least not in the Github repo. You could try and comment out this line

https://github.com/ganglia/ganglia-web/blob/master/functions.php#L1416

Then look in /tmp for a ganglia-graph file with full invocation to make sure that output is somehow not getting encoded.

Vladimir

On 2/15/24 16:08, Sun, Zhongdong wrote:

Hi Vladimir,

Thanks for your quick response.

As I understand, the apostrophe or single quote will be converted to *&#39* with the PHP function htmlspecialchars because it’s considered as a special character. See this: PHP: htmlspecialchars - Manual <https://www.php.net/htmlspecialchars>. Later, we can convert it back with function htmlspecialchars_decode if needed. I search the folder /usr/share/ganglia and find a lot of instances of htmlspecialchars but don’t know which one cause this problem. I’m not familiar with Ganglia and don’t know how to debug further. This seems to happen in many Rocky 8.4 machines, all are fresh installed. The ganglia-web version is 3.7.5-40. Could you please provide more advice how to debug this?

Thanks.

Zhongdong

*From:*Vladimir Vuksan <[email protected]>
*Sent:* Thursday, February 15, 2024 10:56 AM
*To:* [email protected]
*Subject:* Re: [Ganglia-general] stacked graph not working

It looks like a command line arguments encoding issue somewhere around here

https://github.com/ganglia/ganglia-web/blob/master/functions.php#L1410

Not sure why apostrophe is being replaced with &#39;. That's breaking the rrdtool invocation. You will need to investigate how to change that behavior.

Vladimir

On 2/14/24 12:19, Sun, Zhongdong wrote:

    Hi everyone,

    We just installed a new instance of Ganglia on Rocky OS 8.4.
    Everything works well except the stacked graph doesn’t show up. I
    searched this forum and found a few similar cases. For example,
    Janet reported this issue in 2021, but in a CentOS 7 system.
    Vladimir provided some solution but didn’t work in Rocky 8 system.
    I also following some instructions for debug. Copied the address
    of the stacked graph and appended ‘&debug=5’, which produced a
    command like this.

    /usr/bin/rrdtool graph -  -E --start \&\#039\;-3600s\&\#039\;
    --end \&\#039\;N\&\#039\; --width 700 --height 300 --title
    \&\#039\; aggregated load_one last hour\&\#039\; --upper-limit
    \&\#039\;0\&\#039\; --lower-limit \&\#039\;0\&\#039\; CDEF:total=0
    CDEF:mean=total,0,/ CDEF:last_total=total,POP,0
    CDEF:last_mean=last_total,0,/ COMMENT:'\j'
    GPRINT:'total':AVERAGE:'Avg Total\: %5.2lf'
    GPRINT:'last_total':LAST:'Current Total\: %5.2lf\c'
    GPRINT:'mean':AVERAGE:'Avg Average\: %5.2lf'
    GPRINT:'last_mean':AVERAGE:'Current Average\: %5.2lf\c'

    When I ran this command in the machine, I got this result.

    ERROR: start time: unparsable time: &&#039;-3600s&#039;

    Does anyone know what can cause this? It seems a bug in
    stacked.php or relative program, but I’m not familiar with this
    and cannot figure it out.

    By the way, we have been using Ganglia for a long time. It works
    perfectly in CentOS 7. But we have to upgrade CentOS 7 since it’s
    near end-of-life.

    Any help would be appreciated.

    Zhongdong




    _______________________________________________

    Ganglia-general mailing list

    [email protected]

    https://lists.sourceforge.net/lists/listinfo/ganglia-general
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to