Results 1 to 2 of 2

Thread: LogAnalyzer - Oscam filter timeouts and not found

  1. #1

    LogAnalyzer - Oscam filter timeouts and not found

    Hello Everyone,


    I made a script to analyze your oscam.
    if you don't want logs of some peers you can define it below example


    name1="name" replace name with a peer name like name1="tleko" only inside the Quotes
    in this script you can remove 10 peers.


    Make a folder oscam_logs into var command: mkdir /var/oscam_logs
    make file called: loganalyzer.sh (doesn't matter where you locate it)
    locate you oscam logfile inside the script
    when you run this script it will give statics which is made by CapNCooK but without the peers you given


    The options of this script
    1: Option 1 - FILTER TIMEOUTS = will generate a file with all the timeouts
    2: Option 2 - FILTER NOTFOUND = will generate a file with all the not founds
    3: Option 3 - CLEAR OSCAMLOG = clears the log which is gerenating by oscam
    4: Option 4 - CLEAR OSCAM_LOGS FOLDER = clearing the logs inside /var/oscam_logs that are made.
    5: OPTION 5 - Quit




    Code:
     
    
    #!/bin/bash
    # THIS SCRIPT MADE BY MONSTER -> SANDERWAR@HOTMAIL.COM
    # Make a folder command: mkdir /var/oscam_logs
    # LOCATE YOUR OSCAM LOG
    
    
    TODAY=$(date +"%m-%d-%Y")
    FILE=/var/oscam_logs/oscam_log_$TODAY
    echo "REMOVING OSCAMLOG OF TODAY IF EXIST"
    rm -R $FILE
    
    
    oscamlog=/tmp/oscam.log #oscam logfile location
     
    echo "COPYING OSCAMLOG TO ANOTHER LOCATION"
    cat $oscamlog >> /var/oscam_logs/oscam_log_$TODAY   #LOCATION OF OSCAMLOG IS /tmp/oscam.log
    
    
    #FILL HERE THE NAMES OF THE PEERS YOU DONT WANT TO LOG
    name1="name"
    echo $name1
    name2="name"
    echo $name2
    name3="name"
    echo $name3
    name4="name"
    echo $name4
    name5="name"
    echo $name5
    name6="name"
    echo $name6
    name7="name"
    echo $name7
    name8="name"
    echo $name8
    name9="name"
    echo $name9
    name10="name"
    echo $name10
    
    
    
    
    echo "Removing names"
    echo " "
    sed --in-place /$name1/d $FILE
    sed --in-place /$name2/d $FILE
    sed --in-place /$name3/d $FILE
    sed --in-place /$name4/d $FILE
    sed --in-place /$name5/d $FILE
    sed --in-place /$name6/d $FILE
    sed --in-place /$name7/d $FILE
    sed --in-place /$name8/d $FILE
    sed --in-place /$name9/d $FILE
    sed --in-place /$name10/d $FILE
    
    
    
    
    echo  "IN THIS SECTION I USED THE SCRIPT THAT MADE BY CapNCooK"
    echo "Top 10 of best readers:"
    grep `date +%Y/%m/%d` $FILE | grep ' ms) by ' | awk '{print $11}' | sort | uniq -c | sort -nr | head -10
    echo
    echo "Top 10 users hammering on providers:"
    grep `date +%Y/%m/%d` $FILE | grep ' ms) by ' | awk '{print $5$6}' | sed "s/(/ /" | cut -f 1 -d'/' | sort | uniq -c | sort -nr | head -10
    echo
    echo "Top 10 users by usage:"
    grep `date +%Y/%m/%d` $FILE | grep ' ms) by ' | awk '{print $5}' | sort | uniq -c | sort -nr | head -10
    echo
    echo "Top 15 channels answered from cache:"
    grep `date +%Y/%m/%d` $FILE | grep 'found' | grep 'cache' | awk '{print $12" "$13" "$14" "$15" "$16}' | sort | uniq -c | sort -nr | head -15
    echo
    echo "Top 15 channels that timed out:"
    grep `date +%Y/%m/%d` $FILE | grep 'timeout' | grep 'by' | awk '{print $14" "$15" "$16}' | sort | uniq -c | sort -nr | head -15
    echo
    echo "Top 15 users that experienced time-outs (on channel):"
    grep `date +%Y/%m/%d` $FILE | grep 'timeout' | grep 'by' | awk '{print $5" -- "$14" "$15" "$16}' | sort | uniq -c | sort -nr | head -15
    echo
    
    
    enter='Please enter your choice: '
    options=("Option 1 - FILTER TIMEOUTS" "Option 2 - FILTER NOTFOUND" "Option 3 - CLEAR OSCAMLOG" "Option 4 - CLEAR OSCAM_LOGS FOLDER" "Quit")
    select opt in "${options[@]}"
    do
        case $opt in
            "Option 1 - FILTER TIMEOUTS")
                rm -R /var/oscam_logs/oscam_log_timeout_$TODAY
                echo "FILTER TIMEOUTS"
                cat $FILE | grep timeout | grep by >> /var/oscam_logs/oscam_log_timeout_$TODAY
                echo "file is generated on /var/oscam_logs/oscam_log_timeout_$TODAY"
            echo "select a another option"
                ;;
             "Option 2 - FILTER NOTFOUND")
                rm -R /var/oscam_logs/oscam_log_notfound_$TODAY
                echo "FILTER NOT FOUND"
                cat $FILE | grep not | grep by >> /var/oscam_logs/oscam_log_notfound_$TODAY
                echo "file is generated on /var/oscam_logs/oscam_log_notfound_$TODAY"
                echo "select a another option"
             ;;
        "Option 3 - CLEAR OSCAMLOG")
                echo "CLEARING OSCAM LOG"
                cat /dev/null > $oscamlog    
             ;;
                "Option 4 - CLEAR OSCAM_LOGS FOLDER")
                echo "CLEARING OSCAM LOG"
                rm -f /var/oscam_logs/*
                ;;
                  "Quit")        
                break
                ;;
            *) echo invalid option;;
        esac
    done
    
    
    # END OF SCRIPT
    # THIS SCRIPT MADE BY MONSTER -> SANDERWAR@HOTMAIL.COM




    Enjoy with this script! :D

  2. #2

    Re: LogAnalyzer - Oscam filter timeouts and not found

    LogAnalyzer v1.1 is released.
    PHP Code:
    #!/bin/bash
    # THIS SCRIPT MADE BY JOTNE & MONSTER -> SANDERWAR@HOTMAIL.COM
     
    # v 1.1
    # added -f to rm to prevent error of file does not exist
    # cleand command to use awk and less grep
    # change path to /tmp/
    # change cat to CP to copy files
    # using array and loop to remove users
     
    TODAY=$(date +"%m-%d-%Y")
    FILE="/tmp/oscam_log_$TODAY"
    echo "REMOVING OSCAMLOG OF TODAY IF EXIST"
    rm -f $FILE
     
    # LOCATE YOUR OSCAM LOG
    oscamlog="/var/log/oscam.log" #oscam logfile location
     
    echo "COPYING OSCAMLOG TO ANOTHER LOCATION"
    cp $oscamlog /tmp/oscam_log_$TODAY   #LOCATION OF OSCAMLOG IS /tmp/oscam.log
     
     
    #FILL HERE THE NAMES OF THE PEERS YOU DONT WANT TO LOG
    # add as many name as you like in the paranthese ("" user1 user2 user3 etc)
    name=("" name1 name2)
     
    #echo "Removing names"
    for UC in ${name[*]}; do
            echo 
    "Removing user:"$UC
            sed 
    -/$UC/d $FILE
    done
     
     
     
    echo  "IN THIS SECTION I USED THE SCRIPT THAT MADE BY CapNCooK"
    echo  "modifyed by Jotne"
    NOW=$(date +%Y/%m/%d)
    echo 
    "Top 10 of best readers:"
    awk '$0~n && /: found|cache/ {a[$11]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -10
    echo
    echo 
    "Top 10 users hammering on providers:"
    awk '$0~n && /: found|cache/ {split($6,s,"[(/]");a[$5" "s[2]]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -10
    echo
    echo 
    "Top 10 users by usage:"
    awk '$0~n && /: found|cache/ {a[$5]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -10
    echo
    echo 
    "Top 15 channels answered from cache:"
    awk -F"- " '$0~n && /cache/ {a[$2]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -15
     
    echo
    echo 
    "Top 15 channels that timed out:"
    awk -F"- " '$0~n && /timeout/ && /by/ {a[$2]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -15
    echo
    echo 
    "Top 15 users that experienced time-outs (on channel):"
    awk '$0~n && /timeout/ && /by/ {split($0,s,"- ");a[$5" -- "s[2]]++} END {for (i in a) print a[i],i}' n=$NOW $FILE sort -nr head -10
    echo
     
    enter='Please enter your choice: '
    options=("Option 1 - FILTER TIMEOUTS" "Option 2 - FILTER NOTFOUND" "Option 3 - CLEAR OSCAMLOG" "Option 4 - CLEAR OSCAM_LOGS FOLDER" "Quit")
    select opt in "${options[@]}"
    do
        case 
    $opt in
            
    "Option 1 - FILTER TIMEOUTS")
                
    rm -/tmp/oscam_log_timeout_$TODAY
                
    echo "FILTER TIMEOUTS"
                
    awk '/timeout/ && /by/' $FILE > /tmp/oscam_log_timeout_$TODAY
                
    echo "file is generated on /tmp/oscam_log_timeout_$TODAY"
            
    echo "select a another option"
                
    ;;
             
    "Option 2 - FILTER NOTFOUND")
                
    rm -/tmp/oscam_log_notfound_$TODAY
                
    echo "FILTER NOT FOUND"
                
    awk '/not/ && /by/' $FILE > /tmp/oscam_log_notfound_$TODAY
                
    echo "file is generated on /tmp/oscam_log_notfound_$TODAY"
                
    echo "select a another option"
             
    ;;
        
    "Option 3 - CLEAR OSCAMLOG")
                echo 
    "CLEARING OSCAM LOG"
                
    cat /dev/null $oscamlog
             
    ;;
                
    "Option 4 - CLEAR OSCAM_LOGS FOLDER")
                echo 
    "CLEARING OSCAM LOG"
                
    rm -/tmp/oscam_log*
                ;;
                  
    "Quit")
                break
                ;;
            *) echo 
    invalid option;;
        
    esac
    done
     
     
    # END OF SCRIPT
    # THIS SCRIPT MADE BY MONSTER -> SANDERWAR@HOTMAIL.COM 

Similar Threads

  1. Replies: 1
    Last Post: 05-01-2013, 02:44:55
  2. New DVBViewer Filter
    By ALFAJAY in forum DVB Software and Tools
    Replies: 0
    Last Post: 25-01-2012, 22:49:38
  3. Replies: 1
    Last Post: 20-12-2009, 15:50:40
  4. B2C2 mpeg2 Filter not found
    By sahli in forum French / Français
    Replies: 0
    Last Post: 18-10-2007, 13:39:21
  5. Error Filter not found Elecard_not_found
    By kanigban in forum French / Français
    Replies: 1
    Last Post: 28-07-2006, 06:39:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •