Disabled some graphs if data is collected yet

This commit is contained in:
Arne Fitzennreiter
2008-10-22 19:59:00 +02:00
parent 4d7ee3d878
commit 301146259c
2 changed files with 12 additions and 4 deletions

View 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();

View 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'>";