Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

netnothing

macrumors 68040
Mar 13, 2007
3,820
422
NH
Has something changed recently with the latest update to Mountain Lion? the Network section of the Nano has the external IP of unknown. It was working fine with 10.8.2 itself.

I'm on the latest update 10.8.2 Supplemental Update and it's showing my external IP fine.

-Kevin
 

theanimaster

macrumors 6502
Oct 7, 2005
322
15
My network thing says "Updating..." and it's stuck on that.

Other than that... everything else works fine. I don't use it for checking my network anyways (I use Little Snitch 3 for that).
 

netnothing

macrumors 68040
Mar 13, 2007
3,820
422
NH
Well, not sure why it was working the other day but mine now is either Updating or Unknown.

I think as time goes by iStat Pro will probably slowly stop working.

-Kevin
 

urbncwby

macrumors newbie
Oct 14, 2012
8
3
Actually as of today iStat is completely gone. islayer.com where people could download it is down, never to return again. @bjango at twitter confirms it. :( Just reinstalled ML from scratch and hate having no iStat anymore.
 

zepman

macrumors regular
Jul 1, 2010
196
16
Sweden
Actually as of today iStat is completely gone. islayer.com where people could download it is down, never to return again. @bjango at twitter confirms it. :( Just reinstalled ML from scratch and hate having no iStat anymore.

If you want it, I attached the complete widget with the fixes a couple of posts up.
 

3460169

Cancelled
Feb 18, 2009
1,293
212
My network thing says "Updating..." and it's stuck on that.

Other than that... everything else works fine. I don't use it for checking my network anyways (I use Little Snitch 3 for that).

Well, not sure why it was working the other day but mine now is either Updating or Unknown.

I think as time goes by iStat Pro will probably slowly stop working.

-Kevin

Actually as of today iStat is completely gone. islayer.com where people could download it is down, never to return again. @bjango at twitter confirms it. :( Just reinstalled ML from scratch and hate having no iStat anymore.


Yeah, the IP address detection stopped because the islayer.com web sites went the way of the dodo bird -- and because the iStat Pro widget, by default, uses a URL within that domain for IP address detection. The solution is to use another web site that can display your external IP address when it's accessed. There's a number of such website that can do this for you (whatismyip.com is one I've used often; even google will tell you when you ask for it)

It's important to note that iStat wants to hit a URL that will return the IP address of the client (you) in plain text, with no HTTP cruft. The code for this stuff lives within the iStat Pro.wdgt package, in scripts/core.js, in the function getExtIP() (roughly line 243 in the file). This function is as follows:

Code:
function getExtIP(){
        ipURL = 'http://whatsmyip.islayer.com/?random='+new Date().getTime();
        ipConnection = new XMLHttpRequest();
        ipConnection.open("GET",ipURL,true);
        ipConnection.onreadystatechange = function() {
                if(ipConnection.readyState == 4 && ipConnection.responseText != null && ipConnection.responseText.length > 0) {
                        extIP = ipConnection.responseText;
                        if(extIP.length < 20 && ipConnection.status == 200 && extIP.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
                                e("wide_extip").innerHTML = extIP;
                                e("tall_extip").innerHTML = extIP;
                                valid_ip = true;
                        } else {
                                valid_ip = false;
                                e("wide_extip").innerHTML = "Unknown";
                                e("tall_extip").innerHTML = "Unknown";
                        }   
                }   
        }   
        ipConnection.send(null);
}

I posted the whole thing for the sake of context and completeness, but the important bit here is the second line: the variable ipURL. Since whatsmyip.islayer.com no longer exists, we need a new URL to use. It also needs to be a URL that returns the client's IP address in plain text (this part is implied by code later in the function, specifically, that the IP length be less than 20 chars. Including dots, even if each octet in an IP is 3 digits, that gives a max of 15.)

If you have access to a web server on the public Internet with PHP or similar on it, you can whip up a small utility that, when accessed by an HTTP client, will simply return the client's IP address (in Apache web servers, I think you could use the value of the REMOTE_ADDR environment variable) For those of us that don't have this luxury -- well, ask google.

I asked google for a website to return my IP address in plain text. I'm not going to recommend any of the results of that google, because automated IP lookups may or may not fall within their acceptable use policies, etc. (In fact, here's such a policy at WhatIsMyIp.com) Once you find a URL that, when accessed, returns your public IP in plain text -- simply use that as the new value for ipURL on line 244 (or thereabout) in scripts/core.js. But please respect the usage policies of whatever site you use, as applicable.

Good luck ;)
 

netnothing

macrumors 68040
Mar 13, 2007
3,820
422
NH
Yeah, the IP address detection stopped because the islayer.com web sites went the way of the dodo bird -- and because the iStat Pro widget, by default, uses a URL within that domain for IP address detection. The solution is to use another web site that can display your external IP address when it's accessed. There's a number of such website that can do this for you (whatismyip.com is one I've used often; even google will tell you when you ask for it)

It's important to note that iStat wants to hit a URL that will return the IP address of the client (you) in plain text, with no HTTP cruft. The code for this stuff lives within the iStat Pro.wdgt package, in scripts/core.js, in the function getExtIP() (roughly line 243 in the file). This function is as follows:

I posted the whole thing for the sake of context and completeness, but the important bit here is the second line: the variable ipURL. Since whatsmyip.islayer.com no longer exists, we need a new URL to use. It also needs to be a URL that returns the client's IP address in plain text (this part is implied by code later in the function, specifically, that the IP length be less than 20 chars. Including dots, even if each octet in an IP is 3 digits, that gives a max of 15.)

If you have access to a web server on the public Internet with PHP or similar on it, you can whip up a small utility that, when accessed by an HTTP client, will simply return the client's IP address (in Apache web servers, I think you could use the value of the REMOTE_ADDR environment variable) For those of us that don't have this luxury -- well, ask google.

I asked google for a website to return my IP address in plain text. I'm not going to recommend any of the results of that google, because automated IP lookups may or may not fall within their acceptable use policies, etc. (In fact, here's such a policy at WhatIsMyIp.com) Once you find a URL that, when accessed, returns your public IP in plain text -- simply use that as the new value for ipURL on line 244 (or thereabout) in scripts/core.js. But please respect the usage policies of whatever site you use, as applicable.

Good luck ;)

Awesome f00f. Thank you for this! I can't believe I poked around that file and never found this.

For those that have access to a web server running php.....you can simply create a file on the server called something like ip.php and put in the following code (code obtained from networksecuritytoolkit.org):

Code:
<?php
/* $Id: ip.php,v 1.3 2008/09/24 13:58:49 pblankenbaker Exp $
 *
 * Small PHP script to "echo" back the IP address of the remote
 * system as it appears to the server.
 *
 * Example client side usage:
 *
 *   wget http://www.networksecuritytoolkit.org/nst/tools/ip.php -O -
 *
 */

// Echo back IP address as a "plain text" document

header('Content-type: text/plain');

// Check to see if server has been forwarded the request
if (isset($_SERVER['HTTP_X_REMOTE_ADDR'])) {
  printf("%s\n", $_SERVER['HTTP_X_REMOTE_ADDR']);
} else {
  printf("%s\n", $_SERVER['REMOTE_ADDR']);
}
?>

This will return the ip as a plain text string.

You can then point iStat at this new script to obtain the IP address. This is the route I'm going.

For those without a web server, you might even be able to get free hosting somewhere to place this file. The hosting does need to run PHP for this script to work.

-Kevin
 

hartsook

macrumors newbie
Oct 24, 2007
3
0
SF Bay Area
Works for me.

Thanks, iStatPro now returning my external ip address.

The hardest part was finding the widget file.

Finally used "Go to folder" in the Finder:Go menu and used ~/Library/Widgets to locate iStat, then opened the package to find the scripts/core/js file.
 

Badagri

macrumors 6502a
Aug 9, 2012
500
78
UK
Here was me thinking it was a preference file screw up or the last OS update. Awesome people you lot are!
 

unrealnighthawk

macrumors newbie
Oct 16, 2012
1
0
Awesome! Thanks a lot for the pointer f00f and the script kbmb! I'm now seeing my external IP perfectly. I don't seem to see any in/out data. Should that be tweaked somewhere else?
 

mag01

macrumors regular
Apr 10, 2011
150
47
Yeah, the IP address detection stopped because the islayer.com web sites went the way of the dodo bird -- and because the iStat Pro widget, by default, uses a URL within that domain for IP address detection. The solution is to use another web site that can display your external IP address when it's accessed. There's a number of such website that can do this for you (whatismyip.com is one I've used often; even google will tell you when you ask for it)

It's important to note that iStat wants to hit a URL that will return the IP address of the client (you) in plain text, with no HTTP cruft. The code for this stuff lives within the iStat Pro.wdgt package, in scripts/core.js, in the function getExtIP() (roughly line 243 in the file). This function is as follows:

Code:
function getExtIP(){
        ipURL = 'http://whatsmyip.islayer.com/?random='+new Date().getTime();
        ipConnection = new XMLHttpRequest();
        ipConnection.open("GET",ipURL,true);
        ipConnection.onreadystatechange = function() {
                if(ipConnection.readyState == 4 && ipConnection.responseText != null && ipConnection.responseText.length > 0) {
                        extIP = ipConnection.responseText;
                        if(extIP.length < 20 && ipConnection.status == 200 && extIP.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
                                e("wide_extip").innerHTML = extIP;
                                e("tall_extip").innerHTML = extIP;
                                valid_ip = true;
                        } else {
                                valid_ip = false;
                                e("wide_extip").innerHTML = "Unknown";
                                e("tall_extip").innerHTML = "Unknown";
                        }   
                }   
        }   
        ipConnection.send(null);
}

I posted the whole thing for the sake of context and completeness, but the important bit here is the second line: the variable ipURL. Since whatsmyip.islayer.com no longer exists, we need a new URL to use. It also needs to be a URL that returns the client's IP address in plain text (this part is implied by code later in the function, specifically, that the IP length be less than 20 chars. Including dots, even if each octet in an IP is 3 digits, that gives a max of 15.)

If you have access to a web server on the public Internet with PHP or similar on it, you can whip up a small utility that, when accessed by an HTTP client, will simply return the client's IP address (in Apache web servers, I think you could use the value of the REMOTE_ADDR environment variable) For those of us that don't have this luxury -- well, ask google.

I asked google for a website to return my IP address in plain text. I'm not going to recommend any of the results of that google, because automated IP lookups may or may not fall within their acceptable use policies, etc. (In fact, here's such a policy at WhatIsMyIp.com) Once you find a URL that, when accessed, returns your public IP in plain text -- simply use that as the new value for ipURL on line 244 (or thereabout) in scripts/core.js. But please respect the usage policies of whatever site you use, as applicable.

Good luck ;)

