pcp
[Top] [All Lists]

pcp 2.3.0 with recent core utils

To: pcp@xxxxxxxxxxx
Subject: pcp 2.3.0 with recent core utils
From: Anas Nashif <nashif@xxxxxxxxxx>
Date: Thu, 19 Jun 2003 01:16:09 -0400
Sender: pcp-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.4) Gecko/20030527
Hi,

utilities like tail, head and sort are stricter now with regard to command line options. The following patch fixes the problem.

I had to patch to make pcp build for upcoming SuSE release.


Cheers, Anas
--- src/pmdas/weblog/Web.Allservers.pmchart
+++ src/pmdas/weblog/Web.Allservers.pmchart
@@ -5,8 +5,8 @@
 echo "/\"/s///g" >$tmp.sed
 
 pmprobe -I $* web.perserver.bytes.cached.total web.perserver.bytes.total > 
$tmp.pmprobe
-l1=`head -1 $tmp.pmprobe`
-l2=`tail -1 $tmp.pmprobe`
+l1=`head -n 1 $tmp.pmprobe`
+l2=`tail -n 1 $tmp.pmprobe`
 
 num_caches=`echo $l1 | cut -f2 -d\ `
 num_servers=`echo $l2 | cut -f2 -d\ `
--- src/pmdas/weblog/Web.Perserver.Bytes.pmchart
+++ src/pmdas/weblog/Web.Perserver.Bytes.pmchart
@@ -6,8 +6,8 @@
 echo "/\"/s///g" >$tmp.sed
 
 pmprobe -I $* web.perserver.bytes.cached.total web.perserver.bytes.total > 
$tmp.pmprobe
-l1=`head -1 $tmp.pmprobe`
-l2=`tail -1 $tmp.pmprobe`
+l1=`head -n 1 $tmp.pmprobe`
+l2=`tail -n 1 $tmp.pmprobe`
 
 num_caches=`echo $l1 | cut -f2 -d\ `
 num_servers=`echo $l2 | cut -f2 -d\ `
--- src/pmdas/weblog/Web.Perserver.Requests.pmchart
+++ src/pmdas/weblog/Web.Perserver.Requests.pmchart
@@ -6,8 +6,8 @@
 echo "/\"/s///g" >$tmp.sed
 
 pmprobe -I $* web.perserver.bytes.cached.total web.perserver.bytes.total > 
$tmp.pmprobe
-l1=`head -1 $tmp.pmprobe`
-l2=`tail -1 $tmp.pmprobe`
+l1=`head -n 1 $tmp.pmprobe`
+l2=`tail -n 1 $tmp.pmprobe`
 
 num_caches=`echo $l1 | cut -f2 -d\ `
 num_servers=`echo $l2 | cut -f2 -d\ `
--- src/pmdas/weblog/server.sh
+++ src/pmdas/weblog/server.sh
@@ -545,7 +545,7 @@
                        num_lines=`wc -l $access | $PCP_AWK_PROG '{print $1}'`
                        if [ $num_lines -gt 1 ]
                        then
-                           num_fields=`tail -1 $access | cut -f3 -d\" | wc -w`
+                           num_fields=`tail -n 1 $access | cut -f3 -d\" | wc 
-w`
                            if [ $num_fields -eq 11 ]
                            then
                                accessRegex="NS_PROXY"
--- src/pmns/Make.stdpmid
+++ src/pmns/Make.stdpmid
@@ -76,7 +76,7 @@
        -e '/^LAB /s/254/246/' \
        -e '/^ASH /s/7/11/'
 done \
-| sort -n +1 -2 \
+| sort -n -k2,3 \
 | uniq >$tmp.tmp
 
 error=false
<Prev in Thread] Current Thread [Next in Thread>
  • pcp 2.3.0 with recent core utils, Anas Nashif <=