Forum Discussion

almudena_3796's avatar
almudena_3796
Icon for Nimbostratus rankNimbostratus
Jan 09, 2014

LTM VE 10.2.3: number of requests per day

Hi all, I need to know the number of total requests per day that the BIG-IP LTM VE 10.2.3 appliance receives. Can anyone tell me how I can know it, please? Thx a lot.

 

  • uni's avatar
    uni
    Icon for Altostratus rankAltostratus

    Quick and dirty method, run this each day from bash:

    tmsh show ltm virtual raw|grep 'Total Req'|cut -d- -f3|awk '{s+=$1}END{print s}'

    followed by

    reset-stats ltm virtual
    if you can't be bothered doing a subtraction each day.

  • Thx a lot. What I made was to create the following script named total_requests:

     

    /bin/date +%d/%m/%y_%H:%M >> /var/local/scripts/total_requests.out /usr/bin/tmsh show ltm virtual raw|grep 'Total Req'|cut -d- -f3|awk '{s+=$1}END{print s}' >> /var/local/scripts/total_requests.out

     

    When I run it, it works: [root@F5:Active] scripts /bin/bash /var/local/scripts/total_requests [root@F5:Active] scripts cat total_requests.out 13/01/14_11:42 99

     

    BUT when I let crontab run it, it does not work: [root@F5:Active] scripts crontab -l

     

    cron tab for root

    00,15,30,45 * * * * /bin/bash /var/local/scripts/total_requests

     

    [root@F5:Active] scripts cat total_requests.out 13/01/14_11:45 <-it does not appear the value

     

    Is there any bug with crontab?

     

    • uni's avatar
      uni
      Icon for Altostratus rankAltostratus
      Debugging cron issues is very low on my list of fun things to do. Try capturing stderr for your tmsh command.
  • Crontab is working with the following script:

     

    !/bin/bash

    /bin/date +%d/%m/%y >> /var/local/scripts/total_requests.out /usr/bin/tmsh show ltm virtual raw|grep "Total Req" >> /var/local/scripts/tr.out awk '{s+=$5}END{print s}' /var/local/scripts/tr.out >> /var/local/scripts/total_requests.out tmsh reset-stats ltm virtual