Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Kaspars_Zibarts
Employee Employee
Employee

Log rate calculator for MDS / MLM

There are two great SKs out there, so this is just re-inventing the wheel

sk120341 - How to monitor the Log Receive Rate on Management Server

sk88681 - How to calculate/count the total amount of FireWall Logs per second that arrive to Security Management Server

I simply bastardised the script from the second article to make it faster (it runs parallel instead of sequential through all CMAs) and output is more easy to read. But all the credits go to CP!

 

log rate calculator

 

Here's your script, a you can see you can supply time that you want to run it for, by default 5secs

 

#!/bin/sh
# Print log rate data on all Domains

# execute the script that defines Check Point environment variables
source /opt/CPshared/5.0/tmp/.CPprofile.sh
total=0

if [ "x$1" = "x" ]; then
   SLEEP_TIME=5
else
   SLEEP_TIME=$1
fi

echo
echo "Log rate per second, measuring for ${SLEEP_TIME}s"
echo "----------------------------------"
ls -l /var/log/mds_logs/*/log/fw.logptr > BEFORE
sleep $SLEEP_TIME
ls -l /var/log/mds_logs/*/log/fw.logptr > AFTER

for DOMAIN in $(ls -1 $MDSDIR/customers)
do
   SIZE_BEFORE=$(cat BEFORE | grep "/$DOMAIN/" | awk '{print $5}')
   SIZE_AFTER=$(cat AFTER | grep "/$DOMAIN/" | awk '{print $5}')
   rate=`echo "scale=0 ; ($SIZE_AFTER - $SIZE_BEFORE) / ( 4 * $SLEEP_TIME )" | bc`
   let total=total+rate
   echo -e -n "${DOMAIN}:\t"
   if [ ${#DOMAIN} -le 15 ]; then echo -e -n "\t"; fi
   echo "$rate"
done

echo "----------------------------------"
echo -e "Total rate:\t\t$total"
echo

5 Replies
This widget could not be displayed.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events