iStat Menus use h..p://ip.bjango.com (replaced 'tt' with '..' so that it doesn't link directly from here) for that purpose, you may try the same URL in iStat Pro.
 
Last edited:

pti'Luc

macrumors newbie
Oct 18, 2012
4
0
Solution for all without a server

Hi all,

as Bjango still offers this for iStat Menus why not simple replace that with their URL?

As f00f statet correct the h..p://whatsmyip.islayer.com is not correct anymore it can be replaced by h..p://ip.bjango.com.

This will be then the working solution:

Code:
function getExtIP(){
        ipURL = 'http://ip.bjango.com';
        ipConnection = new XMLHttpRequest();
        ipConnection.open("GET",ipURL,true);
        ipConnection.onreadystatechange = function() {
                if(ipConnection.readyState == 4 && ipConnection.responseText != null && ipConnection.responseText.length > 0) {
                        extIP = ipConnection.responseText;
                        if(extIP.length < 20 && ipConnection.status == 200 && extIP.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
                                e("wide_extip").innerHTML = extIP;
                                e("tall_extip").innerHTML = extIP;
                                valid_ip = true;
                        } else {
                                valid_ip = false;
                                e("wide_extip").innerHTML = "Unknown";
                                e("tall_extip").innerHTML = "Unknown";
                        }   
                }   
        }   
        ipConnection.send(null);
}
 
