Page 1 of 2

IPMonitor-0.04

Posted: Mon 06 Jun 2011, 22:53
by DPUP5520
Simple Java application for monitoring your public IP Address, Obviously needs Java installed to use.

More efficient method

Posted: Tue 07 Jun 2011, 14:16
by vovchik
Dear DPUP5520,

I think this can be done with much less overhead (80MB for java and 854k for IPMonitor), e.g.:

Code: Select all

#!/bin/sh
my_ipno=$(wget http://cmyip.com -qO - | grep -Ewo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | uniq)
gtkdialog-splash -timeout 6 -fontsize large -fg red -icon "gtk-network" -text "External IP: $my_ipno "
That's 205 bytes:)

With kind regards,
vovchik

PS. gtrayicon could be used to post and renew info in they tray for more a bit more elegance and minimal effort.

Posted: Tue 07 Jun 2011, 14:27
by DPUP5520
Awsome, thanks vovchik for the advice.

Posted: Wed 08 Jun 2011, 04:37
by Flash
Vovchik's script is easy enough to use. I only had to paste it into a console window and then hit Enter. :)

My computer is behind a Motorola SURFboard cable modem gateway. I assume a gateway is essentially the same thing as a router. Is the IP address I get from vovchik's script the one to use with Psip? (To email to my brother so he can enter it into Psip at his end.)

Posted: Wed 08 Jun 2011, 13:44
by DPUP5520
@Flash
Yes

Posted: Wed 08 Jun 2011, 14:14
by Flash
Thank you. I'll see if I can get him to cooperate in an experiment. :)

Re: More efficient method

Posted: Sun 12 Jun 2011, 03:38
by Geoffrey
vovchik wrote:Dear DPUP5520,

I think this can be done with much less overhead (80MB for java and 854k for IPMonitor), e.g.:

Code: Select all

#!/bin/sh
my_ipno=$(wget http://cmyip.com -qO - | grep -Ewo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | uniq)
gtkdialog-splash -timeout 6 -fontsize large -fg red -icon "gtk-network" -text "External IP: $my_ipno "
That's 205 bytes:)

With kind regards,
vovchik

PS. gtrayicon could be used to post and renew info in they tray for more a bit more elegance and minimal effort.
vovchik,

I like this script so simple, so I added a extra feature to it, seeing puppy has xclip, well my quirky 120 does anyway, I can add the ip-address to a clipboard and paste it with the middle mouse button.

Code: Select all

#!/bin/sh
my_ipno=$(wget http://cmyip.com -qO - | grep -Ewo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | uniq)
echo "$my_ipno" > my_ipno.tmp ; cat my_ipno.tmp | xclip
gtkdialog-splash -timeout 6 -fontsize large -fg red -icon "gtk-network" -text "External IP: $my_ipno " 
Geoffrey :D

ip number to clipboard

Posted: Sun 12 Jun 2011, 06:09
by vovchik
Dear Geoffrey,

That is a very nice and useful touch (clipboard) :) You could avoid the use of a temp file by changing your copy line to this:

Code: Select all

echo "$my_ipno" | xclip -selection clipboard
With kind regards,
vovchik

PS. The entire prog then looks like this:

Code: Select all

#!/bin/sh
my_ipno=$(wget http://cmyip.com -qO - | grep -Ewo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | uniq)
echo "$my_ipno" | xclip -selection clipboard
gtkdialog-splash -timeout 6 -fontsize large -fg red -icon "gtk-network" -text "External IP: $my_ipno "

Posted: Sun 12 Jun 2011, 07:04
by Geoffrey
vovchik

I just tried the script with your change, it doesn't seem to work for me, when I paste, it pastes what ever was in the clipboard previously.

I have tried that command before that's how I came about using " echo "$my_ipno" > my_ipno.tmp ; cat my_ipno.tmp | xclip "

as that was the only way I could get it to work by creating a tmp file.

Geoffrey

xclip

Posted: Sun 12 Jun 2011, 07:53
by vovchik
Dear Geoffrey,

I have attached my xclip (perhaps it's different from yours). I am also running glipper and autocutsel (that weird old x11 utility that produces a small white square at the right/bottom of your monitor). Could that be the difference?

With kind regards,
vovchik

Posted: Sun 12 Jun 2011, 07:56
by Geoffrey
just had a look around to find the problem this seems to fix it.

Code: Select all

echo "$my_ipno" | xclip -selection XA_SECONDARY
Edit: tried your xclip seem to be the same file size wise anyway, still didn't work with "echo "$my_ipno" | xclip -selection clipboard"

so now the script looks like this and works ok.

Code: Select all

#!/bin/sh
my_ipno=$(wget http://cmyip.com -qO - | grep -Ewo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | uniq)
echo "$my_ipno" | xclip -selection XA_SECONDARY 
gtkdialog-splash -timeout 6 -fontsize large -fg red -icon "gtk-network" -text "External IP: $my_ipno"
I got the info from here http://www.cyberciti.biz/faq/xclip-linu ... clipboard/

Code: Select all

"echo $my_ipno" | xclip -selection XA_CLIPBOARD"
this also works.

Edit: ok tried your original script with echo "$my_ipno" | xclip -selection clipboard
it does work but only if pasting into the terminal with the right click menu "paste" , I should have told you that I'm using Quirky 120 NOP with thunar, no rox



Geoffrey

Posted: Sun 12 Jun 2011, 14:31
by Dougal
Why not just wget echoip?

Trying to use IPMonitor-004

Posted: Wed 15 Jun 2011, 14:10
by gcmartin
I have 2 issues that I could use some guidance on.
  • Where is the Log?
  • And my IP changes are not signaling desktop.
Thanks in advance

Posted: Wed 15 Jun 2011, 16:55
by DPUP5520
gcmartin I'm not really sure about the sounds problem but I will send off an email to the developer to ask him, as for the log files you can find them at /root/usr/share/IPMonitor/logs/ ; also do not try to set it up as a daemon it will not work

Logs

Posted: Wed 15 Jun 2011, 17:02
by gcmartin
Been running on the desktop for several days. I just stopped it and got the following:

Code: Select all

ls -l /root/usr/share/IPMonitor/logs/
ls: cannot access /root/usr/share/IPMonitor/logs/: No such file or directory
Maybe I missed something along the way for proper setup or I hit a bug.

Edited: Running ICEPUP: Found them here

Code: Select all

ls -l /root/logs
total 8
-rw-r--r-- 1 root root 165 2011-06-14 23:41 2011-06-14.log
-rw-r--r-- 1 root root 179 2011-06-15 12:21 2011-06-15.log
You may want to add a note to the IPMonitor announcement Post about this feature of IPMonitor

This is a very nice and handy tool. I am now getting a picture of my ISP's pattern. The log and the alert is what make this so useful and powerful.

Hope this helps

Posted: Wed 15 Jun 2011, 17:31
by DPUP5520
weird, I'll take a look at it through the next day or two cause I don't normally use it myself so i'll check and see whats going on

edit: it should have been /usr/share/IPMonitor/logs/ I put /root in there by accident.

edit 2: Yea I just noticed that it is creating a log file under /root/logs even though there is a log folder which its supposed to write the log to inside the IPMonitor folder but whatever I suppose it makes it easier being right inside the root folder. As for the sound notification I set it up and tested it on my computer and it worked just fine when I hit "test", and I also tested the popup notification which worked just fine.

Posted: Wed 15 Jun 2011, 18:15
by DPUP5520
Added a new pet for IPMonitor in top post , it's a little bit smaller but will only work on 32bit systems as opposed to the original which will work on 32bit and 64 bit pups. Also got rid of log folder in /usr/share/IPMonitor since it creates its logs in /root/logs

Posted: Wed 15 Jun 2011, 19:17
by gcmartin
DPUP5520 wrote: ... As for the sound notification I set it up and tested it on my computer and it worked just fine when I hit "test", and ... .
I had the same successful test. But, when the IP changes, I am NOT getting the audio sound alert that the IP has changed.

Edited: Wait, this "MAY" be a system related problem. Seems that when I start+stop a PMusic app, the IPMonitor test no longer work.

Just a note,even though its not a show-stopper. Maybe the developers know something as well.

I'll try the 32bit version to see if I get rhe same behavior. personally, I prefer the universal Java version so that I don't have to think about it. The cost is not major at all for me. But, others may benefit from the savings on download. The RAM footprint is not distinguishable. That's where it is important...not the download, for me.

thanks again for all of your guidance and help.

hope this helps.

Posted: Wed 15 Jun 2011, 22:42
by DPUP5520
The only reason I made the 32bit version was because I realized in the original pet I forgot to delete the Windows dll files (which were an extra 200kb almost) so I figured I might as well take out the 64bit wrapper and lib too since most users use 32bit puppies.

Posted: Wed 15 Jun 2011, 23:00
by gcmartin
Thanks DPUP5520. That helps my understanding.

3 questions:
Here's current finding: If I manually cause the router to re-acquire a new Public IP address, that new IP is not recorded immediately by the IPMonitor. It does, though, pick it up some/many minutes later. Is there a published time interval that it uses?

How do I get IPMonitor to "remember" the options changes on its restart to the desktop? I do an "Apply" after changing the Options, but, if I should Exit the IPMonitor at some time in the future, all Options changes are lost.

I tried the 32bit version to see if I get rhe same behavior and I did.

Thanks again for all of your guidance and help.

hope this helps.