[Orca-checkins] r457 - tags/orca/0.27/contrib/procallator
guilherme_chehab at yahoo.com
guilherme_chehab at yahoo.com
Fri Jul 1 07:05:51 PDT 2005
Author: guilherme_chehab at yahoo.com
Date: Fri Jul 1 07:05:23 2005
New Revision: 457
Added:
tags/orca/0.27/contrib/procallator/CHANGES
tags/orca/0.27/contrib/procallator/Makefile.in
tags/orca/0.27/contrib/procallator/gpl.txt
tags/orca/0.27/contrib/procallator/install.sh.in
tags/orca/0.27/contrib/procallator/procallator.cfg.in
tags/orca/0.27/contrib/procallator/procallator.in
tags/orca/0.27/contrib/procallator/update_orca_server.sh.in
Removed:
tags/orca/0.27/contrib/procallator/install.sh
tags/orca/0.27/contrib/procallator/procallator
tags/orca/0.27/contrib/procallator/procallator.cfg
tags/orca/0.27/contrib/procallator/update_orca_server.sh
Modified:
tags/orca/0.27/contrib/procallator/README
tags/orca/0.27/contrib/procallator/TODO
tags/orca/0.27/contrib/procallator/procallator.pl.in
Log:
History change for procallator
- 0.01 first version
- 0.02 fixed some stats of disk usage on NFS disks
- 0.03 License changed to GPL
Multiple files per day if number of columns of the output changes
Added compatibility with 2.6 kernel versions
Added support for /proc/partitions -> partitions stats in 2.4 kernels
Added support for /proc/diskstats -> partitions stats in 2.6 kernels
Removed support for page-ins e page-ous metrics due to misunderstood interpretations real meaning of values
New cfg file, with better handling of tcp stats
Added IO Wait for 2.6 kernels
Using real device names on disk statistics for 2.4 and 2.6 kernels
Added NFS4 statistics, and revised NFS config (now uses totals bye default)
Added configuration variable to control per protocolo colection
Process now starts as a real daemon
Added: tags/orca/0.27/contrib/procallator/CHANGES
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/CHANGES Fri Jul 1 07:05:23 2005
@@ -0,0 +1,15 @@
+History change for procallator
+- 0.01 first version
+- 0.02 fixed some stats of disk usage on NFS disks
+- 0.03 License changed to GPL
+ Multiple files per day if number of columns of the output changes
+ Added compatibility with 2.6 kernel versions
+ Added support for /proc/partitions -> partitions stats in 2.4 kernels
+ Added support for /proc/diskstats -> partitions stats in 2.6 kernels
+ Removed support for page-ins e page-ous metrics due to misunderstood interpretations real meaning of values
+ New cfg file, with better handling of tcp stats
+ Added IO Wait for 2.6 kernels
+ Using real device names on disk statistics for 2.4 and 2.6 kernels
+ Added NFS4 statistics, and revised NFS config (now uses totals bye default)
+ Added configuration variable to control per protocolo colection
+ Process now starts as a real daemon
Added: tags/orca/0.27/contrib/procallator/Makefile.in
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/Makefile.in Fri Jul 1 07:05:23 2005
@@ -0,0 +1,83 @@
+ at SET_MAKE@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+INSTALL = @INSTALL@
+MKDIR = @MKDIR@
+PERL_HEAD = @PERL_HEAD@
+VAR_DIR = @VAR_DIR@
+RRD_DIR = @RRD_DIR@
+RRDTOOL_DIR = @RRDTOOL_DIR@
+PROCALLATOR_DIR = $(VAR_DIR)/procallator
+PERL_SCRIPTS = procallator.pl
+SHELL_SCRIPTS = procallator install.sh update_orca_server.sh
+TARGETS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS)
+
+all: Makefile $(TARGETS) procallator.cfg
+
+install: all
+ $(MKDIR) $(bindir)
+ $(MKDIR) $(libdir)
+ $(MKDIR) $(RRD_DIR)/procallator
+ @for file in $(TARGETS); do \
+ echo $(INSTALL) $$file $(bindir); \
+ $(INSTALL) $$file $(bindir); \
+ done
+ if test -r $(libdir)/procallator.cfg; then \
+ cp -p $(libdir)/procallator.cfg $(libdir)/procallator.cfg.`date +%Y-%m-%d-%H:%M:%S`; \
+ fi
+ $(INSTALL) -m 0644 procallator.cfg $(libdir)
+ $(INSTALL) -m 0755 procallator.pl $(libdir)
+
+procallator_run_at_boot: all
+ -$(RM) /etc/init.d/procallator /etc/rc0.d/K01procallator
+ -$(RM) /etc/rc1.d/K01procallator /etc/rc3.d/S99procallator
+ $(INSTALL) -m 0744 S99procallator /etc/init.d/procallator
+ ln /etc/init.d/procallator /etc/rc0.d/K01procallator
+ ln /etc/init.d/procallator /etc/rc1.d/K01procallator
+ ln /etc/init.d/procallator /etc/rc3.d/S99procallator
+
+clean:
+ $(RM) $(TARGETS) procallator.cfg
+
+distclean: clean
+ $(RM) *.sh Makefile
+
+.SUFFIXES: .pl .sh
+
+.pl: $(PERL_HEAD)
+ cat $(PERL_HEAD) $< > $@
+ chmod 0755 $@
+
+.sh:
+ cp $< $@
+ chmod 0755 $@
+ chmod 0755 procallator
+
+Makefile: Makefile.in
+ cd ../.. && CONFIG_FILES=contrib/procallator/Makefile ./config.status
+ chmod 755 *.pl *.sh procallator
+ $(MAKE)
+
+procallator.cfg: procallator.cfg.in
+ cd ../.. && CONFIG_FILES=contrib/procallator/procallator.cfg ./config.status
+
+procallator.pl: procallator.pl.in $(PERL_HEAD)
+ cd ../.. && CONFIG_FILES=contrib/procallator/procallator.pl ./config.status
+ cat $(PERL_HEAD) procallator.pl > procallator.perl
+ mv procallator.perl procallator.pl
+ chmod 0755 procallator.pl
+
+procallator: procallator.in
+ cd ../.. && CONFIG_FILES=contrib/procallator/procallator ./config.status
+ chmod 0755 procallator
+
+install.sh: install.sh.in
+ cd ../.. && CONFIG_FILES=contrib/procallator/install.sh ./config.status
+ chmod 0755 install.sh
+
+update_orca_server.sh: update_orca_server.sh.in
+ cd ../.. && CONFIG_FILES=contrib/procallator/update_orca_server.sh ./config.status
+ chmod 0755 update_orca_server.sh
Modified: tags/orca/0.27/contrib/procallator/README
==============================================================================
--- tags/orca/0.27/contrib/procallator/README (original)
+++ tags/orca/0.27/contrib/procallator/README Fri Jul 1 07:05:23 2005
@@ -19,5 +19,5 @@
- on the server, run orca using the exmple procallator.cfg
This software is in alpha stage, use at your own risk.
-Any comments to Guilherme Chehab <gchehab at abordo.com.br>
+Any comments to Guilherme Chehab <guilherme_chehab at yahoo.com>
Copyright (C) 2001 Guilherme Carvalho Chehab. All Rights Reserved
Modified: tags/orca/0.27/contrib/procallator/TODO
==============================================================================
--- tags/orca/0.27/contrib/procallator/TODO (original)
+++ tags/orca/0.27/contrib/procallator/TODO Fri Jul 1 07:05:23 2005
@@ -3,7 +3,8 @@
- Document and optimize collectorn source code
- Write better config file for network and NFS stats
- Add web server stats
- - LVM statsi
+ - LVM stats
+ - Organize and modularize code
Copyright (C) 2001 Guilherme Carvalho Chehab. All Rights Reserved
Added: tags/orca/0.27/contrib/procallator/gpl.txt
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/gpl.txt Fri Jul 1 07:05:23 2005
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
Added: tags/orca/0.27/contrib/procallator/install.sh.in
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/install.sh.in Fri Jul 1 07:05:23 2005
@@ -0,0 +1,13 @@
+cp procallator.pl /usr/local/bin
+cp procallator /etc/rc.d/init.d
+ln -s /etc/rc.d/init.d/procallator /etc/rc.d/rc3.d/S99procallator
+ln -s /etc/rc.d/init.d/procallator /etc/rc.d/rc3.d/K10procallator
+ln -s /etc/rc.d/init.d/procallator /etc/rc.d/rc5.d/S99procallator
+ln -s /etc/rc.d/init.d/procallator /etc/rc.d/rc5.d/K10procallator
+chmod 755 /etc/rc.d/init.d/procallator
+chmod 755 /usr/local/bin/procallator.pl
+/etc/rc.d/init.d/procallator start
+echo "Dont forget to copy procallator.cfg to your orca server, and start a new instance of orca using this file as the config file"
+echo "To copy the collected files I suggest the use of rsync"
+echo "This software is in alpha stagge, use at you own risk"
+echo "Copyright (C) 2001 Guilherme Carvalho Chehab. All Rights Reserved"
Added: tags/orca/0.27/contrib/procallator/procallator.cfg.in
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/procallator.cfg.in Fri Jul 1 07:05:23 2005
@@ -0,0 +1,743 @@
+# Orca configuration file for procallator files.
+
+# Require at least this version of Orca
+require Orca 0.265
+
+# base_dir is prepended to the paths find_files, html_dir, rrd_dir,
+# and state_file only if the path does not match the regular
+# expression ^\\?\.{0,2}/, which matches /, ./, ../, and \./.
+base_dir @RRD_DIR@/procallator
+
+# rrd_dir specifies the location of the generated RRD data files.
+rrd_dir .
+
+# state_file specifies the location of the state file that remembers
+# the modification time of each source data file.
+state_file orca.state
+
+# html_dir specifies the top of the HTML tree created by Orca.
+html_dir @HTML_DIR@/procallator
+
+# By default create .meta tag files for all PNGs or GIFs so that the
+# web browser will automatically reload them.
+expire_images 1
+
+# Find files at the following times:
+# 0:10 to pick up new orcallator files for the new day.
+# 1:00 to pick up late comer orcallator files for the new day.
+# 6:00 to pick up new files before the working day.
+# 12:00 to pick up new files during the working day.
+# 19:00 to pick up new files after the working day.
+find_times 0:10 1:00 6:00 12:00 19:00
+
+# This defines the email address of people to warn when a file that is
+# being updated constantly stops being updated. For mathematical
+# expressions use the word `interval' to get the interval number for
+# the data source.
+warn_email root at localhost
+late_interval interval + 30
+
+# These parameters specify which plots to generate.
+generate_hourly_plot 1
+generate_daily_plot 1
+generate_weekly_plot 1
+generate_monthly_plot 1
+generate_quarterly_plot 1
+generate_yearly_plot 1
+
+# This sets the HTML markup that is placed at the very top of every
+# web page and is primarly used to display the site's logo.
+html_page_header <h3>Put your site's logo here.</h3>
+
+# This sets the text that is placed in the pages' <title></title>
+# element and just after the html_page_header HTML markup text is
+# placed on the page.
+html_top_title Orca Host Status
+
+# This sets the HTML markup that is placed at the bottom of every web
+# page.
+html_page_footer
+ <font face="verdana,geneva,arial,helvetica">
+ These plots brought to you by your local system administrator.
+ </font>
+
+
+# This defines where the find the source data files and the format of
+# those files. Notes about the fields:
+# find_files
+# You'll notice that all but the first () has the form (?:...).
+# This tells Perl to match the expression but not save the matched
+# text in the $1, $2, variables. Orca uses the matched text to
+# generate a subgroup name, which is used to place files into
+# different subgroups. Here, only the hostname should be used to
+# generate a subgroup name, hence all the (?:...) for matching
+# anything else.
+# interval
+# The interval here must match the interval used by orcallator to
+# record data. Do not change this, as it has an effect on the
+# generated RRD data files.
+
+group orcallator {
+find_files /usr/local/var/orca/procallator/(.*)/(?:(?:procallator)|(?:proccol))-\d{4}-\d{2}-\d{2}(?:-\d{3,})(?:\.(?:Z|gz|bz2))?
+column_description first_line
+date_source column_name timestamp
+#date_format %s
+interval 300
+reopen 1
+filename_compare sub {
+ my ($ay, $am, $ad) = $a =~ /-(\d{4})-(\d\d)-(\d\d)/;
+ my ($by, $bm, $bd) = $b =~ /-(\d{4})-(\d\d)-(\d\d)/;
+ if (my $c = (( $ay <=> $by) ||
+ ( $am <=> $bm) ||
+ (($ad >> 3) <=> ($bd >> 3)))) {
+ return 2*$c;
+ }
+ $ad <=> $bd;
+ }
+}
+
+plot {
+title %g Average # Processes in Run Queue (Load Average) & number of CPUs
+source orcallator
+data 1runq
+data 5runq
+data 15runq
+data ncpus
+color 00ff00
+color 0000ff
+color ff00ff
+color ff0000
+line_type LINE1
+line_type LINE1
+line_type LINE1
+line_type LINE2
+legend 1 minute average
+legend 5 minute average
+legend 15 minute average
+legend CPUs (load threshold)
+y_legend Number of processes and CPUs
+
+data_min 0
+data_max 100
+href http://www.orcaware.com/orca/docs/orcallator.html#processes_in_run_queue
+}
+
+plot {
+title %g CPU Usage
+source orcallator
+data usr%
+data sys%
+data nice%
+data wait%
+data 100 - usr% - sys% - nice% - wait%
+line_type area
+line_type stack
+line_type stack
+line_type stack
+line_type stack
+legend User
+legend System
+legend Nice
+legend Io Wait
+legend Idle
+y_legend Percent
+data_min 0
+data_max 100
+plot_min 0
+plot_max 100
+rigid_min_max 1
+color 00ff00
+color 0000ff
+color ffff4f
+color ff0000
+color ffffd0
+href http://www.orcaware.com/orca/docs/orcallator.html#cpu_usage
+}
+
+plot {
+title %g New Process Spawn Rate
+source orcallator
+data #proc/s
+line_type area
+line_type line1
+legend 5 min average
+y_legend New processes/s
+data_min 0
+data_max 100000
+href http://www.orcaware.com/orca/docs/orcallator.html#new_process_spawn_rate
+}
+
+plot {
+title %g Number of System & running Processes on cpu per cpu
+source orcallator
+data #proc / ncpus
+data #proc_oncpu / ncpus
+data #proc_blckd / ncpus
+line_type line1
+line_type area
+legend System total / cpu
+legend Running / cpu
+legend Blocked / cpu
+y_legend Number Processes
+data_min 0
+data_max 10000
+color 0000ff
+color 00ff00
+href http://www.orcaware.com/orca/docs/orcallator.html#number_system_processes
+}
+
+plot {
+title %g Web Server Hit Rate
+source orcallator
+data httpop/s
+data http/p5s
+line_type area
+line_type line1
+legend 5 min average hits/s
+legend Peak 5 second hits/s
+y_legend Hits/s
+data_min 0
+color 00ff00
+color 0000ff
+href http://www.orcaware.com/orca/docs/orcallator.html#web_server_hit_rate
+}
+
+plot {
+title %g Web Server File Size
+source orcallator
+data %to1KB
+data %to10KB
+data %to100KB
+data %to1MB
+data %over1MB
+line_type area
+line_type stack
+line_type stack
+line_type stack
+line_type stack
+legend 0 - 1 KB
+legend 1 - 10 KB
+legend 10 - 100 KB
+legend 100 - 1000 KB
+legend Greater than 1 MB
+y_legend Percent
+data_min 0
+data_max 100
+plot_min 0
+plot_max 100
+rigid_min_max 1
+href http://www.orcaware.com/orca/docs/orcallator.html#web_server_file_size
+}
+
+plot {
+title %g Web Server Data Transfer Rate
+source orcallator
+data httpb/s
+line_type area
+legend Bytes/s
+y_legend Bytes/s
+data_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#web_server_data_transfer_rate
+}
+
+plot {
+title %g Web Server HTTP Error Rate
+source orcallator
+data htErr/s
+line_type area
+legend HTTP errors/s
+y_legend Errors/s
+data_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#web_server_error_rate
+}
+
+plot {
+title %g Memory Page ins & outs rate
+source orcallator
+data mempages_in
+data mempages_out
+legend pages in/s
+legend pages out/s
+y_legend Pages/s
+data_min 0
+}
+
+plot {
+title %g Swap ins & outs rate
+source orcallator
+data swap_in
+data swap_out
+legend Swap in/s
+legend Swap out/s
+y_legend Pages/s
+data_min 0
+}
+
+plot {
+title %g Context switches & Interrupts rate per CPU
+source orcallator
+data ctxt/s / ncpus
+data intr/s / ncpus
+legend Context switches / Cpu
+legend Interrupts / Cpu
+y_legend rate/s
+data_min 0
+}
+
+
+plot {
+title %g Interface Input Bits Per Second
+source orcallator
+data 8 * if_in_b_(.*)
+line_type line1
+legend $1
+y_legend Bits/s
+data_min 0
+data_max 100000000
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_bits_per_second
+}
+
+plot {
+title %g Interface Ouput Bits Per Second
+source orcallator
+data 8 * if_out_b_(.*)
+line_type line1
+legend $1
+y_legend Bits/s
+data_min 0
+data_max 100000000
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_bits_per_second
+}
+
+plot {
+title %g Interface Input Packets Per Second
+source orcallator
+data if_in_p_(.*)
+line_type line1
+legend $1
+y_legend Packets/s
+data_min 0
+data_max 100000
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_packets_per_second
+}
+
+plot {
+title %g Interface Output Packets Per Second
+source orcallator
+data if_out_p_(.*)
+line_type line1
+legend $1
+y_legend Packets/s
+data_min 0
+data_max 100000
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_packets_per_second
+}
+
+plot {
+title %g Interface Input Errors Per Second
+source orcallator
+data if_in_e_(.*)
+line_type line1
+legend $1
+y_legend Errors/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_errors_per_second
+}
+
+plot {
+title %g Interface Output Errors Per Second
+source orcallator
+data if_out_e_(.*)
+line_type line1
+legend $1
+y_legend Errors/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_errors_per_second
+}
+
+plot {
+title %g Interface Input Dropped Per Second
+source orcallator
+data if_in_d_(.*)
+line_type line1
+legend $1
+y_legend Errors/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_deferred_packet_rate
+}
+
+plot {
+title %g Interface Output Dropped Per Second
+source orcallator
+data if_out_d_(.*)
+line_type line1
+legend $1
+y_legend Errors/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_deferred_packet_rate
+}
+
+plot {
+title %g Interface Output Collisions
+source orcallator
+data if_out_cl_(.*)
+line_type area
+legend $1
+y_legend Percent
+data_min 0
+data_max 200
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_collisions
+}
+
+plot {
+title %g Interface Output Carrier Losses
+source orcallator
+data if_out_ca_(.*)
+line_type area
+legend $1
+y_legend Percent
+data_min 0
+data_max 200
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#interface_collisions
+}
+
+plot {
+title %g IP Traffic statistics
+source orcallator
+data Ip_InReceives
+data Ip_OutRequests
+data Ip_ForwDatagrams
+data_type counter
+data_type counter
+data_type counter
+legend IP Input datagrams
+legend IP Ouput datagrams
+legend IP Forwarded datagrams
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g IP Error statistics
+source orcallator
+data Ip_InHdrErrors + Ip_InHdrErrors + Ip_InAddrErrors + Ip_InUnknownProtos + Ip_InDiscards
+data Ip_OutDiscards + Ip_OutNoRoutes
+data Ip_ReasmTimeout + Ip_ReasmFails
+data Ip_FragFails
+data_type counter
+data_type counter
+data_type counter
+data_type counter
+legend IP Input errors
+legend IP Output errors
+legend IP Reassemble errors
+legend IP Fragmentation fails
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g TCP Connection statistics
+source orcallator
+data Tcp_CurrEstab
+data Tcp_ActiveOpens
+data Tcp_PassiveOpens
+data Tcp_AttemptFails + Tcp_EstabResets
+data TcpExt_ListenOverflows + TcpExt_ListenDrops
+data_type gauge
+data_type counter
+data_type counter
+data_type counter
+data_type counter
+legend TCP Connections
+legend TCP Active opens
+legend TCP Passive opens
+legend Connections attempts fails
+legend Listen drops & overflows
+y_legend Connections
+data_min 0
+flush_regexps 1
+}
+
+
+plot {
+title %g TCP Traffic statistics
+source orcallator
+data Tcp_InSegs
+data Tcp_OutSegs
+data_type counter
+data_type counter
+legend Tcp Input segments
+legend Tcp Output segments
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g TCP Error statistics
+source orcallator
+data Tcp_InErrs
+data Tcp_OutRsts
+data Tcp_RetransSegs
+data_type counter
+data_type counter
+data_type counter
+legend Tcp Input errors
+legend Tcp Output errors
+legend TCP Retransmissions
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g ICMP statistics
+source orcallator
+data Icmp_(.*)
+data_type counter
+legend $1 rate
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g UDP statistics
+source orcallator
+data Udp_(.*)
+data_type counter
+legend $1 rate
+y_legend rate
+data_min 0
+flush_regexps 1
+}
+
+plot {
+title %g NFS Server Statistics
+source orcallator
+data nfs_s_(.*)
+data_type counter
+line_type line1
+legend $1/s
+y_legend rate
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#NFS_server_call_rate
+}
+
+plot {
+title %g NFS Client Statistics
+source orcallator
+data nfs_c_(.*)
+data_type counter
+line_type line1
+legend $1/s
+y_legend rate
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#NFS_server_call_rate
+}
+
+plot {
+title %g Disk System Wide Reads/Writes Per Second
+source orcallator
+data disk_rd/s
+data disk_wr/s
+line_type area
+line_type line1
+legend Reads/s
+legend Writes/s
+y_legend Ops/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#disk_system_wide_reads_writes_per_second
+}
+
+plot {
+title %g Disk System Wide Transfer Rate
+source orcallator
+data disk_rB/s
+data disk_wB/s
+line_type area
+line_type line1
+legend Read transfer rate
+legend Write transfer rate
+y_legend Block/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#disk_system_wide_transfer_rate
+}
+
+plot {
+title %g Disk Reads/Writes Per Second
+source orcallator
+data disk_rd_(.*)/s
+data disk_wr_(.*)/s
+line_type area
+line_type line1
+legend $1 Reads/s
+legend $1 Writes/s
+y_legend Ops/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#disk_system_wide_reads_writes_per_second
+}
+
+plot {
+title %g Disk Transfer Rate
+source orcallator
+data disk_rB_(.*)/s
+data disk_wB_(.*)/s
+line_type area
+line_type line1
+legend $1 Read transfer rate
+legend $1 Write transfer rate
+y_legend Block/s
+data_min 0
+flush_regexps 1
+href http://www.orcaware.com/orca/docs/orcallator.html#disk_system_wide_transfer_rate
+}
+
+
+
+plot {
+title %g Disk Space Percent Usage
+source orcallator
+data mnt_(.*)
+line_type line1
+legend $1
+y_legend Percent Used
+data_min 0
+data_max 100
+plot_min 0
+plot_max 100
+href http://www.orcaware.com/orca/docs/orcallator.html#disk_space_percent_usage
+}
+
+plot {
+title %g Physical Memory usage percent
+source orcallator
+data mem_used%
+data mem_free%
+data mem_shrd%
+data mem_buff%
+data mem_cchd%
+line_type area
+line_type stack
+line_type line1
+line_type stack
+line_type stack
+legend Used memory
+legend Free memory
+legend shared memory
+legend buffer memory
+legend cached memory
+y_legend percent
+data_min 0
+data_max 100
+plot_min 0
+plot_max 100
+href http://www.orcaware.com/orca/docs/orcallator.html#memory_free
+}
+
+plot {
+title %g Swap usage percent
+source orcallator
+data swp_used%
+data swp_free%
+line_type area
+line_type stack
+legend Used swap
+legend Free swap
+y_legend percent
+data_min 0
+data_max 100
+href http://www.orcaware.com/orca/docs/orcallator.html#memory_free
+}
+
+
+plot {
+title %g Memory Page Scan Rate
+source orcallator
+data scanrate
+line_type area
+legend Page scan rate
+y_legend Pages/s
+data_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#page_scan_rate
+}
+
+plot {
+title %g Memory Page Residence Time
+source orcallator
+data page_rstim
+line_type area
+legend Page residence time
+y_legend Seconds
+data_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#page_residence_time
+}
+
+plot {
+title %g Memory Available Swap Space
+source orcallator
+data 1024 * swap_avail
+line_type area
+legend Available swap space
+y_legend Bytes
+base 1024
+data_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#available_swap_space
+}
+
+plot {
+title %g Memory Page Usage
+source orcallator
+data pp_kernel
+data free_pages
+data pagestotl - pp_kernel - free_pages
+data pagestotl
+line_type area
+line_type stack
+line_type stack
+line_type line1
+legend Kernel
+legend Free list
+legend Other
+legend System total
+y_legend Number Of Pages
+data_min 0
+plot_min 0
+color 00ff00
+color ff0000
+color 0000ff
+href http://www.orcaware.com/orca/docs/orcallator.html#page_usage
+}
+
+plot {
+title %g Memory Pages Locked & IO
+source orcallator
+data pageslock
+data pagesio
+line_type area
+line_type line1
+legend Locked
+legend IO
+y_legend Number Of Pages
+data_min 0
+plot_min 0
+href http://www.orcaware.com/orca/docs/orcallator.html#pages_locked_IO
+}
Added: tags/orca/0.27/contrib/procallator/procallator.in
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/procallator.in Fri Jul 1 07:05:23 2005
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# procallator Script to load procallator at time.
+#
+# Author Guilherme Carvalho Chehab <gchehab at abordo.com.br>
+#
+
+# Source function library.
+. /etc/init.d/functions
+
+# See how we were called.
+case "$1" in
+ start)
+ if [ -f /usr/local/bin/procallator.pl ]; then
+ action "Initializing procalator statistics colector " /usr/local/bin/procallator.pl &
+ fi
+
+ ;;
+ stop)
+ action "Stopping procallator" kill `ps -ef | grep procallat | grep -v grep | tr -s " " | cut -f 2 -d " "`
+
+ ;;
+ *)
+ # do not advertise unreasonable commands that there is no reason
+ # to use with this device
+ echo "Usage: procallator {start|stop}"
+ exit 1
+esac
+
+exit 0
+
Modified: tags/orca/0.27/contrib/procallator/procallator.pl.in
==============================================================================
--- tags/orca/0.27/contrib/procallator/procallator.pl.in (original)
+++ tags/orca/0.27/contrib/procallator/procallator.pl.in Fri Jul 1 07:05:23 2005
@@ -1,25 +1,55 @@
#!/usr/bin/perl -w
#
-# collector for /proc statistics for use with Linux 2.2 and 2.4 kernels.
+# Performance statistics collector for /proc statistics for use
+# with Linux 2.2, 2.4 & 2.6 kernels.
#
-# Copyright (C) 2001 Guilherme Carvalho Chehab. All Rights Reserved.
+# Copyright (C) 2001 Guilherme Carvalho Chehab.
#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
# Config variables
-#$PROC="./linux-2.2"; # Proc directory, usually /proc
+
$PROC="/proc"; # Proc directory, usually /proc
$INTERVAL=300; # Interval between each measure, in seconds
$COMPRESS="/usr/bin/gzip"; # Compressor...
$HOSTNAME=`/bin/hostname`;
chomp $HOSTNAME;
-$DEST_DIR="/usr/local/var/orca/$HOSTNAME"; # Destination dir for output files
-#$DEST_DIR="/tmp"; # Destination dir for output files
+$DEST_DIR="@VAR_DIR@/procallator/$HOSTNAME"; # Destination dir for output files
+#$DEST_DIR="/tmp"; # Destination dir for output files
+#
+# Output Options
+$NFS_PROTO_DETAILS=0; # Include per NFS per protocol versions stats on output
# Initializations
+$DEBUG=0;
$r=0; # Rotating indice for measuring counter differences
$rate_ok=0; # Check if is ok to calculate rates
+$num=0; # Serial number of output file
+$n_cols[0]=0;
+$n_cols[1]=0;
+
+if (!$DEBUG) {
+ use POSIX qw(setsid);
+ umask 0;
+ exit (0) if (fork);
+ setsid;
+}
+
# Create output dir if needed
-if (! -d $DEST_DIR ) {
+if (! -d $DEST_DIR && !$DEBUG) {
`mkdir -p $DEST_DIR`;
}
@@ -28,29 +58,34 @@
($os,$line,$version)=split / +/ , <F_VERSION>, 4;
close (F_VERSION);
+print "$os, $line, $version \n" if ($DEBUG);
+my ($major,$minor,$release) = split /[\.| |-]/, $version;
+
+$INTERVAL=5 if ($DEBUG);
+
# Main loop
do {
# Wait for the next INTERVAL
- sleep ($INTERVAL-time() % $INTERVAL);
+ sleep ($INTERVAL-time() % $INTERVAL) if (!$DEBUG);
+ sleep ($INTERVAL) if ($DEBUG && $rate_ok);
# Loop initializations
$n_cols[$r]=0;
- # Get Local time & uptime
- $timestamp=time();
- ($sec,$min,$hour,$mday,$mon,$year,$yday,$isdst)=localtime($timestamp);
+ # Get Local time
+ $timestamp[$r]=time();
+ ($sec,$min,$hour,$mday,$mon,$year,$yday[$r],$isdst)=localtime($timestamp[$r]);
$mon+=1;
$year+=1900;
$locltime=sprintf "%02d:%02d:%02d", $hour,$min,$sec;
+
+ # Get uptime
open (F_UPTIME,"<$PROC/uptime");
($uptime)=split / +/,<F_UPTIME>;
close (F_UPTIME);
# insert in output table
- put_output("timestamp",$timestamp,"locltime",$locltime,"uptime",$uptime);
-
- # Evaluate filename
- $out_filename[$r]=sprintf "%s/proccol-%04d-%02d-%02d",$DEST_DIR, $year,$mon,$mday;
+ put_output("timestamp",$timestamp[$r],"locltime",$locltime,"uptime",$uptime);
# Read load average
open (F_LOADAVG, "<$PROC/loadavg");
@@ -71,12 +106,15 @@
while ( $line=<F_STAT> ) {
chomp ($line);
if ( $line=~/cpu[0-9]*/ ) {
- ($cpu[$r][$n_cpus], $usr[$r][$n_cpus], $nice[$r][$n_cpus], $sys[$r][$n_cpus], $idle[$r][$n_cpus])= split / +/,$line;
- $total[$r][$n_cpus]= $usr[$r][$n_cpus] + $nice[$r][$n_cpus] + $sys[$r][$n_cpus] + $idle[$r][$n_cpus];
+ ($cpu[$r][$n_cpus], $usr[$r][$n_cpus], $nice[$r][$n_cpus], $sys[$r][$n_cpus], $idle[$r][$n_cpus], $wait [$r][$n_cpus], $hi [$r][$n_cpus], $si[$r][$n_cpus], $dumb )= split / +/,$line;
+ ($wait [$r][$n_cpus], $hi [$r][$n_cpus], $si[$r][$n_cpus])= (0,0,0) if (!defined $wait [$r][$n_cpus] );
+ $total[$r][$n_cpus]= $usr[$r][$n_cpus] + $nice[$r][$n_cpus] + $sys[$r][$n_cpus] + $idle[$r][$n_cpus] + $wait [$r][$n_cpus] + $hi [$r][$n_cpus] + $si[$r][$n_cpus];
+ $sys[$r][$n_cpus] += $hi [$r][$n_cpus] + $si[$r][$n_cpus];
$n_cpus++;
}
if ( $line=~/page/) {
- ($dumb, $page_in[$r], $page_out[$r])= split / +/,$line;
+ ($dumb, $dsk_rio_t[$r], $dsk_wio_t[$r])= split / +/,$line; # This is the real mean... Will only use on 2.2 kernels since it is calculated on 2.4 and above
+ $page_in[$r] = $page_out[$r]=0; # Ops ! This metric does not appear until kernel 2.6
}
if ( $line=~/swap/) {
($dumb, $swap_in[$r], $swap_out[$r])= split / +/,$line;
@@ -84,6 +122,10 @@
if ( $line=~/ctxt/) {
($dumb, $ctxt[$r])= split / +/,$line;
}
+ if ( $line=~/procs_blocked/) {
+ ($dumb, $proc_block)= split / +/,$line;
+ put_output ( "#proc_blckd", $proc_block);
+ }
if ( $line=~/intr/) {
@dumb=split / /,$line;
$intr[$r]=0;
@@ -115,6 +157,13 @@
$dsk_rblk_t[$r]+=$dsk_rblk[$r][$i];
$dsk_wio_t[$r] +=$dsk_wio[$r][$i];
$dsk_wblk_t[$r]+=$dsk_wblk[$r][$i];
+ $dumb="c$dsk_maj[$r][$i]_d$dsk_min[$r][$i]";
+ put_output("disk_op_$dumb/s",rate($dsk_stat[$r][$i],$dsk_stat[1-$r][$i]),
+ "disk_rd_$dumb/s",rate($dsk_rio[$r][$i], $dsk_rio[1-$r][$i]),
+ "disk_wr_$dumb/s",rate($dsk_wio[$r][$i], $dsk_wio[1-$r][$i]),
+ "disk_rB_$dumb/s",rate($dsk_rblk[$r][$i],$dsk_rblk[1-$r][$i]),
+ "disk_wB_$dumb/s",rate($dsk_wblk[$r][$i],$dsk_wblk[1-$r][$i])
+ );
$i++;
}
}
@@ -173,8 +222,9 @@
$nice_100[$i]=rate_prcnt($nice[$r][$i],$nice[1-$r][$i],$total[$r][$i],$total[1-$r][$i]);
$sys_100 [$i]=rate_prcnt($sys [$r][$i],$sys [1-$r][$i],$total[$r][$i],$total[1-$r][$i]);
$idle_100[$i]=rate_prcnt($idle[$r][$i],$idle[1-$r][$i],$total[$r][$i],$total[1-$r][$i]);
+ $wait_100[$i]=rate_prcnt($wait[$r][$i],$wait[1-$r][$i],$total[$r][$i],$total[1-$r][$i]);
if ($i==0) {
- put_output("ncpus",$n_cpus-1,"usr%",$usr_100 [$i],"nice%",$nice_100[$i],"sys%",$sys_100 [$i],"wait%",$idle_100[$i]);
+ put_output("ncpus",$n_cpus-1,"usr%",$usr_100 [$i],"nice%",$nice_100[$i],"sys%",$sys_100 [$i],"wait%",$wait_100[$i],"idle%",$idle_100[$i]);
} else {
if ($n_cpus>2) {
put_output("usr_%_$i",$usr_100 [$i],"nice_%_$i",$nice_100[$i],"sys_%_$i",$sys_100 [$i],"wait_%_$i",$idle_100[$i]);
@@ -182,8 +232,97 @@
}
}
- put_output ( "pages_in",rate(@page_in),
- "pages_out",rate(@page_out),
+ # In kernel 2.6 paging and swapping information must be computed on other file
+ if ( $version=~/^2\.6/ ) {
+ open (F_VMSTAT, "<$PROC/vmstat");
+ while ($line=<F_VMSTAT>) {
+ # Not sure about the meaning of theese
+# if ( $line=~/pgactivate/) {
+# ($dumb, $page_in[$r])= split / +/,$line;
+# }
+# if ( $line=~/pgdectivate/) {
+# ($dumb, $page_out[$r])= split / +/,$line;
+# }
+ if ( $line=~/pswpin/) {
+ ($dumb, $swap_in[$r])= split / +/,$line;
+ }
+ if ( $line=~/pswpout/) {
+ ($dumb, $swap_out[$r])= split / +/,$line;
+ }
+ }
+ close (F_VMSTAT);
+ }
+
+ # Now lets get 2.4 /proc/partitions and 2.5 /proc/diskstats for acurate disk measurements
+ #
+ if ( $minor >=4 ) {
+ ($dsk_stat_t[$r],$dsk_rio_t[$r],$dsk_rblk_t[$r],$dsk_wio_t[$r],$dsk_wblk_t[$r])=(0,0,0,0);
+ open (F_DSKSTAT, "<$PROC/partitions") if ($minor==4);
+ open (F_DSKSTAT, "<$PROC/diskstats") if ($minor>4);
+
+ $i=0;
+ while ($line=<F_DSKSTAT>) {
+ if ( $line =~ /sd|hd/ ) { # just IDE or SCSI disks
+ chomp $line;
+ $line= " 0 ".$line if ($minor==6); # make 2.6 version look alike a 2.4 one
+ ($dumb,$dumb,$dumb,$dumb,
+ $name[$r][$i],
+ $rdops[$r][$i],$rdops_seq[$r][$i],
+ $rdsct[$r][$i],$rdtm[$r][$i],
+ $wrops[$r][$i],$wrops_seq[$r][$i],
+ $wrsct[$r][$i],$wrtm[$r][$i],
+ $ioqueue[$r][$i],$iotm[$r][$i],$weightiotm[$r][$i]) = split / +/,$line;
+ if ($name[$r][$i] !~ /[0-9]/ ) {
+ $dsk_rio_t[$r]+=$rdops[$r][$i];
+ $dsk_wio_t[$r]+=$wrops[$r][$i];
+ $dsk_rblk_t[$r]+=$rdsct[$r][$i];
+ $dsk_wblk_t[$r]+=$wrsct[$r][$i];
+ put_output(
+ "disk_rd_$name[$r][$i]/s",rate($rdops[$r][$i],$rdops[1-$r][$i]),
+ "disk_wr_$name[$r][$i]/s",rate($wrops[$r][$i],$wrops[1-$r][$i]),
+ "disk_rB_$name[$r][$i]/s",rate($rdsct[$r][$i],$rdsct[1-$r][$i]),
+ "disk_wB_$name[$r][$i]/s",rate($wrsct[$r][$i],$wrsct[1-$r][$i]),
+ "disk_rdseq_$name[$r][$i]/s",rate($rdops_seq[$r][$i],$rdops_seq[1-$r][$i]),
+ "disk_wrseq_$name[$r][$i]/s",rate($wrops_seq[$r][$i],$ops_seq[1-$r][$i]),
+ "disk_rtm_$name[$r][$i]/s",rate($rdtm[$r][$i],$rdtm[1-$r][$i]),
+ "disk_wtm_$name[$r][$i]/s",rate($wrtm[$r][$i],$wrtm[1-$r][$i]),
+ "disk_iotm_$name[$r][$i]/s",rate($iotm[$r][$i],$iotm[1-$r][$i]),
+ "disk_ioqueue_$name[$r][$i]/s",rate($ioqueue[$r][$i],$ioqueue[1-$r][$i]),
+ "disk_weightiotm_$name[$r][$i]/s",rate($weightiotm[$r][$i],$weightiotm[1-$r][$i]),
+ );
+ } else {
+ put_output( # 2.6 has less metrics, wich messes vars names
+ "part_rd_$name[$r][$i]/s",rate($rdops[$r][$i],$rdops[1-$r][$i]),
+ "part_wr_$name[$r][$i]/s",rate($rdsct[$r][$i],$rdsct[1-$r][$i]),
+ "part_rB_$name[$r][$i]/s",rate($rdops_seq[$r][$i],$rdops_seq[1-$r][$i]),
+ "part_wB_$name[$r][$i]/s",rate($rdtm[$r][$i],$rdtm[1-$r][$i])
+ ) if ($minor==6);
+ put_output(
+ "part_rd_$name[$r][$i]/s",rate($rdops[$r][$i],$rdops[1-$r][$i]),
+ "part_wr_$name[$r][$i]/s",rate($wrops[$r][$i],$wrops[1-$r][$i]),
+ "part_rB_$name[$r][$i]/s",rate($rdsct[$r][$i],$rdsct[1-$r][$i]),
+ "part_wB_$name[$r][$i]/s",rate($wrsct[$r][$i],$wrsct[1-$r][$i]),
+ "part_rdseq_$name[$r][$i]/s",rate($rdops_seq[$r][$i],$rdops_seq[1-$r][$i]),
+ "part_wrseq_$name[$r][$i]/s",rate($wrops_seq[$r][$i],$ops_seq[1-$r][$i]),
+ "part_rtm_$name[$r][$i]/s",rate($rdtm[$r][$i],$rdtm[1-$r][$i]),
+ "part_wtm_$name[$r][$i]/s",rate($wrtm[$r][$i],$wrtm[1-$r][$i]),
+ "disk_iotm_$name[$r][$i]/s",rate($iotm[$r][$i],$iotm[1-$r][$i]),
+ "part_ioqueue_$name[$r][$i]/s",rate($ioqueue[$r][$i],$ioqueue[1-$r][$i]),
+ "part_weightiotm_$name[$r][$i]/s",rate($weightiotm[$r][$i],$weightiotm[1-$r][$i]),
+ ) if ($minor==4);
+ }
+ $i++;
+ }
+ }
+ #$n_parts=$i;
+ $dsk_stat_t[$r]= $dsk_rio_t[$r]+$dsk_wio_t[$r];
+ close (F_DSKSTAT);
+ }
+
+
+
+ put_output ( "mempages_in",rate(@page_in),
+ "mempages_out",rate(@page_out),
"swap_in",rate(@swap_in),
"swap_out",rate(@swap_out),
"ctxt/s",rate(@ctxt),
@@ -197,38 +336,48 @@
"disk_wB/s",rate(@dsk_wblk_t)
);
- if ( $version=~/^2\.4/ ) {
- for ($i=0; $i<$n_dsk; $i++) {
- $dumb="c$dsk_maj[$r][$i]_d$dsk_min[$r][$i]";
- put_output("disk_op_$dumb/s",rate($dsk_stat[$r][$i],$dsk_stat[1-$r][$i]),
- "disk_rd_$dumb/s",rate($dsk_rio[$r][$i], $dsk_rio[1-$r][$i]),
- "disk_wr_$dumb/s",rate($dsk_wio[$r][$i], $dsk_wio[1-$r][$i]),
- "disk_rB_$dumb/s",rate($dsk_rblk[$r][$i],$dsk_rblk[1-$r][$i]),
- "disk_wB_$dumb/s",rate($dsk_wblk[$r][$i],$dsk_wblk[1-$r][$i])
- );
- }
- }
close (F_STAT);
- # Get filesystem ocupation
- @df=`/bin/df -k`;
- for ($i=1,$j=0;$df[$i];$i++) {
- if (!(($df[$i]=~/cdrom/)||($df[$i]=~/cdrom/))) {
- chomp $df[$i];
- ($dumb, $fs[2][$j], $fs[3][$j], $dumb, $dumb, $fs[0][$j])= split / +/,$df[$i];
- $fs[1][$j]=prcnt($fs[3][$j],$fs[2][$j]);
- put_output("mnt_$fs[0][$j]",$fs[1][$j]);
- $j++;
- }
- }
- $n_fs=$j;
# Get memory ocupation
open (F_MEMINFO, "<$PROC/meminfo");
- <F_MEMINFO>;
- ($dumb, $mem_total,$mem_used,$mem_free,$mem_shrd,$mem_buff,$mem_cchd)=split /[^0-9]+/,<F_MEMINFO>;
- ($dumb, $swp_total,$swp_used,$swp_free)=split /[^0-9]+/,<F_MEMINFO>;
+ if ( $version!~/^2\.6/ ) {
+ <F_MEMINFO>;
+ ($dumb, $mem_total,$mem_used,$mem_free,$mem_shrd,$mem_buff,$mem_cchd)=split /[^0-9]+/,<F_MEMINFO>;
+ ($dumb, $swp_total,$swp_used,$swp_free)=split /[^0-9]+/,<F_MEMINFO>;
+ } else {
+ while ($line=<F_MEMINFO>) {
+ if ( $line=~/MemTotal/) {
+ ($dumb, $mem_total)= split / +/,$line;
+ }
+ if ( $line=~/MemFree/) {
+ ($dumb, $mem_free)= split / +/,$line;
+ }
+ if ( $line=~/Buffers/) {
+ ($dumb, $mem_buff)= split / +/,$line;
+ }
+ if ( $line=~/Cached/) {
+ ($dumb, $mem_cchd)= split / +/,$line;
+ }
+ if ( $line=~/Shared/) {
+ ($dumb, $mem_shrd)= split / +/,$line; # It does not exist anymore -- maybe get will have to get from /proc/sysvipc/shm ?
+ }
+ #if ( $line=~/SwapCached/) {
+ # ($dumb, $mem_swpcchd)= split / +/,$line;
+ #}
+ if ( $line=~/SwapTotal/) {
+ ($dumb, $swp_total)= split / +/,$line;
+ }
+ if ( $line=~/SwapFree/) {
+ ($dumb, $swp_free)= split / +/,$line;
+ }
+ }
+ $mem_used=$mem_total-$mem_free;
+ $swp_used=$swp_total-$swp_free;
+ }
+
close (F_MEMINFO);
+
put_output ( "mem_used%",prcnt($mem_used,$mem_total),
"mem_free%",prcnt($mem_free,$mem_total),
"mem_shrd%",prcnt($mem_shrd,$mem_total),
@@ -276,9 +425,24 @@
}
}
$n_nets=$i;
+ close (F_NET_DEV);
# Get TCP/IP statistics
- open (F_SNMP, "<$PROC/net/snmp");
+ #
+ for (my $k=0; $k<2; $k++) {
+
+ if ($k==1) {
+ if ($minor>=4) {
+ open (F_SNMP, "<$PROC/net/netstat");
+ } else {
+ next;
+ }
+
+ } else {
+ open (F_SNMP, "<$PROC/net/snmp");
+ }
+
+
$j=0;
while ($line=<F_SNMP>) {
$line2=<F_SNMP>;
@@ -310,7 +474,7 @@
if ($cat=~/Tcp/) {
if ($net_parm[0][$j]=~/Rto|Max/) { last SWITCH; }
if ($net_parm[0][$j]=~/CurrEstab/) {
- put_output("g$net_parm[0][$j]",$net_parm[2+$r][$j]);
+ put_output("$net_parm[0][$j]",$net_parm[2+$r][$j]);
last SWITCH;
}
put_output("$net_parm[0][$j]",$net_parm[1][$j]);
@@ -319,7 +483,9 @@
}
}
}
+ close (F_SNMP);
$net_parms=$j;
+ }
# Get NFS Client statistics
if ( -f "$PROC/net/rpc/nfs") {
@@ -359,7 +525,7 @@
"nfs_c_p2_rmdir", rate(@nfs_c_p2_rmdir),
"nfs_c_p2_readdir", rate(@nfs_c_p2_readdir),
"nfs_c_p2_fsstat", rate(@nfs_c_p2_fsstat)
- );
+ ) if ($NFS_PROTO_DETAILS);
}
if ($line=~/proc3/) {
( $dumb,$dumb,$dumb, $nfs_c_p3_getattr[$r], $nfs_c_p3_setattr[$r], $nfs_c_p3_lookup[$r],
@@ -391,11 +557,68 @@
"nfs_c_p3_fsinfo", rate(@nfs_c_p3_fsinfo),
"nfs_c_p3_pathconf", rate(@nfs_c_p3_pathconf),
"nfs_c_p3_commit", rate(@nfs_c_p3_commit)
- );
+ ) if ($NFS_PROTO_DETAILS);
+ }
+ if ($line=~/proc4/) {
+ ( $dumb,$dumb,$dumb, $nfs_c_p4_getattr[$r], $nfs_c_p4_setattr[$r], $nfs_c_p4_lookup[$r],
+ $nfs_c_p4_access[$r], $nfs_c_p4_readlink[$r], $nfs_c_p4_read[$r], $nfs_c_p4_write[$r],
+ $nfs_c_p4_create[$r], $nfs_c_p4_mkdir[$r], $nfs_c_p4_symlink[$r], $nfs_c_p4_mknod[$r],
+ $nfs_c_p4_remove[$r], $nfs_c_p4_rmdir[$r], $nfs_c_p4_rename[$r], $nfs_c_p4_link[$r],
+ $nfs_c_p4_readdir[$r], $nfs_c_p4_readdirplus[$r],$nfs_c_p4_fsstat[$r], $nfs_c_p4_fsinfo[$r],
+ $nfs_c_p4_pathconf[$r], $nfs_c_p4_commit[$r]
+ )=split / +/,$line;
+
+ put_output( "nfs_c_p4_getattr", rate(@nfs_c_p4_getattr),
+ "nfs_c_p4_setattr", rate(@nfs_c_p4_setattr),
+ "nfs_c_p4_lookup", rate(@nfs_c_p4_lookup),
+ "nfs_c_p4_access", rate(@nfs_c_p4_access),
+ "nfs_c_p4_readlink", rate(@nfs_c_p4_readlink),
+ "nfs_c_p4_read", rate(@nfs_c_p4_read),
+ "nfs_c_p4_write", rate(@nfs_c_p4_write),
+ "nfs_c_p4_create", rate(@nfs_c_p4_create),
+ "nfs_c_p4_mkdir", rate(@nfs_c_p4_mkdir),
+ "nfs_c_p4_symlink", rate(@nfs_c_p4_symlink),
+ "nfs_c_p4_mknod", rate(@nfs_c_p4_mknod),
+ "nfs_c_p4_remove", rate(@nfs_c_p4_remove),
+ "nfs_c_p4_rmdir", rate(@nfs_c_p4_rmdir),
+ "nfs_c_p4_rename", rate(@nfs_c_p4_rename),
+ "nfs_c_p4_link", rate(@nfs_c_p4_link),
+ "nfs_c_p4_readdir", rate(@nfs_c_p4_readdir),
+ "nfs_c_p4_readdirplus", rate(@nfs_c_p4_readdirplus),
+ "nfs_c_p4_fsstat", rate(@nfs_c_p4_fsstat),
+ "nfs_c_p4_fsinfo", rate(@nfs_c_p4_fsinfo),
+ "nfs_c_p4_pathconf", rate(@nfs_c_p4_pathconf),
+ "nfs_c_p4_commit", rate(@nfs_c_p4_commit)
+ ) if ($NFS_PROTO_DETAILS);
}
}
+ close (F_NFS);
+
+ put_output( "nfs_c_t_getattr", rate(@nfs_c_p2_getattr) +rate(@nfs_c_p3_getattr) +rate(@nfs_c_p4_getattr),
+ "nfs_c_t_setattr", rate(@nfs_c_p2_setattr) +rate(@nfs_c_p3_setattr) +rate(@nfs_c_p4_setattr),
+ "nfs_c_t_lookup", rate(@nfs_c_p2_lookup) +rate(@nfs_c_p3_lookup) +rate(@nfs_c_p4_lookup),
+ "nfs_c_t_access", rate(@nfs_c_p3_access) +rate(@nfs_c_p4_access),
+ "nfs_c_t_readlink", rate(@nfs_c_p2_readlink)+rate(@nfs_c_p3_readlink) +rate(@nfs_c_p4_readlink),
+ "nfs_c_t_read", rate(@nfs_c_p2_read) +rate(@nfs_c_p3_read) +rate(@nfs_c_p4_read),
+ "nfs_c_t_write", rate(@nfs_c_p2_write) +rate(@nfs_c_p3_write) +rate(@nfs_c_p4_write),
+ "nfs_c_t_create", rate(@nfs_c_p2_create) +rate(@nfs_c_p3_create) +rate(@nfs_c_p4_create),
+ "nfs_c_t_mkdir", rate(@nfs_c_p2_mkdir) +rate(@nfs_c_p3_mkdir) +rate(@nfs_c_p4_mkdir),
+ "nfs_c_t_symlink", rate(@nfs_c_p2_symlink) +rate(@nfs_c_p3_symlink) +rate(@nfs_c_p4_symlink),
+ "nfs_c_t_mknod", rate(@nfs_c_p3_mknod) +rate(@nfs_c_p4_mknod),
+ "nfs_c_t_remove", rate(@nfs_c_p2_remove) +rate(@nfs_c_p3_remove) +rate(@nfs_c_p4_remove),
+ "nfs_c_t_rmdir", rate(@nfs_c_p2_rmdir) +rate(@nfs_c_p3_rmdir) +rate(@nfs_c_p4_rmdir),
+ "nfs_c_t_rename", rate(@nfs_c_p2_rename) +rate(@nfs_c_p3_rename) +rate(@nfs_c_p4_rename),
+ "nfs_c_t_link", rate(@nfs_c_p2_link) +rate(@nfs_c_p3_link) +rate(@nfs_c_p4_link),
+ "nfs_c_t_readdir", rate(@nfs_c_p2_readdir) +rate(@nfs_c_p3_readdir) +rate(@nfs_c_p4_readdir),
+ "nfs_c_t_readdirplus", rate(@nfs_c_p3_readdirplus) +rate(@nfs_c_p4_readdirplus),
+ "nfs_c_t_fsstat", rate(@nfs_c_p2_fsstat) +rate(@nfs_c_p3_fsstat) +rate(@nfs_c_p4_fsstat),
+ "nfs_c_t_fsinfo", rate(@nfs_c_p3_fsinfo) +rate(@nfs_c_p4_fsinfo),
+ "nfs_c_t_pathconf", rate(@nfs_c_p3_pathconf) +rate(@nfs_c_p4_pathconf),
+ "nfs_c_t_commit", rate(@nfs_c_p3_commit) +rate(@nfs_c_p4_commit)
+ );
}
+
# Get NFS Server statistics
if ( -f "$PROC/net/rpc/nfsd") {
open (F_NFS, "<$PROC/net/rpc/nfsd");
@@ -438,7 +661,7 @@
"nfs_s_p2_rmdir", rate(@nfs_s_p2_rmdir),
"nfs_s_p2_readdir", rate(@nfs_s_p2_readdir),
"nfs_s_p2_fsstat", rate(@nfs_s_p2_fsstat)
- );
+ ) if ($NFS_PROTO_DETAILS);
}
if ($line=~/proc3/) {
( $dumb,$dumb,$dumb, $nfs_s_p3_getattr[$r], $nfs_s_p3_setattr[$r], $nfs_s_p3_lookup[$r],
@@ -470,19 +693,83 @@
"nfs_s_p3_fsinfo", rate(@nfs_s_p3_fsinfo),
"nfs_s_p3_pathconf", rate(@nfs_s_p3_pathconf),
"nfs_s_p3_commit", rate(@nfs_s_p3_commit)
- );
+ ) if ($NFS_PROTO_DETAILS);
}
+ if ($line=~/proc4/) {
+ ( $dumb,$dumb,$dumb,
+ $nfs_s_p4_compound[$r]
+ )=split / +/,$line;
+
+ put_output( "nfs_s_p4_compound", rate(@nfs_s_p4_compound)
+ ) if ($NFS_PROTO_DETAILS);
+ }
+ }
+ close (F_NFS);
+ put_output( "nfs_s_t_getattr", rate(@nfs_s_p2_getattr) +rate(@nfs_s_p3_getattr),
+ "nfs_s_t_setattr", rate(@nfs_s_p2_setattr) +rate(@nfs_s_p3_setattr),
+ "nfs_s_t_lookup", rate(@nfs_s_p2_lookup) +rate(@nfs_s_p3_lookup) ,
+ "nfs_s_t_access", rate(@nfs_s_p3_access) ,
+ "nfs_s_t_readlink", rate(@nfs_s_p2_readlink)+rate(@nfs_s_p3_readlink),
+ "nfs_s_t_read", rate(@nfs_s_p2_read) +rate(@nfs_s_p3_read) ,
+ "nfs_s_t_write", rate(@nfs_s_p2_write) +rate(@nfs_s_p3_write) ,
+ "nfs_s_t_create", rate(@nfs_s_p2_create) +rate(@nfs_s_p3_create) ,
+ "nfs_s_t_mkdir", rate(@nfs_s_p2_mkdir) +rate(@nfs_s_p3_mkdir) ,
+ "nfs_s_t_symlink", rate(@nfs_s_p2_symlink) +rate(@nfs_s_p3_symlink),
+ "nfs_s_t_mknod", rate(@nfs_s_p3_mknod) ,
+ "nfs_s_t_remove", rate(@nfs_s_p2_remove) +rate(@nfs_s_p3_remove) ,
+ "nfs_s_t_rmdir", rate(@nfs_s_p2_rmdir) +rate(@nfs_s_p3_rmdir) ,
+ "nfs_s_t_rename", rate(@nfs_s_p2_rename) +rate(@nfs_s_p3_rename) ,
+ "nfs_s_t_link", rate(@nfs_s_p2_link) +rate(@nfs_s_p3_link) ,
+ "nfs_s_t_readdir", rate(@nfs_s_p2_readdir) +rate(@nfs_s_p3_readdir),
+ "nfs_s_t_readdirplus", rate(@nfs_s_p3_readdirplus),
+ "nfs_s_t_fsstat", rate(@nfs_s_p2_fsstat) +rate(@nfs_s_p3_fsstat) ,
+ "nfs_s_t_fsinfo", rate(@nfs_s_p3_fsinfo) ,
+ "nfs_s_t_pathconf", rate(@nfs_s_p3_pathconf),
+ "nfs_s_t_commit", rate(@nfs_s_p3_commit) ,
+ "nfs_s_t_compound", rate(@nfs_s_p4_compound)
+ );
+ }
+
+ # Get filesystem ocupation
+ @df=`/bin/df -klP`;
+ for ($i=1,$j=0;$df[$i];$i++) {
+ if (!(($df[$i]=~/cdrom/)||($df[$i]=~/cdrom/))) {
+ chomp $df[$i];
+ ($dumb, $fs[2][$j], $fs[3][$j], $dumb, $dumb, $fs[0][$j])= split / +/,$df[$i];
+ $fs[1][$j]=prcnt($fs[3][$j],$fs[2][$j]);
+ put_output("mnt_$fs[0][$j]",$fs[1][$j]);
+ $j++;
}
}
+ $n_fs=$j;
+ # Check if number of columns have changed
+ if ( $n_cols[$r] != $n_cols[1-$r] ) {
+ $num++;
+ }
+
+ # If year day has changed and is not first execution: zero output seq.
+ if (($rate_ok) && ( $yday[$r] != $yday[1-$r] )) {
+ $num=0;
+ }
+ # Evaluate filename
+ $out_filename[$r]=sprintf "%s/proccol-%04d-%02d-%02d-%03d",$DEST_DIR, $year,$mon,$mday,$num;
- # flush output
- flush_output();
+ # on first execution check file existence
+ if (!$rate_ok) {
+ while ( -f $out_filename[$r] ) {
+ $num++;
+ $out_filename[$r]=sprintf "%s/proccol-%04d-%02d-%02d-%03d",$DEST_DIR, $year,$mon,$mday,$num;
+ }
+ }
+
+ # flush output if not in Debug mode
+ flush_output() if (!$DEBUG);
$r=1-$r;
$rate_ok=1;
-} while (1);
+} while (!$DEBUG || $r); # If in debug mode does only 2 iteractions
# to perl dont complain on unused vars
($os,$n_fs,$net_parms,$n_nets,$cpu,$yday,$isdst)=($os,$n_fs,$net_parms,$n_nets,$cpu,$yday,$isdst);
@@ -490,12 +777,19 @@
sub rate {
my ($a,$b) = @_;
my $c;
- $c= (!($a&&$b))?0:((abs($a-$b)%$INTERVAL)==0)?abs($a-$b)/$INTERVAL:sprintf("%.3f",abs($a-$b)/$INTERVAL);
+ my $d=$INTERVAL; #1; # abs($timestamp[$r]-$timestamp[1-$r]);
+ if (!defined $a || $a eq "") {$a=0} ;
+ if (!defined $b || $b eq "") {$b=0} ;
+
+ $c= ($rate_ok==1) ? ( ( (abs($a-$b)%$d) ==0 ) ? abs($a-$b) / $d : sprintf("%.3f",abs ($a-$b) / $d) ) : 0;
+
return $c;
}
sub prcnt {
my ($a,$b) = @_;
+ if (!defined $a || $a eq "") {$a=0} ;
+ if (!defined $b || $b eq "") {$b=0} ;
return ($b==0) ? 0 : sprintf ("%.2f",100 * $a / $b);
}
@@ -546,5 +840,8 @@
for ($t=0;$a[$t];$t+=2,$n_cols[$r]+=1) {
$out [0][$n_cols[$r]]=$a[$t];
$out [1][$n_cols[$r]]=$a[$t+1];
+ if ($DEBUG) {
+ print $out[0][$n_cols[$r]].": ".$out [1][$n_cols[$r]]."\n";
+ }
}
}
Added: tags/orca/0.27/contrib/procallator/update_orca_server.sh.in
==============================================================================
--- (empty file)
+++ tags/orca/0.27/contrib/procallator/update_orca_server.sh.in Fri Jul 1 07:05:23 2005
@@ -0,0 +1,5 @@
+server=Orca_Server::package
+host=`hostname`
+cd @VAR_DIR@/procallator:/$host
+rsync --times --delete --recursive . $server/$host
+cd /
More information about the Orca-checkins
mailing list