Last edited:

mag01

macrumors regular
Apr 10, 2011
150
47
pti'Luc: right, and as it responds properly even to plain GET request (without any query string) you may omit the /?random ... new Date().getTime() stuff and save few CPU cycles on this. :)
 
Last edited:

zepman

macrumors regular
Jul 1, 2010
196
16
Sweden
pti'Luc: right, and as it responds properly even to plain GET request (without any query string) you may omit the /?random ... new Date().getTime() stuff and save few CPU cycles on this. :)

That worked great! Thanks.
For the nano, the code is located in a different file, Workers.js. It worked great for the nano too.
 

Badagri

macrumors 6502a
Aug 9, 2012
500
78
UK
This is odd, I have pti'Luc's fix in iStat Pro working but iStat nano still shows fetching with the same code applied to workers.js.
 

laserjay

macrumors newbie
Oct 30, 2012
1
0
for all the magic mouse users: I changed the battery_btmouse.png from mighty to magic, just replace it.
 

Attachments

  • battery_btmouse.png
    battery_btmouse.png
    1.6 KB · Views: 14,506

Badagri

macrumors 6502a
Aug 9, 2012
500
78
UK
Hi all,

as Bjango still offers this for iStat Menus why not simple replace that with their URL?

As f00f statet correct the h..p://whatsmyip.islayer.com is not correct anymore it can be replaced by h..p://ip.bjango.com.

