[Orca-users] Error in script data_gatherers/aix/orca-aix-stat.pl

VIRY Fr=?utf-8?B?w6k=?=d=?utf-8?B?w6k=?=ric USEI Est frederic.viry at francetelecom.com
Mon Jul 12 01:58:57 PDT 2004


Here are the modifications.
The command " diff -u " doesn't function so I use this one.

Regards,
Frédéric Viry



diff -c orca-aix-stat.pl.in orca-aix-stat.pl.in.new
*** orca-aix-stat.pl.in         Fri Jul  9 07:20:41 2004
--- orca-aix-stat.pl.in.new     Mon Jul 12 10:35:09 2004
***************
*** 175,186 ****
      }
      @upt = split(/ +/,);
      $uptd = $upt[3];
-     $nusr = $upt[6];
      $up_day = $uptd * 24 * 60 * 60;
!     if (/days,\s+(\S+):(\S+), /) {
!       $up_hrs = $1 * 60 * 60;
!       $up_min = $2 * 60;
!     }
      $uptime = $up_day + $up_hrs + $up_min;
    }
    close IN;
--- 175,221 ----
      }
      @upt = split(/ +/,);
      $uptd = $upt[3];
      $up_day = $uptd * 24 * 60 * 60;
!
!     if (/day(?:s?),\s+(\S+)\s+min(?:s?),/) {
!       $nusr = $upt[7];
!       $up_hrs = 0;
!       $up_min = $1 * 60;
!      }
!      elsif (/day(?:s?),\s+(\S+)\s+hr(?:s?),/) {
!        $nusr = $upt[7];
!        $up_min = 0;
!        $up_hrs = $1 * 60 * 60;
!      }
!      elsif (/day(?:s?),\s+(\S+):(\S+), /) {
!         $nusr = $upt[6];
!         $up_hrs = $1 * 60 * 60;
!         $up_min = $2 * 60;
!      }
!      elsif ( $_ !~ /day/ ) {
!         $up_day = 0;
!         if ( /\s+(\S+):(\S+),/) {
!           $nusr = $upt[4];
!           $up_hrs = $1 * 60 * 60;
!           $up_min = $2 * 60;
!         }
!         elsif ( /\s+(\S+)\s+min(?:s?),/) {
!           $nusr = $upt[5];
!           $up_hrs = 0;
!           $up_min = $1 * 60;
!         }
!         elsif ( /\s+(\S+)\s+hr(?:s?),/) {
!           $nusr = $upt[5];
!           $up_min = 0;
!           $up_hrs = $1 * 60 * 60;
!         }
!       }
!       else {
!         $nusr = $upt[5];
!         $up_min = 0;
!         $up_hrs = 0;
!       }
!
      $uptime = $up_day + $up_hrs + $up_min;
    }
    close IN;
***************
*** 587,593 ****
    }
    print OUT $out_info, "\n";

!   sleep $INTERVAL - (time() - $timestamp);
  }
  close OUT;

--- 622,630 ----
    }
    print OUT $out_info, "\n";

!   if ( $iterations != 0 ) {
!     sleep $INTERVAL - (time() - $timestamp);
!   }
  }
  close OUT;

-----Message d'origine-----
De : Blair Zajac [mailto:blair at orcaware.com]
Envoyé : mercredi 7 juillet 2004 05:15
À : VIRY Frédéric USEI Est
Cc : orca-users at orcaware.com
Objet : Re: [Orca-users] Error in script
data_gatherers/aix/orca-aix-stat.pl


VIRY Frédéric USEI Est wrote:
> Hello,
>
> If command "uptime" displays :
>
> 04:16PM   up 179 days, 41 mins,  2 users,  load average: 1.07, 1.13, 1.15
>
>
> the script orca-aix-stat.pl gives incorrect values for $uptime and $nusr.
>
> Here are the corrected lines :

Hello Frédéric,

Thanks for sending this along.

Could you send a patch for the work you did?  It'll make it easier to get
the
changes into the Orca distribution, as it automatically modifies our source
code.  This is also the standard way of sending modification to source code
packages.

The way to do that is:

1) Get a copy of the original, unmodified file (saved with a different name
than
your file).
2) Run this command

diff -u ORIGINAL_FILENAME MODIFIED_FILENAME > orca-aix-stat.pl-patch.txt

and email that file to orca-users at orcaware.com.

Thanks,
Blair

--
Blair Zajac <blair at orcaware.com>
Plots of your system's performance - http://www.orcaware.com/orca/




More information about the Orca-users mailing list