Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 14 Dec 2019, 18:29
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
BIT METER OS 0.7.6 (stable) & 0.8.0 (experimental)
Post new topic   Reply to topic View previous topic :: View next topic
Page 6 of 15 [223 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 13, 14, 15 Next
Author Message
davids45


Joined: 26 Nov 2006
Posts: 1237
Location: Chatswood, NSW

PostPosted: Sun 17 May 2015, 20:13    Post subject: Bitmeter for a multiPup computer?
Subject description: A 'running-total' of data from a symlinked file for every Pup?
 

G'day,

How does Bitmeter or any other similar monitor store its data. Or where?

With for example, Osmo and Seamonkey, I can set every Pup on this computer to use the same profile data, sym-linked from a common file on a boot-mounted data partition.

So I can boot any Pup any time and have access to the same data, and add to that during any session.

The Pup-default meter on the taskbar (pops up with a hover over the internet connection icon) keeps a sort-of record for that Pup during the month (where I wonder?) but it is the aggregate for the computer itself that would be more handy to know.

Does a router store this sort of information so that it could be accessed from a Pup browser? With several old desktops set up with Puppies for the visiting grandkids, and an MS-commited wife, this would be interesting data to get/monitor as the common point of our home network is the router. Particularly now smart-phones as well as visiting laptops also go through the router via wifi.

Our ISP has its opinion about our total usage, of course Shocked .

David S.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Sun 17 May 2015, 21:21    Post subject:  

Hello, David.

Now; let's see if I have this right. As I understand it, BitMeter (I can't vouch for other monitors, as I haven't tried any others...yet!), stores its data in a database called 'bitmeter.db' in /var/lib.

By using the address bar entry 'localhost:2605/index.html', you are then telling the local loopback system to listen, on port 2605, for the most recent measurement from BitMeter, as it is in fact a small 'server'. The app itself is fairly configurable; you can set the 'Summary' tab to refresh itself at any interval you like, right down to once a second if you want. I have mine set for once every 7 seconds.....the default is 10.

I haven't got a clue whether other monitors work in this fashion.....I only know that this is how BitMeter OS works. Now that the author, Rob Dawson, has posted in the thread, you may be able to get a more detailed answer from the man himself. He's indicated that he's quite willing to answer questions on the subject.


Regards,

Mike.

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2377
Location: Queensland

PostPosted: Sun 17 May 2015, 22:27    Post subject:  

mikeb wrote:
pcap...some don't have it at all ..some need a link...some have the link...a mixed bag. My thoughts were to include a copy of 0.8 as its small... make it independent of whatever system its on then.


Is there a particular pcap that's needed, the one in Vanguard is as in Carolina/wary, if that will do I can add that so it's only used if the native version doesn't exist.

Could likely have the pinstall also create new bitmeterweb and bimeter scripts to suit the versions of puppy that don't support the debian one's.

So far I'm at this as a pinstall if I add the Carolina libpcap.so.0.8 @179.1 kB, is there a smaller one ?
Code:
LIBPCAP=`find /usr -type f -name 'libpcap.so.*' | head -n 1`
if [ ! -f "$LIBPCAP" ]; then
cp libpcap.so.0.8 /usr/lib/
else
LINK_PATH=${LIBPCAP%/*}
if [ ! -f "$LINK_PATH/libpcap.so.0.8" ]; then
ln -s "$LIBPCAP" "$LINK_PATH"/libpcap.so.0.8
fi;fi
cp /var/lib/bitmeter/bitmeter.db.new /var/lib/bitmeter/bitmeter.db
/etc/init.d/bitmeterweb start
/etc/init.d/bitmeter start
exit 0


How would this be as a start, stop script ?

Code:
#!/bin/sh
# Lucid/412
DAEMON=/usr/bin/bmcapture
PROC=bmcapture

test -f $DAEMON || exit 0

doStart(){
    if ps aux | grep $PROC | grep -v grep > /dev/null
   then
   echo -e BitMeter Capture daemon is running...
   else
   echo -e Starting BitMeter Capture daemon: bmcapture
   $PROC &
   fi
}
doStop(){
    if ps aux | grep $PROC | grep -v grep > /dev/null
   then
   echo -e Stopping BitMeter Capture daemon: bmcapture
   pkill -f $PROC
   sleep 1
   fi
}
case "$1" in
  start)
    doStart
    ;;
  stop)
    doStop
    ;;
  restart)
    doStop
    doStart
    ;;
  force-reload)
    doStop
    doStart
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}" >&2
    exit 1
    ;;
esac

exit 0

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
davids45


Joined: 26 Nov 2006
Posts: 1237
Location: Chatswood, NSW

PostPosted: Mon 18 May 2015, 02:39    Post subject: Bitmeter for multiPup desktop
Subject description: Symlink db files to common file on data partition
 

G'day Mike Walsh,

Thanks for the quick answer.

If Bitmeter keeps its data as a .db file in /var/lib, then can I set this file as a sym-link for each Pup's Bitmeter to the same 'real' bitmeter.db file on my computer's data partition? Whichever Pup I am using will then use this one-and-only common bitmeter.db file, so for this computer, I will have a single record of its internet usage.

I could do the same for the grandkids' old HP desktops here too, as they do like to play on-line ABC4Kids games for their age-group (1-4 years old) when not watching Peppa or Thomas or Roary or Sam or Bob or ... etc Rolling Eyes

David S.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Mon 18 May 2015, 04:09    Post subject: Re: Bitmeter for multiPup desktop
Subject description: Symlink db files to common file on data partition
 

davids45 wrote:
...If Bitmeter keeps its data as a .db file in /var/lib, then can I set this file as a sym-link for each Pup's Bitmeter to the same 'real' bitmeter.db file on my computer's data partition? Whichever Pup I am using will then use this one-and-only common bitmeter.db file, so for this computer, I will have a single record of its internet usage...


Hmm. I don't know, to tell the truth. As I've stated in the thread, I'm pretty new to all this, compared to some other folk on the forums.....only been here for about 10 months, I think..?

I only discovered the use of 'sym-links' myself less than a month ago! If you mean would it work for multiple 'Pups' on the same hard drive, well..... Actually, I can't think of any reason why that shouldn't work; as long as they were all running the same version of BitMeter (0.7.6 or 0.8.0; I don't know if it would make a difference if you had, say, a mixture of 32- & 64-bit 'Pups'...)

I don't think it would work across a network for multiple machines, though.....I have no idea if symlinks can be set across a network (I'm more than willing to learn, though!) That's where Rob Dawson's 'bmsync' utility normally comes in; you can read more about that here:-

http://codebox.org.uk/pages/bitmeteros/bmsync/man

As I understand it, though, 'bmsync' has to be run manually (say like once or twice a day, simply to total data readouts across a network); I don't think it can be set to 'autorun'...

Something to think about, there... Thanks for that, David. I've been wondering if there was another way to 'sync' data in that manner; I've never been able to use 'bmsync' between OS's on the same machine, because it isn't designed to work like that. It's intended for use between two physical machines, running simultaneously.....you could have 20 Pups on one machine, but you can only physically run one of them at a time...

Try it, is all I can say. What's the worst that can happen?


Regards,

Mike. Very Happy

_________________
MY 'PUPPY' PACKAGES


Last edited by Mike Walsh on Mon 18 May 2015, 04:26; edited 1 time in total
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Mon 18 May 2015, 04:19    Post subject:  

@Geoffrey:-

A question for you. If you look at the last couple of posts, between me and davids45; would that idea work? Or would you get multiple instances of the same data?

What part of the app is it that actually writes to the database in /var/lib? Would that need to be what was 'sym-linked'.....or have I got hold of the wrong end of the stick here?

My 'noob-ness' is showing, ain't it? Laughing


Mike.

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2377
Location: Queensland

PostPosted: Mon 18 May 2015, 04:56    Post subject:  

Mike Walsh wrote:
@Geoffrey:-

A question for you. If you look at the last couple of posts, between me and davids45; would that idea work? Or would you get multiple instances of the same data?

What part of the app is it that actually writes to the database in /var/lib? Would that need to be what was 'sym-linked'.....or have I got hold of the wrong end of the stick here?

My 'noob-ness' is showing, ain't it? Laughing


Mike.


Sharing the database from outside the save file should work for multiple pups on the same machine using a symlink , the database file for the 32 and 64 bit versions appear to be the same, so sounds like a plan Wink

We're all noob's with varying degrees of experience and constantly learning Smile

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Mon 18 May 2015, 05:13    Post subject:  

@Geoffrey:-

Quote:
We're all noob's with varying degrees of experience and constantly learning Smile


That's for sure.....

Okay; enough with the jollity, already..! Laughing To expand upon this, I would like to know something else here, if I may?

If you go into /var/lib, then click on the 'bitmeter' directory, there's 3 items, yes? I know what the 'runweb.sh' does, but there's two database entries; 'bitmeter.db', and 'bitmeter.db.new'. What's the difference between these; does BitMeter use the value from the latter, add it to the former, and then overwrite.....or something? In other words, is one temporary storage, until the total is calculated and written to the 'permanent' database?

This is, of course, assuming that you can 'see' the structure of the app in the coding, and are able to figure out quite how it runs...

I'm just curious as to which of those '.db' files should be used as the symlink for obtaining an overall total between multiple Puppies...and I suspect davids45 would like to know, too!


Mike. Confused

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Mon 18 May 2015, 07:10    Post subject:  

@Geoffrey, davids45:-

Now, then; seems we have an answer as to whether symlinking to a common database will work...

It won't.

I initially set up a small data partition. In Tahrpup, I then dragged /var/lib/bitmeter/bitmeter.db across to it, and 'Moved'. I then dragged it back again, and this time 'Link(Absolute)' to create the link. By itself, this works fine.

In Slacko, I then repeated things; only this time, I deleted /var/lib/bitmeter/bitmeter.db from Slacko's install, and symlinked Tahrpup's bitmeter.db (from the new partition) back to it.

Did the same thing again in OBPrecise 14.07.26 'ChromeBook' Pup.

I then went back to Tahrpup, to see what the result was. And.....a big, fat zero. BitMeterOS had quit working. 'This page is not available...'

It was the same story in Slacko & ChromePup. BitMeterOS was non-operational. For now, I've uninstalled, and re-installed, so everything is currently back to stand-alone separate databases, as it was originally.

Mind you, I'm willing to bet that this is mostly due to my lack of experience with the way scripts work.....and not really knowing quite what I'm doing. I'm more than willing to be tutored, here..!

Perhaps the common 'bitmeter.db' needs creating from scratch, rather than copying, and then symlinking one of the originals? I honestly don't know. Or could it be that where I've gone wrong is in not stopping BitMeter before setting up the symlink? I know your script auto starts BitMeter at boot time, so.....how do I temporarily stop it, and then re-start it?

Thoughts? Comments?


Mike. Sad

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11284

PostPosted: Mon 18 May 2015, 08:27    Post subject:  

database..its an sqlite database so those rules apply... how it would behave for multiple simultaneaous accesses...hmm could be interesting .
Otherwise a symlink makes sense for sharing...assuming all using the same version of bitmeter AND the structure of the data is not custom per machine... though its totals that are of interest for a group of machines...might mean 0.7.8 handles it better...just my view of the subject. By the way no usage logging in my netgear...you would need bitmeter adding to it Smile

Geoffry.
Yes that start stop script seems suitable...and should work for any pup...I did a simpler version for testing thats all. bitmeter binaries do not self daemonise so have to be handled as such.

I have a libpcap from debian etch that worked..158k...and that is really 0.9.5 not 8..I just renamed it...seems like an old lib which also means anything calling it specifically would be fine. I wonder how small a true 0.8 version is Smile

wow busy thread... and no spell checker Very Happy

mike
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Mon 18 May 2015, 11:05    Post subject:  

Hope no one get upset by this entry, but, @Davids45 is really a VERY GOOD question for the many/most of us who have a LAN with TVs, PCs, etc.

His question points to a central point of collection. This is important as internet enters the home network via some central point. And at that central point is where accountability should exist.

Thanks @Davids45 for presenting that.

Now that this is presented to us, it steers us to look at some mechanism that can be employed such that monitoring traffic in/out of the home network can be accurately measured and available to all.

@Gyro has presented a very workable solution available to ALL in the forum community without the need to ask for permission. Its uses simple off the shelf items and it appears, though it is based at 32bit, that it is no great leap should anyone want to use on any platform. His solution is a PUPPY distro based router for a home network. Thus, this solution running in that frame would accomplish the best as any local PC could simple access its web port for display or taskbar popup data display.

This or similar approach would mean a single LAN monitor with every PC having access to review data traffic accurate for the home network relating to its internet traffic.

One last item to note. If a central approach like @Gyro's is used, the neat thing is that it could morph to any known solutions for getting internet to the home:
  • @Gyro's project via modems (cable/dsl/fiber) from ISP
  • @Gyro's project via modems (2G/3G/4G) from telcos
  • @Gyro's project via router front ending the home network
  • @Gyro's project via phone tethering
  • @Gyro's project via satellite
  • etc.
Thus @Gyro's project offers great flexibility in setup and use with any of these individually or in combinations.

Hope this clarifies a view that I perceive from his question. This does NOT change what is already done. Again, "To address this thread's efforts, centrally, in no way changes this thread's work." It merely moves the collection point to Gyro's router project's ability, while also making this thread's information available to all on the LAN without each LAN device being a collection point, individually.

This can be done on something a simple as an old motherboard, alone (little or no peripherals), as long as it has the limited RAM needed to run the router-bitmeter-browser to expose the port. Several ways to boot something this simple. Almost a nocost/lowcost solution for control beyond the Telcos and ISP ramp devices. And, there are many similar hardware for a PUP setup which can be useful from ... to ...

Hope this helps

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile

Last edited by gcmartin on Mon 18 May 2015, 19:15; edited 5 times in total
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5667
Location: King's Lynn, UK.

PostPosted: Mon 18 May 2015, 12:56    Post subject:  

Hi, gcm.

Hmm. Thinking about it, I guess you're right; this could very well lead to other developments. Admittedly, that wasn't uppermost in mind when I started the thread (!), but as with so many other things over the years, one thing will of course lead to another...

Of course, it all depends on how much interest is generated, and how many other folk see this potential.....and are willing to put in development time. There's the rub.

Certainly, a central data recording point (at the router) would make a whole heap of sense, where multiple machines on a single network are concerned...

Keep your fingers crossed; no telling what might happen!


Regards,

Mike.

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
robd

Joined: 17 May 2015
Posts: 4

PostPosted: Mon 18 May 2015, 15:00    Post subject:  

Mike Walsh wrote:
@robd:-

In fact, I DO have one question, now that I think about it. I moved to Linux about a year ago, as I said in my message to you. Nearly from the start, I looked for something similar to, and then discovered, BitMeterOS; I think the stable version then was 0,7.5, and 0.7.6 was the experimental version. When 0.8.0 was released, I moved to 0.7.6.

With 0.8.0, the web interface now shows the difference between total usage (up & down), and internet usage. It didn't take me long to find out that file-sharing via LAN was a lot more prevalent in the Linux world than it was in the Windows one. I've since come to realise that in fact, networking and 'file-sharing' is becoming quite standard these days, with the advent of media-streaming, and home-based media server setups.

Was this in your mind when you developed the 0.8.0 version?


Regards,

Mike.


Hi Mike,

Being able to differentiate between LAN and Internet traffic was by far the most requested feature from people using BitMeter OS and BitMeter 2 (my previous Windows-only meter) but unfortunately wasn't easy to implement - it meant using the pcap library to gather network stats rather than the much simpler method used in 0.7.6. The big advantage of using pcap however is that it lets you add filters for pretty much any type of internet traffic, the 4 default filters are the ones most people stick with but using the 'bmdb addfilter' command you can add others using tcpdump syntax

hope that helps

Rob D
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11284

PostPosted: Mon 18 May 2015, 15:05    Post subject:  

if the pcap fits...use it Very Happy

sorry
Back to top
View user's profile Send private message 
robd

Joined: 17 May 2015
Posts: 4

PostPosted: Mon 18 May 2015, 15:21    Post subject:  

Mike Walsh wrote:


If you go into /var/lib, then click on the 'bitmeter' directory, there's 3 items, yes? I know what the 'runweb.sh' does, but there's two database entries; 'bitmeter.db', and 'bitmeter.db.new'. What's the difference between these; does BitMeter use the value from the latter, add it to the former, and then overwrite.....or something? In other words, is one temporary storage, until the total is calculated and written to the 'permanent' database?

Mike. Confused


The bitmeter.db.new file isn't needed by BitMeter, it's just an empty database file which is included in the installer (if you still have one hanging around you can delete it).

If someone is installing BitMeter for the first time on their system then this file gets renamed to bitmeter.db and gets used by the application, however if someone is upgrading from an older version of BitMeter then obviously the installer shouldn't replace the existing bitmeter.db file containing all their data, so in this case the bitmeter.db.new file gets removed and the existing .db file is upgraded keeping all the data intact.

If you speak shell-script then you can see this going on here
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 6 of 15 [223 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 13, 14, 15 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1946s ][ Queries: 12 (0.0153s) ][ GZIP on ]