From: Arne Fitzennreiter Date: Wed, 22 Oct 2008 17:59:00 +0000 (+0200) Subject: Disabled some graphs if data is collected yet X-Git-Tag: v2.3-rc1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=301146259c965fd27daa0892b7bc606cd35aa7e0;p=ipfire-2.x.git Disabled some graphs if data is collected yet --- diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index c4e54f9d23..f1774afa02 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -107,19 +107,25 @@ if ( $querry[0] =~ "hwtemp"){ &Header::closebox(); } - if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*` ) { + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/temperature-*` ) { &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day"); &Header::closebox(); + } + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/fanspeed-*` ) { &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); &Header::closebox(); + } + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/voltage-*` ) { &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","375"); &Header::closebox(); + } + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*` ) { sensorsbox(); } &Header::closebigbox(); diff --git a/html/cgi-bin/memory.cgi b/html/cgi-bin/memory.cgi index 35ce7a0f11..a0a01b095e 100644 --- a/html/cgi-bin/memory.cgi +++ b/html/cgi-bin/memory.cgi @@ -56,9 +56,11 @@ if ( $querry[0] =~ "memory"){ &Graphs::makegraphbox("memory.cgi","memory","day"); &Header::closebox(); - &Header::openbox('100%', 'center', "Swap $Lang::tr{'graph'}"); - &Graphs::makegraphbox("memory.cgi","swap","day"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/swap` ) { + &Header::openbox('100%', 'center', "Swap $Lang::tr{'graph'}"); + &Graphs::makegraphbox("memory.cgi","swap","day"); + &Header::closebox(); + } &Header::openbox('100%', 'center', $Lang::tr{'memory'}); print "";