From a7fa2d2251bbf0a3859840004ff0d39cfb484bd2 Mon Sep 17 00:00:00 2001 From: saiprakash Date: Tue, 14 Oct 2008 18:13:00 +0000 Subject: [PATCH] modified cron script for PCP git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2346 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/pcp_collect | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT-server/sbin/pcp_collect b/xCAT-server/sbin/pcp_collect index 20c0dfeba..7facf4ccd 100755 --- a/xCAT-server/sbin/pcp_collect +++ b/xCAT-server/sbin/pcp_collect @@ -87,10 +87,21 @@ sub performance #print "the array has $count_spl1 elements \n"; #print "@spl1[0] \n"; #print "@spl1[1] \n"; - my $count3= `cat $::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config | wc -l`; + #my $count3= `cat $::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config | wc -l`; #print "the number of lines in the file is count3:$count3 \n"; #`tr "\n" "§" <$::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config> $::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config.tr`; - my $fname = "$::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config"; + my $fname; + if (-e "/var/log/pcpmon.config") + { + #print "config under /var/log \n"; + $fname="/var/log/pcpmon.config"; + } + else + { + #print "config not under /var/log \n"; + $fname = "$::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config"; + } + print "config file is in $fname \n"; unless ( open( CONF, $fname )) { return(0);