From 1b9f6bc02f29672bc3d16abd2b59009033313492 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Thu, 15 Mar 2012 10:40:31 +0000 Subject: [PATCH] fix bug 3505088 for ganglia monitor page not stable git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11860 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/xcat/plugins/web.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/xcat/plugins/web.pm b/xCAT-UI/xcat/plugins/web.pm index d7b2d4b67..5234291fb 100644 --- a/xCAT-UI/xcat/plugins/web.pm +++ b/xCAT-UI/xcat/plugins/web.pm @@ -761,6 +761,7 @@ sub web_gangliaLatest{ my $telnetcmd = ''; my $connect; my $xmloutput = ''; + my $tmpFilename = '/tmp/gangliadata'; $ganglia_return_flag = 0; $gangliaclustername = ''; @@ -773,10 +774,12 @@ sub web_gangliaLatest{ if ('grid' eq $type){ $xmlparser = XML::Parser->new(Handlers=>{Start=>\&web_gangliaGridXmlStart, End=>\&web_gangliaXmlEnd}); $telnetcmd = "/?filter=summary\n"; + $tmpFilename = '/tmp/gangliagriddata'; } elsif('node' eq $type){ $xmlparser = XML::Parser->new(Handlers=>{Start=>\&web_gangliaNodeXmlStart, End=>\&web_gangliaXmlEnd}); $telnetcmd = "/\n"; + $tmpFilename = '/tmp/ganglianodedata'; } #use socket to telnet 127.0.0.1 8652(ganglia's interactive port) @@ -787,14 +790,14 @@ sub web_gangliaLatest{ } print $connect $telnetcmd; - open(TEMPFILE, '>/tmp/gangliadata'); + open(TEMPFILE, '>' . $tmpFilename); while(<$connect>){ print TEMPFILE $_; } close($connect); close(TEMPFILE); - $xmlparser->parsefile('/tmp/gangliadata'); + $xmlparser->parsefile($tmpFilename); if ('grid' eq $type){ web_gangliaGridLatest($callback);