Download
Easy Integration
Easy integration

It is easy to integrate your data in Synchro. You can use one of the following methods to get the full advantages of the Synchro tool. You can integrate any numbers or events throughout the enterprise – like rates (clicks, transactions, procedure calls…), response times (transactions, user activity, time to execute, form fill time), system states, temperature, pressure, speed… 


  • Technical Probes (SynchroClient)
    SynchroClients are used to collect technical metrics (CPU, memory, disks…) from computers. SynchroClients are available for Linux (Ubuntu, Redhat, SuSe), Solaris and Windows.
  • Big Data and log files (SynchroTail)
    SynchroTail is a very useful tool that reads other application logs and sends the data needed to the SynchroServer.
    • Reads from files in real-time (tail).
    • Supports compressed files.
    • Supports log file name pattern matching.
    • Changes file automatically when new files are created.
    • Supports restart when it was stopped.
    • Stops reading when the SynchroServer becomes unavailable.
    • Support internal regular expression matching.
    See the Synchro User Guide for more details on SynchroTail.
  • SynchroTail – Internal Matching – Example 1
    In this example of SynchroTail, we integrate the content of the Linux file /proc/meminfo to the SynchroServer at the one second level precision. This file is refreshed every second by the operating system. The integration is done by executing one command line. A file containing some information that tells SynchroTail where to find the data inside the file is also needed.
    $ cat Expression-direct.conf
    
    myexprid1,(.+)[:]\s+(\d+)\s(..),,Date[]_Time[]_Component[$c]_Type[MEMINFO]_Metric[$1-$3]_Target[MEMINFO]_Value[$2],(.+)[:]\s+(\d+)\s(..)
    
    myexprid2,,(.+)[:]\s+(\d+)\s(..),Date[]_Time[]_Component[$c]_Type[MEMINFO]_Metric[$1]_Target[MEMINFO]_Value[$2],(.+)[:]\s+(\d+).*
    
    myexprid3,,(.+)\(.*\)[:]\s+(\d+)\s(..),Date[]_Time[]_Component[$c]_Type[MEMINFO]_Metric[$1]_Target[MEMINFO]_Value[$2],(.+)\(.*\)[:]\s+(\d+).*
    
    
    $ java -jar ../SynchroTail/lib/SynchroTail.jar  logfile=../log/SynchroTail.log  synchroserver=localhost serverport=9123 BaseDir="/proc" filepattern="meminfo"  expressionfile=Expression-direct.conf outputstyle=quiet firstfile=meminfo sortby=single monitortime=1 notifytimeout=1 peeknextfiledelay=1 filetimeout=1 eoftimeout=1 component=`hostname` &
    
    							
  • SynchroTail – Internal Matching – Example 2
    In this example, a simulator creates an hourly log file representing transactions. This data is sent in real time to the SynchroServer as it becomes available. The format of the log file name is as follow: LogFile-YYYYMMDD-HH.log.

    The format of the log is Date (YYYYMMDD);Hour (HHMMSS);ClientID (Integer);ProductID (Integer);Qty (Integer). The integration is done by executing one command line. A file containing some information that tells the SynchroTail where to find the data inside the file is also needed.
    $ ls LogFile-20121218-*|head -5
    
    LogFile-20121218-00.log
    
    LogFile-20121218-01.log
    
    LogFile-20121218-02.log
    
    LogFile-20121218-03.log
    
    LogFile-20121218-04.log
    
    $ head -5 LogFile-20121218-00.log
    
    20121218;000000;00009;00004;00007
    
    20121218;000000;00001;00000;00006
    
    20121218;000000;00009;00004;00009
    
    20121218;000000;00007;00002;00004
    
    20121218;000000;00004;00001;00001
    
     
    
    $ cat Expression.conf
    
    myexprid,,,Date{yyyyMMdd}[$1]_Time{HHmmss}[$2]_Component[TailExample]_Type[Client]_Metric[Quantity]_Target[Client-$3]_Value[],(\d+);(\d+);(\d+);\d+;(\d+)
    
    myexprid,,,Date{yyyyMMdd}[$1]_Time{HHmmss}[$2]_Component[TailExample]_Type[Product]_Metric[Quantity]_Target[Product-$3]_Value[],(\d+);(\d+);\d+;(\d+);(\d+)
    
    myexprid,,,Date{yyyyMMdd}[$1]_Time{HHmmss}[$2]_Component[TailExample]_Type[ALL]_Metric[Quantity]_Target[ALL]_Value[],(\d+);(\d+);\d+;\d+;(\d+)
    
    $ java -jar ../SynchroTail/lib/SynchroTail.jar  logfile=../log/SynchroTail.log  synchroserver=localhost serverport=9123 sortby=filename filepattern="LogFile-20121218.*" RestartFileName=restart.ini RestartAllowOverlap=yes expressionfile=Expression.conf  outputstyle=debug lps=1
    
    20121218;000000;00009;00004;00007
    
    SC01 mstat 20121218.000000 TailExample_Client_Quantity_Client-00009=00009
    
    SC01 mstat 20121218.000000 TailExample_Product_Quantity_Product-00004=00004
    
    SC01 mstat 20121218.000000 TailExample_ALL_Quantity_ALL=00007
    
    20121218;000000;00001;00000;00006
    
    SC01 mstat 20121218.000000 TailExample_Client_Quantity_Client-00001=00001
    
    SC01 mstat 20121218.000000 TailExample_Product_Quantity_Product-00000=00000
    
    SC01 mstat 20121218.000000 TailExample_ALL_Quantity_ALL=00006
    
    20121218;000000;00009;00004;00009
    
     
    
    $ java -jar ../SynchroTail/lib/SynchroTail.jar  logfile=../log/SynchroTail.log  synchroserver=localhost serverport=9123 sortby=filename filepattern="LogFile-20121218.*" RestartFileName=restart.ini RestartAllowOverlap=yes expressionfile=Expression.conf  outputstyle=quiet lps=1000
    							
  • SynchroTail – External Matching – Perl
    In this example, a simulator creates an hourly log file representing transaction made by clients on products. The format of the log file name is as follow: LogFile-YYYYMMDD-HH.log.

    The format of the log is Date (YYYYMMDD);Hour (HHMMSS);ClientID (Integer);ProductID (Integer);Qty (Integer). The integration is done by executing a perl script that opens (pipe) the SynchroTail. The perl script parses the file and sends the information needed to the SynchroServer.
    ./Injector-Tail-Example-01.pl -component TailExample -server localhost -file "LogFile-20121209.*" -dir ./ -SyncroTail ../SynchroTail/lib/SynchroTail.jar
    
    #!/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,
           "Component=s"     => \$Component,
           "Java=s"          => \$Java,
           "LogDir=s"        => \$LogDir,
           "LogFile=s"       => \$LogFile,
           "File=s"          => \$File,
           "Debug"           => \$Debug,
           "Restart"         => \$Restart,
           "SyncroTail=s"    => \$SynchroTail,
    
    );
    
    GetOptions(%opts); &usage() if ($Help); die "$Version\n" if $ShowVersion;
    sub Print;
    sub Execute;
    sub ProcessData;
    
    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("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);
    
    $LogDir="../log/" unless defined ($LogDir);
    $LogFile="$LogDir/TailExample.$Date.log" unless defined $LogFile;
    open ( LOGFILE, ">$LogFile") || die "Cannot open file : $LogFile";
    
    $Port=9123 unless defined ($Port);
    $ServerID = new Net::Telnet (Errmode=>"return",Timeout => 10, Telnetmode => 0, Output_record_separator => "");
    $ServerID->open(Host => $Server,Port => $Port);
    my $OldTime=""; my $GlobalRate=0; my $MaxRate=30000; $Delay=0.01;  #100
    
    sub MatchExpression;
    my $TmpDate;
    my $TmpProcess;
    my $TmpTarget;
    my $TmpMetricString;
    
    $TmpString="$Java -jar $SynchroTail lps=1000 synchroserver=$Server serverport=$Port logfile=$LogDir/SynchroTail.log sortby=filename basedir=$Dir filepattern=\"$File\" RestartFileName=restart.ini RestartAllowOverlap=yes|"; 
    
    $TmpString="$Java -jar $SynchroTail restart.ini|" if defined ($Restart); 
    
    printf (LOGFILE "$TmpString\n") if defined($Debug);
    open ( DATAFILE, $TmpString) || die "Cannot open $TmpString";
    
    while ($Line=){ 
        chomp($Line);
        ($MyDate,$Time,$ClientID,$ProductID,$Qty)=split(/;/,$Line);
        Print($MyDate, $Time,$Component,"Client","Quantity",$ClientID,$Qty) unless (defined($NoSend));
        Print($MyDate, $Time,$Component,"Client","Quantity","ALL",$Qty) unless (defined($NoSend));
        Print($MyDate, $Time,$Component,"Product","Quantity",$ProductID,$Qty) unless (defined($NoSend));
        Print($MyDate, $Time,$Component,"Product","Quantity","ALL",$Qty) unless (defined($NoSend));
    }
    
    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;    
            };
        }
    }
    							
  • Java snippet
    public static void synchroSendStat(String clientGUID, String component, String target, String type, 
        String metric, double value){
        try {
            try {
                SocketChannel sc = SocketChannel.open();
                sc.connect(new InetSocketAddress(prServerAddress, prPort));
                // this.sc.configureBlocking(false);
                while (!sc.finishConnect()) {
                    Thread.sleep(10);
                }
                String message = "SC01 init clientGUID\n";
                ByteBuffer bb = ByteBuffer.wrap(message.getBytes("UTF-8"));
                String message = "SC01 mstat server.time " + 
                    component + "_" + type + "_" + metric + "_" + target + "=" + value + "\n";
                ByteBuffer bb = ByteBuffer.wrap(message.getBytes("UTF-8"));
                sc.write(bb);
            } catch (Exception e) {
                SynchroTailLogger.printException(e);
            }
            this.sc.close();
        } catch (Exception e) {
            SynchroTailLogger.printException(e);
        }
    }
    							
  • C/C++ snippet
    #include <sys/socket.h>
    #include <sys/types.h>
    #include <netinet/in.h>
    #include <netdb.h>
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <errno.h>
    #include <arpa/inet.h> 
    
    int main(int argc, char *argv[])
    {
        int sockfd = 0, n = 0;
        char recvBuff[1024];
        struct sockaddr_in serv_addr; 
    
        memset(recvBuff, '0',sizeof(recvBuff));
        if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
        {
            printf("\n Error : Could not create socket \n");
            return 1;
        } 
    
        memset(&serv_addr, '0', sizeof(serv_addr)); 
    
        serv_addr.sin_family = AF_INET;
        serv_addr.sin_port = htons(5000); 
    
        if(inet_pton(AF_INET, "192.168.0.1", &serv_addr.sin_addr)<=0)
        {
            return 1;
        } 
    
        if( connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
        {
           printf("\n Error : Connect Failed \n");
           return 1;
        } 
        char message[256];
        bzero(buffer, 256);
        sprintf(buffer, "SC01 init %s\n", "myclientGUID");
        write( sockfd, message, strlen(message) );
    
        bzero(buffer, 256);
        sprintf(buffer, "SC01 mstat server.time %s_%s_%s_%s=%f\n", 
            "mycomponent", "mytype", "mymetric", "mytarget", 3.2);
        write( sockfd, message, strlen(message) );
    
        close(sockfd);
    
        return 0;
    }
    							
  • PHP snippet
    <?php
    function SynchroSendSingleStat($clientguid, $component, $target, $type, $metric, $value)
    {
        $sock = pfsockopen('localhost', 9123);
        if( $sock )
        {
            fwrite($sock, "SC01 init $clientguid\n");
            fwrite($sock, "SC01 mstat server.time $component"."_$type"."_$metric"."_$target=$value\n");
            fclose($sock);
        }
    }
    ?>
    							
  • Perl snippet
    #!/usr/bin/perl -w
    use Net::Telnet ();
    $Port=9123;
    $Server="localhost";
    $ClientGUID="xxx";
    $$ServerID = new Net::Telnet (Errmode=>"return",Timeout => 10, Telnetmode => 0, Output_record_separator => "");
    $ServerID->open(Host => $Server,Port => $Port);
    sub Send{
        my ($Component, $Type,$Metric,$Target,$Value)=@_;
        my $MyTmpTarget=$Target;;
        $MyTmpTarget=~s/[\=\-\,\;+\ \_]//g;
        $ServerID->print("$Component."_".$Type."_".$Metric."_".$MyTmpTarget."=".$Value");
        $Status=$ServerID->errmsg;      
        while (! ($Status eq "")){
            sleep(1);
            $ServerID->close(Host => $Server,Port => $Port);
            $ServerID->open(Host => $Server,Port => $Port);
            $ServerID->print("SC01\tinit\t$ClientGUID\n");
            $Status=$ServerID->errmsg;      
            if ($Status eq ""){
                $ServerID->print("SC01 mstat server.time ".$Component."_".$Type."_".$Metric."_".$MyTmpTarget."=".$Value."\n");
                $Status=$ServerID->errmsg;      
            };
        }
    }
    Send("mycomponent", "mytype", "mymetric", "mytarget", 1.0);
    							
  • Synchro Text Protocol

    To directly integrate other applications to the SynchroServer you can use the Synchro trivial text based TCP protocol.


    Using this protocol you can send any number or events to the SynchroServer.


    See APPENDIX B of the Synchro User Guide for more details.

    telnet localhost 9123
    SC01 init myclientguid
    SC01 mstat server.time mycomponent_mytype_mymetric_mytarget=1.0 mycomponent_mytype_mymetric_mysecondtarget=2.3
    ...
    							
Synchro Versions More information
Synchro Presentation
More videos about Synchro