Conky network section doesn't report IP or activity
I recently got a refurbished Thinkpad T430s and installed Ubuntu Mate 16.04.3 LTS. One of my customizations was to install conky and download a .conkyrc
that gives me a running performance monitor -- cpu, RAM, HDD and network.
This is great, except that the network section gives a skull-and-bones icon and reported "No network." I know I need to edit the .conkyrc
-- how do I find the correct WLAN name and where do I need to insert it?
Here's my existing .conkyrc
:
###########################
# http://www.NoobsLab.com #
# - Conky settings - #
###########################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1
if_up_strictness link
imlib_cache_size 0
double_buffer yes
no_buffers yes
format_human_readable
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Ubuntu:size=8
override_utf8_locale yes
text_buffer_size 2048
#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type conky
own_window_argb_visual yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment top_right
gap_x 25
gap_y 40
minimum_size 182 600
maximum_width 182
default_bar_size 60 8
#########################
# - Graphics settings - #
#########################
draw_shades no
default_color cccccc
color0 white
color1 white
color2 white
color3 white
TEXT
${font Ubuntu:style=Bold:size=8}SYSTEM $stippled_hr${font}
##############
# - SYSTEM - #
##############
${color0}${font Poky:size=14}S${font}${color}${goto 32}${voffset -8}Kernel: ${alignr}${color2}${kernel}${color}
${goto 32}Uptime: ${alignr}${color2}${uptime}${color}
# |--CPU
${voffset 2}${offset 2}${color0}${font Poky:size=14}P${font}${offset -19}${voffset 9}${offset 1}${cpubar cpu0 4,18}${color}${voffset -16}${goto 32}CPU1: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%${color}${font} ${alignr}${color2}${cpugraph cpu1 8,60 77507B 5C3566}${color}
${goto 32}CPU2: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu2}%${color}${font} ${alignr}${color2}${cpugraph cpu2 8,60 77507B 5C3566}${color}
${goto 32}CPU3: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu3}%${color}${font} ${alignr}${color2}${cpugraph cpu3 8,60 77507B 5C3566}${color}
${goto 32}CPU4: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu4}%${color}${font} ${alignr}${color2}${cpugraph cpu4 8,60 77507B 5C3566}${color}
# |--MEM
${voffset 2}${offset 1}${color0}${font Poky:size=14}M${font}${color}${goto 32}${voffset -7}RAM: ${font Ubuntu:style=Bold:size=8}${color1}$memperc%${color}${font}
${voffset 1}${offset 1}${voffset 2}${color0}${membar 4,18}${color}${goto 32}${voffset -2}F: ${font Ubuntu:style=Bold:size=8}${color2}${memeasyfree}${color}${font} U: ${font Ubuntu:style=Bold:size=8}${color2}${mem}${color}${font}
#############
# - CLOCK - #
#############
${voffset 4}${font Ubuntu:style=Bold:size=8}DATE $stippled_hr${font}
${voffset -10}${alignc 46}${color2}${font Arial Black:size=30}${time %H:%M}${font}${color}
${alignc}${time %d %B %Y}
##########
# - HD - #
##########
${voffset 4}${font Ubuntu:style=Bold:size=8}HDD $stippled_hr${font}
${offset 27}${font Ubuntu:style=normal:size=8}${color}DISK Root
${offset 29}${font Ubuntu:size=7,weight:normal}${color}Used: ${fs_used /}
${offset 122}${diskiograph 8,60 666666 666666}
#${offset 55}${diskiograph 8,60 666666 666666}
###############
# - NETWORK - #
###############
${voffset -4}${font Ubuntu:style=Bold:size=8}NETWORK $stippled_hr${font}
# |--WLAN0
${if_up WLAN0}
${voffset -5}${color0}${font Webdings:size=17}”${font}${color}${goto 32}${voffset -5}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed WLAN0}${color}${font} ${alignr}${color2}${upspeedgraph WLAN0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup WLAN0}${color}${font}
${voffset 2}${color0}${font Webdings:size=17}“${font}${color}${goto 32}${voffset -5}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed WLAN0}${color}${font} ${alignr}${color2}${downspeedgraph WLAN0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown WLAN0}${color}${font}
${voffset 2}${color0}${font Poky:size=14}Y${font}${color}${goto 32}${voffset -2}Signal: ${font Ubuntu:style=Bold:size=8}${color1}${wireless_link_qual_perc WLAN0}%${color}${font} ${alignr}${color2}${wireless_link_bar 8,60 WLAN0}${color}
${voffset 2}${color0}${font Webdings:size=16}¬${font}${color}${goto 32}${voffset -8}Local IP: ${alignr}${color2}${addr WLAN0}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 10800 ~/.conky/conkyIp}${color}
# |--ETH0
${else}${if_up eth0}
${voffset -5}${color0}${font Webdings:size=17}”${font}${color}${goto 32}${voffset -5}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed eth0}${color}${font} ${alignr}${color2}${upspeedgraph eth0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup eth0}${color}${font}
${voffset 2}${color0}${font Webdings:size=17}“${font}${color}${goto 32}${voffset -5}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed eth0}${color}${font} ${alignr}${color2}${downspeedgraph eth0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown eth0}${color}${font}
${voffset 2}${color0}${font Webdings:size=16}¬${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr eth0}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 10800 ~/.conky/conkyIp}${color}
# |--PPP0
${else}${if_up ppp0}
${voffset -5}${color0}${font Webdings:size=17}”${font}${color}${goto 32}${voffset -5}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed ppp0}${color}${font} ${alignr}${color2}${upspeedgraph ppp0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup ppp0}${color}${font}
${voffset 2}${color0}${font Webdings:size=17}“${font}${color}${goto 32}${voffset -5}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed ppp0}${color}${font} ${alignr}${color2}${downspeedgraph ppp0 8,60 77507B 5C3566}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown ppp0}${color}${font}
${voffset 2}${color0}${font Webdings:size=16}¬${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr ppp0}${color}
${else}${voffset 4}${offset 4}${color0}${font Wingdings:size=20}N${font}${color}${voffset -6}${goto 32}Network Unavailable${voffset 14}${endif}${endif}${endif}
Solution 1:
Seemingly just to confuse users, there are many different network entries possible -- whether this is related to hardware/drivers, exact version of Ubuntu, or something less sensible is hard to be sure. Unfortunately, one can't be sure one will find ETH0 or WLAN0 -- but many downloaded scripts will assume this. I had to find the correct wifi name for my particular system. A little Googling found this command:
$ nmcli dev status
DEVICE TYPE STATE CONNECTION
wlp3s0 wifi connected StokesCountyDEAvan4
enp0s25 ethernet unavailable --
lo loopback unmanaged --
This command doesn't require superuser privilege, so should be accessible to secondary users, likely even guests. Easily seen is that ETH0 or ETH1 and WLAN0 are nowhere in site. All I had to do to get my Conky network monitor section working correctly was replace every occurrence of WLAN0 in the .conkyrc
with wlp3s0, and ETH0 with enp0s25 (in case I connect via wired Ethernet). On saving the file, conky restarted, and began correctly reporting my network condition and activity in real time, as it does with CPU load, RAM usage, and HDD i/o.
Solution 2:
Yeah... Ubuntu (and other distros?) adopted a new naming convention for the interfaces making eth0 and wlan0 obsolete (and thus any code based thereon non-functional).
I suggest everyone just ifconfig and see what your interfaces are called, and then do a Ctrl+F in your conky files, looking for 'wlan0' and 'eth0,' so you can then paste the new names over those entries wherever they appear in the code. Here is what I get with an ifconfig:
ifconfig shows your interface labels
This means that network related tasks for conky files you download can no longer be guaranteed to work even IF the developer knows about the new naming conventions because the names are specific to YOUR computer. For example, on my computer, my wlan0 is now wlp2s0 whereas on yours it is evidently wlp3s0. So even my updated conky files won't work right until you do the find/replace for the interface labels to reflect your interface names.
This raises an interesting question. Should we conky developers bother even changing the files from wlan0/eth0 if we intend to offer them for others to download? Wouldn't it be more difficult for them to search for whatever my computer calls my interface than the traditional labels? I guess we could make a nice #note to inform people what to edit and where inside the conky files regardless.
Or we could tell people to search for 'wlp' or 'enp' to find the entries and replace them with theirs if they differ from what their ifconfig says. But is that uniformity confirmed even at the partial level such that we know that all interfaces will at least start with wlp or enp even if the rest is different? How much of this naming convention is universal versus unique? I shall dig for some more info so conky file developers can figure out how to proceed.