IPMonitor-0.04

Configuration wizards, scanners, remote desktop, etc.
Message
Author
DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

IPMonitor-0.04

#1 Post by DPUP5520 »

Simple Java application for monitoring your public IP Address, Obviously needs Java installed to use.
Last edited by DPUP5520 on Wed 15 Jun 2011, 18:14, edited 1 time in total.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

More efficient method

#2 Post 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.

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#3 Post by DPUP5520 »

Awsome, thanks vovchik for the advice.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post 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.)

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#5 Post by DPUP5520 »

@Flash
Yes
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

Thank you. I'll see if I can get him to cooperate in an experiment. :)

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Re: More efficient method

#7 Post 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

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

ip number to clipboard

#8 Post 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 "

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#9 Post 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
Last edited by Geoffrey on Sun 12 Jun 2011, 07:56, edited 2 times in total.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

xclip

#10 Post 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
Attachments
xclip.gz
(6.58 KiB) Downloaded 709 times

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#11 Post 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

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#12 Post by Dougal »

Why not just wget echoip?
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

gcmartin

Trying to use IPMonitor-004

#13 Post 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
Attachments
Where is the LOG.png
Where are the LOGs kept?
(7.13 KiB) Downloaded 1440 times
Should I hear sound on Public IP changes.png
I am not getting any desktop notificaton sounds
(9.26 KiB) Downloaded 1326 times

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#14 Post 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
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

gcmartin

Logs

#15 Post 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

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#16 Post 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.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#17 Post 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
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

gcmartin

#18 Post 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.

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#19 Post 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.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

gcmartin

#20 Post 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.

Post Reply