18

Because my internet connection is very unstable at the moment, I'd like to use a small indicator applet for the Unity panel.

Since I'm connected through a WLAN/Wifi Router, I can see in the network-applet when the connection to the router is lost, but not when the router loses the connection to the Internet.

A Windows 7 computer of mine has this functionality. It shows a black exclamation mark on yellow ground if it can't "ping" a remote server.

I'm running Ubuntu 11.10 "Oneiric Ocelot" 64-Bit with Unity 3D.

2 Answers2

24

Whilst you mentioned you wish to do this in the network applet - I don't think you can do this. Here is an alternative.

internet up

enter image description here

internet down

enter image description here

how to for 11.10 & 12.04

It requires an indicator from a PPA together with a custom ping test script:

sudo add-apt-repository ppa:alexeftimie/ppa
sudo apt-get update
sudo apt-get install indicator-sysmonitor
mkdir -p ~/scripts && cd ~/scripts

using:

gedit pingtest.sh

Copy and paste the code below into the new file and save & close.

Give the file execute permission:

chmod +x pingtest.sh

Start the indicator

indicator-sysmonitor &

Then in the indicator-preferences:

enter image description here

click "use this command" and copy and paste the following text:

$HOME/scripts/pingtest.sh

code

#!/bin/bash

if ping -c 1 -W 2 google.com > /dev/null; then
 echo "Up"
else
 echo "Down"
fi
fossfreedom
  • 172,746
  • This could be easily modified for Website Monitoring, wish i could +2! – Lewis Goddard Feb 22 '12 at 12:53
  • @fossfreedom, 1. What application did you use to draw those arrows on the images? 2. Does it still work on 14.04? indicator-sysmonitor isn't available in that PPA! – mini Apr 23 '14 at 17:51
  • @Kin - that is with Shutter! I've created another answer for 14.04. Hope that helps you. – fossfreedom Apr 23 '14 at 20:33
  • @mini any news? just tried and it is not available to ubuntu trusty.. I will I will try the old deb – Aquarius Power Nov 13 '14 at 03:07
  • @mini ok, I downloaded the latest version manually from ppa and installed it with gdebi indicator-sysmonitor_0.4.3_all.deb (required sudo apt-get install python-psutil btw), it is running :) – Aquarius Power Nov 13 '14 at 03:14
  • 1
    @AquariusPower - v0.5 is available from the PPA for both Trusty and Utopic - https://launchpad.net/~fossfreedom/+archive/ubuntu/indicator-sysmonitor?field.series_filter=trusty – fossfreedom Nov 13 '14 at 07:42
  • @fossfreedom do you think it could be used in someway to create a workaround for this question? May be it could have custom icon/image support added? – Aquarius Power Nov 16 '14 at 16:50
19

The original answer was written for Ubuntu 11.10 & 12.04.

Since then, the indicator interface was changed for 12.10 & 13.04. However, the maintainer has not released a version since then for later Ubuntu versions. No code commits in the launchpad PPA has been made since first quarter 2013.

Thus I have forked the project, fixed a few bugs and made it available for 14.04 Trusty users. Feel free to check out the code on GitHub and help out with the maintenance.

internet up

enter image description here

internet down

enter image description here

how to for 14.04

It requires an indicator from my PPA together with a custom ping test script:

sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt-get install indicator-sysmonitor
mkdir -p ~/scripts && cd ~/scripts

using:

gedit pingtest.sh

Copy and paste the code below into the new file and save & close.

Give the file execute permission:

chmod +x pingtest.sh

Start the indicator

indicator-sysmonitor &

Then in the indicator-preferences click New:

enter image description here

Then enter the details as shown:

enter image description here

i.e. use the command

$HOME/scripts/pingtest.sh

Click OK, followed by the following actions 1,2,3 & 4:

enter image description here code

#!/bin/bash

if ping -c 1 -W 2 google.com > /dev/null; then
 echo "Up"
else
 echo "Down"
fi
fossfreedom
  • 172,746
  • I've been using Manjaro since a while now, so I can't test the solution, but I'm sure it works ;) Thanks! – wintersolutions Apr 23 '14 at 21:24
  • after typing "indicator-sysmonitor &" I get: [1] 3660 username@host:~$ INFO:root:start INFO:root:Menu shown INFO:root:Fetcher started [1] 3660

    mikeal@MITO2:~$ INFO:root:start INFO:root:Menu shown INFO:root:Fetcher started - no GUI is launched.

    – Kalamalka Kid Jan 04 '16 at 02:30
  • @KalamalkaKid - please raise this on the project issues page - link in the answer – fossfreedom Jan 04 '16 at 08:55