LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2014, 02:03 AM   #1
surfninja
LQ Newbie
 
Registered: Jan 2014
Posts: 1

Rep: Reputation: Disabled
DD-WRT Data Usage/Tracking Software...Pausing Data Record During Free Time


-Hello all, Im extremely new to Linux and Im trying to setup a network of about 8 users on a Satellite internet system that has limited monthly bandwidth.
-I have DD-WRT on my routers and using "Yet Another Monitor" software to track each Mac Address data usage.
-It works great, however I would like it to stop/pause recording user data during the free hours of 3:30AM to 8:30AM.
-In CronJobs of DD-WRT I was able to call the shutdown script at 3:30 and startup script at 830 but it seems it was still keeping track of users downloads during that time. The graph looks like it stopped during those hours but when it starts again at 8:30, there is a massive amount of bandwidth used.
-Im thinking it records it and waits til 830 to present it.
-Here is the piece of the code that I think i need to pause or turn off for that time period.
-Thanks for reading and any feedback is very welcome.
# ==========================================================
# Main program
# ==========================================================
_lockDir=/tmp/ACMON-lock
if [ ! -d "$_lockDir" ] ; then
mkdir "$_lockDir"
echo '
---------------------------------------
Starting the Yet Another Monitor script
=======================================
'
else
echo "*** Another instance of this script is already running!!!"
echo "*** You must either run 'rm /tmp/ac_mon.lock' or run 'yamon.shutdown' to launch this script again"
exit 0
fi
started=false
#set _configFile to the first parameter passed to the script
_configFile=$1
setDefaults
readConfig
started=true

_iteration=0
# main loop... to break the loop either edit config.file or delete _lockDir (/tmp/ac_mon.lock)
while [ "$_monitoring" = "1" ] && [ -d $_lockDir ]; do
_iteration=$(($_iteration%($_updateInterval*$_publishInterval) + 1))
if [ "$_paused" = "0" ] ; then
updateUsers
setupIPRules
sleep "$_updatefreq"
#Check for a publish
if [ $(($_iteration%$_updateInterval)) -eq 0 ]; then
updateUsage
fi
#Check for a publish
if [ $(($_iteration%$_publishInterval)) -eq 0 ]; then
publishData
fi
fi
#Check to see whether config.file has changed
readConfig
#Check to see whether the date has changed
_cDay=`date +%d`
if [ "$_doDailyBU" = "1" ] && [ "$_cDay" != "$_pDay" ] ; then
dailyBU
fi
_pDay="$_cDay"
# Commented out because not the ps call is not well supported across all firmware builds
# ni=`ps cax | grep -c yamon`
# " >>> Number of YAMon instances: $ni." 0
# if [ $ni -gt 2 ]; then
# send2log " !!! Incorrect number of YAMon instances???: $ni." 2
# fi

#one last backup before shutting down
if [ "$_monitoring" = "0" ] || [ ! -d $_lockDir ]; then
[ -d $_lockDir ] && rmdir $_lockDir
send2log "
=====================================
Stopped AC Monitor script
-------------------------------------
" 2
sleep 10
fi
done &
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tracking real-time health with Twitter data serves as an early warning system LXer Syndicated Linux News 0 05-01-2013 07:43 PM
[SOLVED] free freeing data twice or data that shoulnd't be freed errigour Programming 28 10-04-2012 08:11 PM
LXer: 7 Best Free Linux Time Tracking Software LXer Syndicated Linux News 1 02-15-2012 08:20 PM
free data recovery software nnjond Linux - Software 20 05-25-2008 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration