Synchro Software User Guide: 2.2 Release Date: 2012-09-08
Synchro Software User Guide: 2.2 Release Date: 2012-09-08
User Guide
Version: 2.2
Release Date: 2012-09-08
Revision History
Table of Contents
1
Introduction ......................................................................................................................................... 1
1.1
What is Synchro?......................................................................................................................... 1
1.2
What Synchro Does with Your Data? .......................................................................................... 1
1.3
Why Use Synchro? ...................................................................................................................... 2
1.4
Architecture Overview.................................................................................................................. 3
1.5
Synchro Versions......................................................................................................................... 3
2
SynchroWeb Interface ........................................................................................................................ 4
2.1
Introduction .................................................................................................................................. 4
2.1.1
Views .................................................................................................................................... 4
2.1.2
Selecting Metrics................................................................................................................... 4
2.1.3
Selecting Time ...................................................................................................................... 5
2.1.4
Selecting Statistics................................................................................................................ 6
2.2
Basic Controls.............................................................................................................................. 8
2.3
Window Controls.......................................................................................................................... 8
2.4
Data Controls ............................................................................................................................... 9
2.5
View Controls............................................................................................................................. 10
2.6
Formats Description................................................................................................................... 11
2.6.1
PeriodStatistics Format....................................................................................................... 11
2.6.2
ByTimeStatistics Format ..................................................................................................... 16
2.6.3
Miscellaneous Formats ....................................................................................................... 19
3
Synchro Administration..................................................................................................................... 21
3.1
SynchroServer Installation ......................................................................................................... 21
3.1.1
Pre-Requisite ...................................................................................................................... 21
3.2
Installation Instructions .............................................................................................................. 21
3.3
SynchroServer Start/Stop Procedures....................................................................................... 22
3.4
SynchroClient Solaris Installation .............................................................................................. 22
3.5
SynchroClient Linux Installation................................................................................................. 23
3.6
SynchroClient Windows Installation........................................................................................... 25
4
SynchroServer Configuration............................................................................................................ 26
4.1
Basic Admin Controls ................................................................................................................ 26
4.2
Action Menu ............................................................................................................................... 26
4.3
SynchroServer Configuration..................................................................................................... 27
4.3.1
Server - Configuration......................................................................................................... 27
4.3.2
Server – Retention .............................................................................................................. 27
4.3.3
Server – Compression ........................................................................................................ 28
4.3.4
Server – Aggregator............................................................................................................ 28
4.3.5
Server – Logging................................................................................................................. 28
4.3.6
Logs and Alarm Parameters ............................................................................................... 28
4.3.7
Server - Internal Parameters............................................................................................... 29
4.4
Alarm Configuration ................................................................................................................... 29
4.5
MAVG Configuration .................................................................................................................. 30
4.6
Color Configuration .................................................................................................................... 31
4.7
Users Configuration ................................................................................................................... 31
4.8
Periods Configuration ................................................................................................................ 31
4.9
Aggregator Configuration........................................................................................................... 32
4.10
Compression Configuration...................................................................................................... 32
4.11
Retention Configuration............................................................................................................ 33
4.12
Client Configuration.................................................................................................................. 33
4.13
Dropfrom Configuration ............................................................................................................ 33
2.1 Introduction
The SynchroWEB interface is the main tool that users will utilize to interact with the
SynchroServer. Users can connect and use the SynchroWeb interface from the following
URL by using a web browser such as; Safari, Chrome, or Firefox:
http://ServerName:8080/Synchro/Synchro.html
2.1.1 Views
The SynchroWEB interface is built around the Views concept. Users can create Views that
are composed of any number of Data Windows. Data Windows present a set of data in a
diverse format (e.g., graphs, text, tables…). Views can be protected (read only) and,
depending on the SynchroServer mode, can also be hidden to other users.
To select which Time Series are to be reported on, Synchro uses PeriodStatistics.
The Search tool ( ), available in the Data Window/Data Controls, is used to search for Time
Series. Using this tool, users can select dates, periods, and a set of Time Series to be
displayed. The identifiers Component/Target and Type/Metrics are used to select Time
Series based on their name. Using the sliders; Click,Ctrl-Click,and Alt-Click, users can select
the Time Series to be reported on. Additionally, users can also enter a string in the overhead
fields to match a set of Time Series. Strings are composed of regular expressions. Using
this functionality, users can select many Time Series by entering only one string.
For example: The string “System[12345]|System[1.*1]” would match System 1 through 5 and
System10A1.
The table below describes the basic functionalities of regular expressions.
Character Signification
. (dot) Matches any single character except line break characters \r and \n.
^ (caret) Matches the start of the string the regex pattern is applied to.
$ (dollar) Matches the end of the string the regex pattern is applied to.
| (pipe) Causes the regex engine to match either the part on the left side, or the part
on the right side.
Note: More information on “regular expressions can” be found by searching the Internet.
The Search tool ( ) enables the user to select which date(s) and period(s) are to be used
for Time Based and Time Series selection.
The Time Sample ( ) is used to select the size of the Sliding Window that ranges from the
current server time, to a specified duration in the past (in seconds). This functionality is also
available in Options ( )/“Data and Range”/”Time Sample”.
Users can also select a specific interval of time using Options ( )/“Data and
Range”/”ZoomFrom”, and “Data and Range”/”ZoomTo” (Format “HHMMSS”).
Dates can be selected using the format YYYYMMDD in the Search tool. Dates and Periods
can also be relatively defined using the current SynchroServer Date/Period. Below are a few
examples:
Function Description
Today D-00
Yesterday D-01
ThisHour PH-00
LastHour PH-01
For each Time Series Synchro stores two (2) types of statistics. There are specific Synchro
Formats designed to report on the different statistics.
Note: When using statistics pay attention to the Function menu ( ) as this menu selects
which aggregation function is to be used for reporting.
The PeriodStatistics are designed to provide an overview over a Period of time of the
detailed second by second statistics. Users can define as many Periods as required. By
default, Synchro provides several Periods as presented in the following table.
For each second of the day, and for each Time Series, Synchro provides the Last (latest
value), Min, Max, Average, Count, and Sum of the data received. These second level
statistics are called ByTimeStatistics, and are designed to provide the level of detail
required to drill down into events that require more attention.
The following table demonstrates that for each second, the SynchroServer received ~2246
updates (count) for this particular Time Series. Other statistics for the data received are also
available.
Function
Description
Icon
The Home View icon is used to select the “home” view. The user uses
Synchro to create the Home view (view name is home). If Home view is
not defined, the “default” View is used.
The Report Icon is used to activate the Report Selector tool to view
already created reports.
View Controls provide basic view controls such as; Save, Save As, and
Delete for the views.
This is also the menu used to access the SynchroAdmin interface.
The Lock/UnLock icons show the status of the View. Only the owner of
/ the View can lock or unlock the View.
In addition, Synchro displays the View name, and the name of the current user in the upper
right portion of the screen.
Function
Description
Icon
Provides information about the status of the query sent to the server by
the SynchroWEB interface.
Close Data Window. Note – users cannot delete all Data Windows –
one Data Window must remain open.
Function
Description
Icon
The Search tool is used to select the Time Series to be reported on. In
addition, sort criteria and the Options / “Data and Range”/”Maximum
Number of Time Series” when used together, select which Time Series
are to be reported on.
The Option tool provides access to the “Window Control”, “Data and
Range”, and “Format Specific” options.
The Time Sample is used to select the size of the Sliding Window that
ranges from the current server time to the specified duration in the past
(in seconds). This functionality is also available with Options/“Data and
Range”/”Time Sample”. The values available in this menu can be
changed in the SynchroAdmin interface.
Selects the Periods be used for data selection (PeriodStatistics) and for
time selection. This functionality is also available in the Search tool. The
values available in this menu can be changed in the SynchroAdmin
interface.
Selects the Dates to be used for data selection. This functionality is also
available in the Search tool. The values available in this menu can be
changed in the SynchroAdmin interface.
View Controls are available in the upper right portion of the screen under the ( ) icon. The
following menu appears when the mouse pointer cursor hovers over the icon.
Function
Description
Icon
Share… Enables the user to create an URL where all Basic Controls are
removed. This is useful to provide a simple “read only” interface for
specific users.
View Options View Options present some controls over the View. More information is
available below.
SynchroAdmin This menu item launches the SynchroAdmin interface. This interface is
the tool the Synchro Server Administrator uses to configure the Synchro
Server.
Logout Logout logs the user out. Login information is requested as needed
when a user attemps to access a functionality that requires login
information.
The View Options menu presents the following controls over the View:
Export Format Selects which report format is to be used to export the data in
View Background Color Sets the View Background Color in a format acceptable in HTML:
i.e.: red, green, blue, #RRGGBB, rgb(0,0,0),and rgba(0,0,0,0))
Maximum Items Sets the maximum number of Time Series that can be extracted
Retrieved in a Search in a single search (default 1000).
Size Style Size of a View can be either “Fixed Size”, where the view size is
independent to the size of the browser screen, or “Resize to Fit”
(default), where the View size and included items resize
View Width/Height When “Fixed Size” Size Style is selected, these parameters
determine the size of the View (unit pixels).
The following formats present PeriodStatistics in diverse form; some of the most important
features of each format are presented.
Statistics (HTML)
Offers a view of the PeriodStatistics for a particular period.
StatBarGraph
Displays a dynamic histogram of selected statistics.
To do this, use the “Options/Format Specific/Custom Text” editor to write the text. Individual
statistics can then be inserted into the text using the “Options/Format Specific/Show Result
Table” in the format ${ColumnLine} as per the following example:
Highlights:
Highlights:
• Use “Options/Format Specific/” Min/Max/Step to set the parameters of the histogram.
Scatter Plot (Graph)
Displays the value of one Time Series against the values of another. In this example, it
displays the percentage of CPU used by a process, and CPU usage on the host.
Highlights:
• Displays descriptive statistics.
• Reverse time display
• Dynamic color selection
• Display Statistics
Highlights:
• Image can be stretched, cropped, or set to actual size.
Custom URL (HTML)
Enables the user to add the content of other web sites into a Synchro View by entering its
URL in “Options/Format Specific/Custom URL” as follows. This format is useful when adding
content from other WEB sites, and other SynchroServer to your Views. Use the
“Options/Window Control/Update” to set the refresh rate in seconds to the desired
frequency.
3.1.1 Pre-Requisite
SYSTEM: SynchroServer needs to be installed on a UNIX server (i.e., Linux SUSE, RedHat,
Centos, Ubuntu…, or Solaris). It needs at least 1 core, 2GB of RAM, and enough disks to
store data as per the retention policy.
A conformable configuration for SynchroServer would include 8 cores, 12 GB of RAM and
SSD drives.
Note: Slower disks can be used to store historized data. Please refer to the “Synchro
Performance Tuning” section for more information.
User: To install SynchroServer, the SynchroServer Administrator needs to decide on a user
that will own the software installation, data and processes. Typically a dedicated user gets
created for this purpose (for example: synchro, synchrodev synchroprod...). The user must
have access to enough data to keep historical data according to the retention policy. Also,
the user needs access to Java 6+ to run Synchro. Make sure Java is in the user's path.
synchro@SynchroHost:~$ java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
synchro@SynchroHost:~$ which java
Note: The license agreement will only appear on the demonstration version.
Preparing SynchroServer/dist/server.conf...
Verifying java installation
All done, installation complete.
SynchroServer is now installed. You can now connect and use the SynchroWeb interface at
the following URL (from a web browser e.g, IE or Firefox):
http://ServerName:8080/Synchro/Synchro.html
prompt $ SynchroSolaris/bin/start-client.sh
Starting: SolarisStatThreadNew
#See the interface in a web browser (IE,Chrome, Firefox…)using the URL below
http://ServerName:8080/Synchro/Synchro.html
Use the “Views” menu (upper right of the screen) to select what you want to see.
100%[========================================================================================
==>] 985,896 --.-K/s in 0.006s
#See the interface in a web browser (IE,Chrome, Firefox…)using the URL below
http://ServerName:8080/Synchro/Synchro.html
Use the “Views” menu (upper right of the screen) to select what you want to see.
Execute the installation package. The Synchro client will install itself as a WINDOWS
service.
It is possible to deploy the SynchroWindows without having the installation script displaying
the notification window. For this just a “–quiet” on the command line.
It can be accessed via the SynchroWeb interface under the “View Control”/ .
Configuration parameters are saved in the <SynchroServer/conf> directory. These
configurations are not affected by the installation or upgrade process.
Function
Description
Icon
The Action menu provides functionality like Stop the Server, Open and
Close the Statistics ports…
Let the user defined the content of the “Window Data Controls” presets
Garbage Collect Manually run the Java JVM garbage collection process
Close Stat Port Close the Statics acquiring port thus disconnection all probed and
agents – only the query port will remain open (For SynchroWEB and
SynchroAdmin interfaces).
Open Stat Port Opens that statistics collection port permitting clients and probes to
connect.
Load Layouts Manually Load the Views Layouts from disk without rebooting the
server.
Load Reports Manually Load the Reports from disk without rebooting the server.
Load Presets Manually Load the Data Controls Presets from disk without rebooting
the server.
Host Name Is the host name or IP address of the host that run the
SynchroServer – this parameter is inserted in the SynchroClients
packages so that they will connects to the SynchroServer without
shaving to set the parameter each time.
Stat Port TCP port that is used by clients and probes to connect to the
SynchroServer and send Time Series statistics.
Redirect HTTP Root Parameter that set the redirect from http://SynchroServer to
http://SynchroServer/Synchro/Synchro.html
Lock View Parameter that sets the SynchroServer in a mode where a login is
required to access any View
Memory Allocation The amount of memory available to the SychroServer is fixed at start
time. By default, the SynchroServer will not use more than 60% of
available physical memory available on the host running the server.
This can be change using this parameter. (unit: Megabyte)
Log Execute Time Sets the execute time of the retention utility on the SynchroServer
Logs
Log Nb Days Sets the number of days the SynchroServer will keep its internal logs
Report Execute Time Sets the execute time of the report utility
Report Nb Days Sets the number of days the SynchroServer will keep the reports it
created
Synchro Log Format Sets Synchro Log formats String – See below for the parameters
Syslog Format Sets the Syslog formats String – See below for the parameters
Syslog Host/Port Sets the Host and the Port to access the Syslog
Email Log Format Sets the Email alarm formats String – See below for the parameters
Smart SMTP Server Port to use to connect to the Email server to send Alarms
Port
%D: Date
%A: alarm name
%f: feed time HHMMSS
%F: feed time HH:MM:SS
%p: SynchroServer pid
Result Engine Count Number of internal engine that processes incoming HTTP queries
from SynchroWEB interfaces
Freemem Trigger Percentage of free memory threshold after which the SynchroServer
Level switched into memory protect mode and disconnects all clients and
probe leaving only the HTTP port open. Note that a disconnection
exception list can be configured – See Memory Trigger Exception
below
GCRuntime Trigger Duration in ms of the Java Garbage Collect process after which the
Level SynchroServer switched into memory protect mode and disconnects
all clients and probe leaving only the HTTP port open. Note that a
disconnection exception list can be configured – See Memory Trigger
Exception below
Filter Set the Time Series on which the alarm will be defined
OK/Warn/Critical/Fatal Sets the minimum value after which an Alarm of the respective lever
Trigger Level will be raised
Trigger Alarm On Sets if an Alarm will be raised when the Alarm level augments,
diminishes or both
Filter Set the Time Series on which the moving average will be defined
Description Name of the range – this name may be applied to the data in some
cases
Color Color definition acceptable in HTML: ie: red, green, blue, #RRGGBB,
rgb(0,0,0), rgba(0,0,0,0))
GID Group ID – Users in group “1” gets their selected data window
generated as reports.
Report Time Time at which the reports are generated for this particular user
Read-Only Account Sets the account as read only – so its can’t create of modify Views
Read views of users Sets that account so it can only see the Views created by a specific
set of users
Number of Days Number of days in the pas to read and group together
Dates <date-reg-ex>|<reldays>|<rel-day-of-week>|<dates>
date-reg-ex := YYYYMMDD | (reg ex with .* [ ^ $ and numbers to
describe a date with format YYYYMMDD)
reldays := D-XX | D-XX..D-XX (where XX is number of days relative
to current date when filter runs)
rel-day-of-week := W-XX (Where XX is number of working days
relative to current date when filter runs not counting week-end ie: D-
01 on monday is Friday)
Filter Set the Time Series on which the Aggregation will be defined
Dates to keep Exception to the rule can be made in the following format:
<date-reg-ex>|<reldays>|<rel-day-of-week>|<dates>
date-reg-ex := YYYYMMDD | (reg ex with .* [ ^ $ and numbers to
describe a date with format YYYYMMDD)
reldays := D-XX | D-XX..D-XX (where XX is number of days relative to
current date when filter runs)
rel-day-of-week := W-XX (Where XX is number of working days relative
to current date when filter runs not counting week-end ie: D-01 on
monday is Friday)
Filter Set the Time Series on which the rule will be defined
Dates to keep Exception to the rule can be made in the following format:
<date-reg-ex>|<reldays>|<rel-day-of-week>|<dates>
date-reg-ex := YYYYMMDD | (reg ex with .* [ ^ $ and numbers to
describe a date with format YYYYMMDD)
reldays := D-XX | D-XX..D-XX (where XX is number of days relative
to current date when filter runs)
rel-day-of-week := W-XX (Where XX is number of working days
relative to current date when filter runs not couting week-end ie: D-01
on monday is Friday)
Filter Set the Time Series on which the rule will be defined
Appendix A. SynchroClients
SynchroClients are used to collect technical metrics from computers. The metrics are
collected every seconds and includes the following technical measurements when available:
All disk attached to the DISK TPS, WSEC, RSEC, KBYWSEC, KBYRSEC, IOWAIT,
host QLEN, AWTIME, IOMSEC, STIME
A.1 SynchroLinux
It is possible to throttle the SynchroLinux SynchroClient. There is a configuration file present
on each SynchroLinux clients:
synchro@affa2:~$ cat SynchroLinux/conf/client.ini
CPU=yes
DISK=yes
MEM=yes
NET=yes
PROC=yes
FS=yes
PROC-CPU-THRESHOLD=0.01
PROC-MEM-THRESHOLD=0.011
PROC-RSS-THRESHOLD=0.01
The Boolean switches CPU (CPU usage and other metrics at host level), DISK (per disks
subsystem metrics), MEM (memory usage at the host level), NET (network interfaces
metrics), PROC (processes metrics), FS (file system metrics) are used to turn on and off the
associated metric collection by the SynchroCLient.
If the PROC switch is on (“yes”) (Process metrics collection is activated), you can use the
PROC-XXX-THRESHOLD to fix the level of sensibility to processes (expressed in
percentage). For example a value PROC-CPU-THRESHOLD=10 will report statistics only
for processes that use at least 10% of one core of CPU (thus removing some of processes
and keeping only “important processes”).
A.2 SynchroWindows
It is possible to deploy the SynchroWindows without having the installation script displaying
the notification window. For this just a “–quiet” on the command line.
For example, this would be the C string for the *init* message if the client name is
Computer1:
sprintf( s, "SC01\tinit\t%s\n", "Computer1" );
*Client stat message:*:The /*stat*/ message is used to send the metric values to the
server.
Header: SC01
Command: /*stat*/
Parameter1: < YYYYMMDD.HHMMSS >
Parameter2: <metric value>
...
Parameter<n>: <metric value>
Alternatively, the user can select to use the server time instead of the client. To use the
server time replace “YYYYMMDD.HHMMSS” by “server.time” string.
For example: the metric value format is (PROC is the type, CPU is the metric, perl is the
target, 32.99 is the actual cpu time of the perl process):
sprintf( s, "%s_%s_%s=%8.2f", "PROC", "CPU", "perl", 32.99 );
You can append many metrics to the message, as long as they are all from the same
date/time. Each metric value must be separated by a \t.
sprintf( s,
"SC01\tstat\t20080101.235559 \tPROC_CPU_perl=32.99\tPROC_MEM_perl=4.32\n", );
*Client dumpconf message: The /*dumpconf*/ message is not mandatory and is used to
send back to the serveur some configuration information about the client.
Header: SC01
Command: /*dumpconf*/
Parameter1: <filename>
Parameter2: <line1>
Parameter3: <line2>
...
Parameter<n>: <line<n>>
*Server conf message:* The server /*conf*/ message is used by the server to tell the client
about some configuration parameters.
Header: SS01
Command: /*conf*/
Parameter1: Stat=n
Parameter2: DumpConf=1
Parameter3: <line1 of client conf file>
Parameter4: <line2 of client conf file>
Parametern: <line<n> of client conf file>
Stat=n is the number of seconds the server is expecting stat message from the client.
Currently used by the Windows and Unix client for the general metric values. It is ignored by
the ExternalSource plugins.
DumpConf=0 or DumpConf=1 is the server asking for basic configuration information which
the client should send when the first ever connection is made. This is usually to help
diagnose and identify client setup and host machine. It is not mandatory for the client to
answer the DumpConf request.
Telnet session sample:
### Previous line has spaces but not tab last line
SC01 stat 20080101.112235 PROC_CPU_perl=32.77 PROC_MEM_perl=5.02
^]q
telnet> q
Connection closed.
B.2 SynchroTail
SynchroTail is a very useful tool to read application logs. It understands log file patterns, and
can change files automatically when new files are created. SynchroTail can also be
restarted to continue reading from the file it was reading when it was stopped.
Here are some of the parameters of SynchroTail -
java -jar SynchroTail.jar "FilePattern=<regex>" [FirstFile=<filename>]
[SortBy=time|filename] [FileTimeout=<nb seconds>] [EOFTimeout=<nb seconds>]
[BaseDir=<dirname to search>] [ZTail=yes|no]
All parameters are optional except for FilePattern.
FileTimeout Is the number of seconds that the program will wait for the
EOF before concluding that the file is completed. Default is
five (5) seconds.
EOFTimeout Is the number of seconds that the program will wait for new
files before concluding that no additional files are to be
processed. Default is five (5) seconds. The program waits
FileTimeout on a particular file, and then waits EOFTimeout
to see if other files are to be processed.If no file appears, the
program stops.
RestartFileName=filename Is the name of the file where SynchroTail will store the
information needed to restart.
lps=XXX Lines Per Second is the maximum number of lines per second that can
be read in a file by SynchroTail.
delimiter=Char Is the character to be used as a delimiter in place of end-of-line.
mbps=XXX Mega Byte Per Second is the maximum number of bytes per second that
can be read in a file by SynchroTail.
$Server="SynchroServerHostName";
$Port=9123;
$HOST=`hostname`;chomp($HOST);
$ServerID->print("SC01\tinit\tFIOMonitor\n");
$line = $ServerID->getline;
print ($line);
while (1){
$X=`cat /proc/fusion/fio/fioa/data/free_lebs`;chomp($X);
$Line1= "SC01\tmstat\tserver.time\tFIOMonitor\_FIO\_FreeLebs\_$HOST-fioa\=$X\t";
ServerID->print("$Line1\n");
sleep (1);
}
SCRIPT:
#!/bin/bash
while (true); do
if [ "$Init" = "1" ]; then
Time=`date +%Y%m%d.%H%M%S`;
echo -en "SC01 mstat $Time\t"
for Host in `cat HostList.txt`; do
Latency=`ping -c 1 affa8|grep "time=" |cut -d= -f4|cut -d' ' -f1,1`;
SCRIPT
host:~/TailExample/bin$ cat Injector-Tail-Example-01.pl
#!/usr/bin/perl -w
use English;
use Getopt::Long;
my $Version="Version 0.0.3";
my %opts = (
"help" => \$Help,
"version" => \$ShowVersion,
"Dir=s" => \$Dir,
"Date=s" => \$Date,
"Server=s" => \$Server,
"Port=s" => \$Port,
"Component=s" => \$Component,
"Java=s" => \$Java,
"LogDir=s" => \$LogDir,
"LogFile=s" => \$LogFile,
"File=s" => \$File,
"Debug" => \$Debug,
"Restart" => \$Restart,
"SyncroTail=s" => \$SynchroTail,
);
die ("Need a Component name, use the -Component switch") unless defined($Component);
die ("Need a Server name to connect to, use the -Server switch") unless defined($Server);
$SynchroTail="../SynchroTail/lib/SynchroTail.jar" unless defined ($SynchroTail);
die "Cannot find SynchroTail.jar, use the -SynchroTail switch (default:$SynchroTail)" unless
(-e $SynchroTail);
$Java="java" unless defined ($Java);
#die "Cannot find java, use the -java switch (default:$Java)" unless (-e $Java);
die("Need file Pattern to proceed, use the -file switch.") unless defined ($File);
$Dir="./" unless defined ($Dir);
$DateCmd="date" unless defined ($DateCmd);
$Date=`$DateCmd +%Y%m%d` unless defined ($Date);chomp($Date);
sub MatchExpression;
my $TmpDate;
my $TmpProcess;
my $TmpTarget;
my $TmpMetricString;
while ($Line=<DATAFILE>){
chomp($Line);
($MyDate,$Time,$ClientID,$ProductID,$Qty)=split(/;/,$Line);
sub Print {
my ($MyDate, $MyTime,$Component, $Type,$Metric,$Target,$Value)=@_;
$TmpStr=$MyDate.".".$MyTime;
if (!($MyTime eq $OldTime)){
Send("SC01\tinit\t$Component\n") if ($OldTime eq "");
printf (LOGFILE "#SENDING SC01\tinit\t$Component\n")if defined
($Debug);
$MetricRate=0 if ($OldTime eq "");
Send("\n") unless ($OldTime eq "");;
select(undef, undef, undef, $Delay);
Send("SC01\tmstat\t$TmpStr\t");
printf (LOGFILE "#SENDING SC01\tmstat\t$TmpStr\t\n")if defined
($Debug);
$OldTime=$MyTime;
$GlobalRate=0;
}
$MetricRate++;
if ($GlobalRate > $MaxRate){
Send("\n");
printf (LOGFILE "#SENDING \n")if defined ($Debug);
select(undef, undef, undef, $Delay);
Send("SC01\tmstat\t$TmpStr\t");
printf (LOGFILE "#SENDING SC01\tmstat\t$TmpStr\t\n")if defined
($Debug);
$GlobalRate=0;
};
$GlobalRate++;
my $MyTmpTarget=substr($Target,0,30);
$MyTmpTarget=~s/[\=\-\,\;+\ \_]//g;
$TmpStr=$Component."_".$Type."_".$Metric."_".$MyTmpTarget."=".$Value;
Send("$TmpStr\t");
printf (LOGFILE "#SENDING $TmpStr\t\n")if defined ($Debug);
}
sub Send{
my ($SendTmpString)=@_;
$ServerID->print("$SendTmpString");
$Status=$ServerID->errmsg;
while (! ($Status eq "")){
sleep(1);
print ("CONNECTION ERROR -retrying...\n");
printf (LOGFILE "CONNECTION ERROR -retrying...\n");
$ServerID->close(Host => $Server,Port => $Port);
$ServerID->open(Host => $Server,Port => $Port);
$ServerID->print("SC01\tinit\t$Component\n");
$Status=$ServerID->errmsg;
if ($Status eq ""){
print ("CONNECTION OK.\n");
printf (LOGFILE "CONNECTION OK\n");
$ServerID->print("$SendTmpString");
$Status=$ServerID->errmsg;
};
}
}
Grouping of all clients and products activity also creates a second by second overall activity
by clients and products id done by the expression below. Instead of having the script
sending another transaction, this grouping could have also been be done by the
SynchroServer using “Time Series Mapping”.
Print($MyDate, $Time,$Component,"Product","Quantity","ALL",$Qty) unless (defined($NoSend));
#!/usr/bin/perl -w
use Getopt::Long;
my %opts = (
"Date=s" => \$Date,
"NBClient=s" => \$NBClient,
"NBProduct=s" => \$NBProduct,
"MaxQty=s" => \$MaxQty,
"Rate=s" => \$Rate,
);
0
GetOptions(%opts);
for ($Hour=0;$Hour<24;$Hour++){
$FileString=sprintf("LogFile-$Date-%02d.log", $Hour);
open ( LOGFILE, ">$FileString") || die "Cannot open file : $FileString";
for ($Min=0;$Min<60;$Min++){
for ($Sec=0;$Sec<60;$Sec++){
for ($It=0;$It<$Rate;$It++){
$HourStr = sprintf("%02d%02d%02d",$Hour,$Min,$Sec);
$ClientStr=sprintf("%05d", int(rand($NBClient)));
$ProductStr=sprintf("%05d", int(rand($NBProduct)));
$QtyStr=sprintf("%05d", int(rand($MaxQty)));
printf(LOGFILE
"$Date$Separator$HourStr$Separator$ClientStr$Separator$ProductStr$Separator$QtyStr\n");
}
}}
close(LOGFILE);
}
#!/usr/bin/perl -w
use English;
use Getopt::Long;
use IO::Handle;
use Net::Telnet ();
my $Version="Version 0.0.3";
my %opts = (
"help" => \$Help,
"version" => \$ShowVersion,
"Dir=s" => \$Dir,
"Date=s" => \$Date,
"Server=s" => \$Server,
"Port=s" => \$Port,
);
die ("Need a Component name, use the -Component switch") unless defined($Component);
die ("Need a Server name to connect to, use the -Server switch") unless defined($Server);
$SynchroTail="../SynchroTail/lib/SynchroTail.jar" unless defined ($SynchroTail);
die "Cannot find SynchroTail.jar, use the -SynchroTail switch (default:$SynchroTail)" unless
(-e $SynchroTail);
$Java="java" unless defined ($Java);
#die "Cannot find java, use the -java switch (default:$Java)" unless (-e $Java);
die("Need file Pattern to proceed, use the -file switch.") unless defined ($File);
$Dir="./" unless defined ($Dir);
$DateCmd="date" unless defined ($DateCmd);
$Date=`$DateCmd +%Y%m%d` unless defined ($Date);chomp($Date);
my $TmpDate;
my $TmpProcess;
my $TmpTarget;
my $TmpMetricString;
while ($Line=<DATAFILE>){
chomp($Line);
#Date(YYYYMMDD);Hour(HHMMSS);ClientID;ProductID;Qty
($MyDate,$Time,$ClientID,$ProductID,$Qty)=split(/;/,$Line);
#printf( LOGFILE "###$MyDate,$Time,$ClientID,$ProductID;$Qty\n")if defined ($Debug);
sub Print {
my ($MyDate, $MyTime,$Component, $Type,$Metric,$Target,$Value)=@_;
$TmpStr=$MyDate.".".$MyTime;
if (!($MyTime eq $OldTime)){
Send("SC01\tinit\t$Component\n") if ($OldTime eq "");
printf (LOGFILE "#SENDING SC01\tinit\t$Component\n")if
defined ($Debug);
$MetricRate=0 if ($OldTime eq "");
Send("\n") unless ($OldTime eq "");;
select(undef, undef, undef, $Delay);
Send("SC01\tmstat\t$TmpStr\t");
printf (LOGFILE "#SENDING SC01\tmstat\t$TmpStr\t\n")if
defined ($Debug);
$OldTime=$MyTime;
$GlobalRate=0;
}
$MetricRate++;
if ($GlobalRate > $MaxRate){
Send("\n");
printf (LOGFILE "#SENDING \n")if defined ($Debug);
select(undef, undef, undef, $Delay);
Send("SC01\tmstat\t$TmpStr\t");
printf (LOGFILE "#SENDING SC01\tmstat\t$TmpStr\t\n")if defined
($Debug);
$GlobalRate=0;
};
$GlobalRate++;
my $MyTmpTarget=substr($Target,0,30);
$MyTmpTarget=~s/[\=\-\,\;+\ \_]//g;
$TmpStr=$Component."_".$Type."_".$Metric."_".$MyTmpTarget."=".$Value;
Send("$TmpStr\t");
printf (LOGFILE "#SENDING $TmpStr\t\n")if defined ($Debug);
}
sub Send{
my ($SendTmpString)=@_;
$ServerID->print("$SendTmpString");
$Status=$ServerID->errmsg;
while (! ($Status eq "")){
sleep(1);
print ("CONNECTION ERROR -retrying...\n");
printf (LOGFILE "CONNECTION ERROR -retrying...\n");
$ServerID->close(Host => $Server,Port => $Port);
$ServerID->open(Host => $Server,Port => $Port);
$ServerID->print("SC01\tinit\t$Component\n");
$Status=$ServerID->errmsg;
if ($Status eq ""){
print ("CONNECTION OK.\n");
printf (LOGFILE "CONNECTION OK\n");
$ServerID->print("$SendTmpString");
$Status=$ServerID->errmsg;
};
}
}
Merge Engine Count Number of internal engines that processe incoming Statistics from
clients and probes.
Result Engine Count Number of internal engines that processe incoming HTTP queries
from SynchroWEB interfaces.