]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Disabled some graphs if data is collected yet
authorArne Fitzennreiter <arne_f@ipfire.org>
Wed, 22 Oct 2008 17:59:00 +0000 (19:59 +0200)
committerArne Fitzennreiter <arne_f@ipfire.org>
Wed, 22 Oct 2008 17:59:00 +0000 (19:59 +0200)
html/cgi-bin/hardwaregraphs.cgi
html/cgi-bin/memory.cgi

index c4e54f9d232c065c4cf0f50fa98fba7794871729..f1774afa02a079c2d04e269fed81c8d6b79398e9 100644 (file)
@@ -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();
index 35ce7a0f1137882caa80af8c82904c8705f6622e..a0a01b095edbfd5ad1360bf843f94386b738f4dc 100644 (file)
@@ -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 "<table width='95%' cellspacing='5'>";