This will be then the working solution:

Code:
function getExtIP(){
        ipURL = 'http://ip.bjango.com';
        ipConnection = new XMLHttpRequest();
        ipConnection.open("GET",ipURL,true);
        ipConnection.onreadystatechange = function() {
                if(ipConnection.readyState == 4 && ipConnection.responseText != null && ipConnection.responseText.length > 0) {
                        extIP = ipConnection.responseText;
                        if(extIP.length < 20 && ipConnection.status == 200 && extIP.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
                                e("wide_extip").innerHTML = extIP;
                                e("tall_extip").innerHTML = extIP;
                                valid_ip = true;
                        } else {
                                valid_ip = false;
                                e("wide_extip").innerHTML = "Unknown";
                                e("tall_extip").innerHTML = "Unknown";
                        }   
                }   
        }   
        ipConnection.send(null);
}

Can anyone advise on the solution to my problem with iStat Nano. I'm unable to get the code to work. After saving the workers.js and reloading the widget, the external IP still comes up with fetching...

But the same code above for iStat Pro works perfectly. I'm really puzzled why the code wont work for iStat Nano. I've double and triple checked nothing was wrong with the code or space between sections.
 

iThinkergoiMac

macrumors 68030
Jan 20, 2010
2,664
4
Terra
Actually as of today iStat is completely gone. islayer.com where people could download it is down, never to return again. @bjango at twitter confirms it. :( Just reinstalled ML from scratch and hate having no iStat anymore.

This is terrible. I have both iStat Pro and iStat Menus... it even updated something like a month ago. Not having the Menus app is going to be quite terrible. Any reason why?
 

GGJstudios

macrumors Westmere
May 16, 2008
44,556
950
Actually as of today iStat is completely gone. islayer.com where people could download it is down, never to return again. @bjango at twitter confirms it. :( Just reinstalled ML from scratch and hate having no iStat anymore.
They're not gone. You can still get both. iStat Pro (free) or iStat Menus ($16)

This post includes fixes for the iStat Pro widget, for displaying the external IP address and for displaying process information in ML.
 

ryedarrow

macrumors member
Jun 30, 2012
51
0
Actual Replacement?

Love all the help from the thread on how to fix iStat pro, but I'm looking for a real replacement. I'm done with iSlayer/bjango.

Any ideas on other apps to replace iStat?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.