Display Public IP address under system load info

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
toprunner2786
Newbie
Newbie
Posts: 2
Joined: June 25th, 2014, 3:46 pm

Display Public IP address under system load info

Post by toprunner2786 »

I apologize in advance because I am not a programmer. I currently run a headless/guiless ubuntu VM that runs SAB. It connects to the internet thru a VPN. I was wondering if someone could help me modify the SAB web page code so that I can display my public IP address underneath the system load info

something like this: "Publi IP: XXX.XXX.XXX.XXX"

This would allow me to easily check to ensure that the VPN is up and running correctly.

I am hoping that it is as easy as executing and displaying the poutput of the code below:
wget -qO- http://ipecho.net/plain ; echo

unfortunately i have no idea where or how to start this....any help?
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Display Public IP address under system load info

Post by sander »

You could put that into the value of 'p' loadavg() in sabnzbd/misc.py. See http://forums.sabnzbd.org/viewtopic.php ... oad#p71815

However, I believe that function is called on each SAB page refresh, so each few seconds. And maybe ipecho.net doesn't like that.

Pity you're not a programmer, because if you were, you could hack the below two lines into loadavg() just before the 'return p'

Code: Select all

            myip4 = urllib.urlopen('http://ipecho.net/plain').read()
            p = p + ' Public IPv4: ' + myip4
toprunner2786
Newbie
Newbie
Posts: 2
Joined: June 25th, 2014, 3:46 pm

Re: Display Public IP address under system load info

Post by toprunner2786 »

I am definitely not a programmer, but I love to tinker....thanks for the tip. I will learn by trial and error....
Post Reply