From blair at orcaware.com Sun Aug 11 20:12:01 2002 From: blair at orcaware.com (blair at orcaware.com) Date: Sun Aug 11 20:12:01 2002 Subject: [Orca-checkins] rev 148 - trunk/orca/orcallator Message-ID: <200208120311.g7C3Bcj4007137@orcaware.com> Author: blair Date: 2002-08-11 20:11:15 -0700 (Sun, 11 Aug 2002) New Revision: 148 Modified: trunk/orca/orcallator/orcallator.se trunk/orca/orcallator/start_orcallator.sh.in Log: * orcallator/orcallator.se: Upgrade to version 1.35. Add a new measurement, the number of secure web server processes on the system using the column name #httpsds. If the environmental variable WEB_SERVER_SECURE is defined, use its value as the regular expression to match on process names. If WEB_SERVER_SECURE is not defined, then count the number of httpsd's. New variable www_server_secure_proc_name to hold the regular expression. Increase the maximum number of disks that can be monitored using the RAWDISK code from 512 to 1024 by increasing MAX_RAWDISKS from 512 to 1024. Reformat and modify the usage message to fit the new WEB_SERVER_SECURE environmental variable. (count_procs): Renamed from count_proc. Take a list of regular expressions to match instead of just one regular expression. Return the number of process names that match each regular expression in a global integer array, count_procs_results. * orcallator/start_orcallator.sh.in: Set WEB_SERVER to httpd and and set WEB_SERVER_SECURE to httpsd and export them both into the environment for orcallator.se to use. Add documentation for these two variables. Modified: trunk/orca/orcallator/orcallator.se ============================================================================== --- trunk/orca/orcallator/orcallator.se (original) +++ trunk/orca/orcallator/orcallator.se Sun Aug 11 20:11:35 2002 @@ -8,6 +8,19 @@ // // Portions copied from percollator.se written by Adrian Cockroft. // +// Version 1.35: Aug 11, 2002 Add a new measurement, the number of secure web +// server processes on the system using the +// column name #httpsds. If the environmental +// variable WEB_SERVER_SECURE is defined, use its +// value as the regular expression to match on +// process names. If WEB_SERVER_SECURE is not +// defined, then count the number of httpsd's. +// Increase the maximum number of disks that can +// be monitored using the RAWDISK code from 512 to +// 1024 by increasing MAX_RAWDISKS from 512 to +// 1024. Reformat and modify the usage message to +// fit the new WEB_SERVER_SECURE environmental +// variable. // Version 1.34: Jul 14, 2002 Support for SE version 3.3. Break // compatibility with SE version 3.1, which was // released in April 1999, and older SE versions. @@ -481,10 +494,11 @@ // Variables for handling the httpd access log. #ifdef WATCH_WEB -string www_search_url = getenv("SEARCHURL"); -string www_server_proc_name = getenv("WEB_SERVER"); -string www_log_filename = getenv("WEB_LOG"); -string www_gateway = getenv("GATEWAY"); +string www_search_url = getenv("SEARCHURL"); +string www_server_proc_name = getenv("WEB_SERVER"); +string www_server_secure_proc_name = getenv("WEB_SERVER_SECURE"); +string www_log_filename = getenv("WEB_LOG"); +string www_gateway = getenv("GATEWAY"); ulong www_log_fp; uint www_gatelen; stat_t www_log_stat[1]; @@ -579,7 +593,7 @@ }; // Define global for tracking raw disk data. -#define MAX_RAWDISKS 512 +#define MAX_RAWDISKS 1024 RawDisk RAW_disk[MAX_RAWDISKS]; int RAW_disk_map=0; int RAW_disk_count=0; @@ -662,7 +676,7 @@ ulong time_void; char short_name[8]; - gettimeofday(time_update,time_void); + gettimeofday(time_update, time_void); update = time_update[0].tv_sec + (time_update[0].tv_usec / 1000000.0); delta = update - RAW_disk_lastupdate; RAW_disk_lastupdate = update; @@ -992,12 +1006,13 @@ fprintf(stderr, "usage: se [-Defines] %s [interval]\n", program_name); fprintf(stderr, "The default interval is %d seconds.\n", SAMPLE_INTERVAL); fprintf(stderr, "%s uses the following environmental variables:\n", program_name); - fprintf(stderr, " OUTDIR directory to write log files, output to stdout if not set\n"); - fprintf(stderr, " WEB_SERVER string to search for number of web servers, i.e. httpd\n"); - fprintf(stderr, " WEB_LOG location of web server access log, i.e. /httpd/logs/access\n"); - fprintf(stderr, " GATEWAY special address to monitor, i.e. some.where.com\n"); - fprintf(stderr, " SEARCHURL match for search scripts, default is search.cgi\n"); - fprintf(stderr, " COMPRESSOR compress previous days logs with this command, i.e. \"gzip -9\"\n"); + fprintf(stderr, " OUTDIR directory to write log files, output to stdout if not set\n"); + fprintf(stderr, " WEB_SERVER regex to match web server's name (def = httpd)\n"); + fprintf(stderr, " WEB_SERVER_SECURE regex to match secure web server's name (def = httpsd)\n"); + fprintf(stderr, " WEB_LOG location of web server access log (/httpd/logs/access)\n"); + fprintf(stderr, " GATEWAY special web address to monitor (some.where.com)\n"); + fprintf(stderr, " SEARCHURL regex for search scripts (def = search.cgi)\n"); + fprintf(stderr, " COMPRESSOR compress log files with this command (\"bzip2 -9\")\n"); fprintf(stderr, "Add these defines to enable monitoring of specific subsystems:\n"); fprintf(stderr, " -DWATCH_WEB watch web server access logs\n"); fprintf(stderr, " -DWATCH_PROXY use WEB_LOG as a NCSA style proxy log\n"); @@ -1104,6 +1119,11 @@ www_server_proc_name = "httpd"; } + if (www_server_secure_proc_name == nil || + www_server_secure_proc_name == "") { + www_server_secure_proc_name = "httpsd"; + } + if (www_gateway == nil || www_gateway == "" ) { www_gateway = "NoGatway"; www_gatelen = 0; @@ -2265,23 +2285,45 @@ #endif } -int count_proc(string name) +// Functions in SE cannot return an array, so to work around this, have +// count_procs place it's results in a global array. +#define MAX_COUNT_PROC_REGEXS 2 +int count_procs_results[MAX_COUNT_PROC_REGEXS]; +count_procs(int number_regexs, string regexs[]) { - int count; psinfo_t p; + int i; + + if (number_regexs > MAX_COUNT_PROC_REGEXS) { + fprintf(stderr, "%s: too many regular expressions (%d). Increase MAX_COUNT_PROC_REGEXS.\n", + program_name, number_regexs); + exit(1); + } + + for (i=0; i Author: blair Date: 2002-08-22 21:34:29 -0700 (Thu, 22 Aug 2002) New Revision: 149 Modified: trunk/orca/orcallator/orcallator.cfg.in Log: * orcallator/orcallator.cfg.in: Add a match on ce\d+ for the Sun GigaSwift Gigabit Ethernet card. Remove the extra data line for the "Disk Run Percent" plot that I inadvertently added. Modified: trunk/orca/orcallator/orcallator.cfg.in ============================================================================== --- trunk/orca/orcallator/orcallator.cfg.in (original) +++ trunk/orca/orcallator/orcallator.cfg.in Thu Aug 22 21:34:34 2002 @@ -330,7 +330,7 @@ plot { title %g Interface Bits Per Second: $1 source orcallator -data 1024 * 8 * ((?:(?:v?ge)|(?:skge))\d+)InKB/s +data 1024 * 8 * ((?:(?:ce)|(?:v?ge)|(?:skge))\d+)InKB/s data 1024 * 8 * $1OuKB/s line_type area line_type line1 @@ -628,7 +628,6 @@ plot { title %g Disk Run Percent source orcallator -data disk_runp_((?:c\d+t\d+d\d+)|(?:[ms]d\d+)) data disk_runp_((?:c\d+t\d+d\d+)|(?:c\d+d\d+)|(?:[ms]d\d+)) line_type line2 legend $1