Monitoring system metrics

Everything about X, Gnome, KDE, ... and everything running on it

Monitoring system metrics

Postby adamk0001 » 2019-11-25 05:20

Hi, I have a set of terminals that I regularly start in xfce each time I log in to assist with system monitoring. I run megaclisas-status (requires root/sudo), sensors, free, htop, and iwconfig (requires root/sudo) as arguments to the "watch" tool. See sanitized screenshot for visual:
Image

I have thought about ways to make this easier & faster (e.g. with "screen"), but haven't had much success - screen can split a single terminal but not with uneven partitions, unless I missed something in the documentation.

I've also looked at some pre-built monitoring dashboards, but I haven't found something lightweight that also supports each metric. Most don't support megaclisas-status or iwconfig.

Is there a way to use the session function of xfce to recreate this terminal setup each time I login? or maybe I could use a bash script that could launch the terminals in the appropriate locations/sizes and run the commands?

I am open to any other suggestions as well...

Thank you for your help!!
The feeling of helplessness that accompanies the use of Non-Free Software after learning and understanding the virtues brought forth through Free Software is not something any person can or should abide by (https://www.fsf.org/about/what-is-free-software)
adamk0001
 
Posts: 16
Joined: 2012-09-19 18:53

Re: Monitoring system metrics

Postby sunrat » 2019-11-25 06:23

Would Glances do what you want? It's in Debian repos.
https://github.com/nicolargo/glances

Or you can multiplex terminals with tmux - https://github.com/tmux/tmux/wiki also in Debian repos.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Monitoring system metrics

Postby Dai_trying » 2019-11-25 07:06

I think Terminator will do what you want, it can use config files to run a specific setup, ie with split windows and different commands running in each one. Once installed you can search the man page for usage and right click the terminal for preferences and splitting options.
Dai_trying
 
Posts: 834
Joined: 2016-01-07 12:25

Re: Monitoring system metrics

Postby adamk0001 » 2019-11-25 17:11

Thanks for all the suggestions!

I think either tmux or Terminator would work. Initially, I had dismissed Terminator because it seems GNOME specific, while I run xfce. I looked into it more and only needed ~500k of packages + 3MB for installation, so it sure is lightweight. A little annoying to configure, but works really well once all set up:
https://imgur.com/a/sWR4UUW

I looked at Glances as well. It is a big footprint for what I require, considering all the monitoring tools already exist on my system.

My Terminator config file contents is below (taken from ~/.config/terminator/config). You can set up a launcher to run "terminator -l Monitoring" to automatically start the Monitoring layout.

A few notes:
1. I removed the UUID for each of my terminals. I am not sure if that foobars the portability of the config file. I hope Terminator will simply assign new UUID's if someone tries to stand this up on their own system.
2. I removed the interface name from the iwconfig command. You can insert your own or it will simply display all network interfaces, but it doesn't make sense to do that if you have any network interfaces without wireless extensions.
3. I have it configured to run "su - -c <command>" but it can be easily changed to sudo syntax.
4. The window size is based on a 1920x1200 resolution

Code: Select all
[global_config]
  window_state = maximise
  borderless = True
  extra_styling = False
  title_hide_sizetext = True
  title_transmit_fg_color = "#555753"
  title_transmit_bg_color = "#000000"
  title_receive_fg_color = "#555753"
  title_receive_bg_color = "#000000"
  title_inactive_fg_color = "#555753"
  title_inactive_bg_color = "#000000"
  inactive_color_offset = 1.0
  enabled_plugins = ,
  suppress_multiple_term_dialog = True
[keybindings]
[profiles]
  [[default]]
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    exit_action = hold
    custom_command = 'echo \"foo#bar\"'
  [[htop]]
    cursor_blink = False
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    scrollbar_position = hidden
    exit_action = restart
    use_custom_command = True
    custom_command = htop
  [[free]]
    cursor_blink = False
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    scrollbar_position = hidden
    exit_action = restart
    use_custom_command = True
    custom_command = watch -n 240 free -h
  [[megaclisas]]
    cursor_blink = False
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    scrollbar_position = hidden
    exit_action = restart
    use_custom_command = True
    custom_command = 'su - root -c "watch -n 240 megaclisas-status"'
  [[iwconfig]]
    cursor_blink = False
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    scrollbar_position = hidden
    exit_action = restart
    use_custom_command = True
    custom_command = 'su - root -c "watch -n 120 iwconfig"'
  [[sensors]]
    cursor_blink = False
    cursor_color = "#aaaaaa"
    foreground_color = "#00b301"
    scrollbar_position = hidden
    exit_action = restart
    use_custom_command = True
    custom_command = watch -n 240 sensors
[layouts]
  [[default]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
  [[Monitoring]]
    [[[child0]]]
      type = Window
      parent = ""
      order = 0
      position = 0:29
      maximised = True
      fullscreen = True
      size = 1920, 1171
      title = Monitoring
      last_active_window = True
    [[[child1]]]
      type = VPaned
      parent = child0
      order = 0
      position = 484
      ratio = 0.41509433962264153
    [[[child2]]]
      type = HPaned
      parent = child1
      order = 0
      position = 1179
      ratio = 0.6156657963446475
    [[[terminal3]]]
      type = Terminal
      parent = child2
      order = 0
      title = megacli sas
      profile = megaclisas
    [[[child4]]]
      type = VPaned
      parent = child2
      order = 1
      position = 182
      ratio = 0.37995824634655534
    [[[terminal5]]]
      type = Terminal
      parent = child4
      order = 0
      profile = free
      title = memory
    [[[terminal6]]]
      type = Terminal
      parent = child4
      order = 1
      profile = iwconfig
      title = network
    [[[child7]]]
      type = HPaned
      parent = child1
      order = 1
      position = 589
      ratio = 0.30757180156657965
    [[[terminal8]]]
      type = Terminal
      parent = child7
      order = 0
      profile = sensors
      title = sensors
    [[[terminal9]]]
      type = Terminal
      parent = child7
      order = 1
      profile = htop
      title = htop
[plugins]

The feeling of helplessness that accompanies the use of Non-Free Software after learning and understanding the virtues brought forth through Free Software is not something any person can or should abide by (https://www.fsf.org/about/what-is-free-software)
adamk0001
 
Posts: 16
Joined: 2012-09-19 18:53

Re: Monitoring system metrics

Postby Dai_trying » 2019-11-25 18:20

Looks like you got it covered :) Terminator is usually one of the first packages I install on a new system, I find it to be really useful.
Dai_trying
 
Posts: 834
Joined: 2016-01-07 12:25

Re: Monitoring system metrics

Postby stevepusser » 2019-11-25 23:45

Couldn't Conky show that information also?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Clipgrab 3.8.6, Hedgewars 1.0.0, PulseEffects 4.6.9, Telegram-desktop 1.8.15, Pale Moon 28.8.0, KeepassXC 2.5.1
User avatar
stevepusser
 
Posts: 11316
Joined: 2009-10-06 05:53

Re: Monitoring system metrics

Postby adamk0001 » 2019-11-26 22:39

Thanks for the additional suggestion. I checked Conky out. It looks like Conky uses cairo (https://packages.debian.org/sid/conky-all) - you wouldn't have any way of knowing, but I don't have a fancy desktop compositor and don't plan to start using one. I just have xfce4's window manager, with compositing disabled. It's nice and fast, as I don't need eye candy. I didn't think that was relevant information to my original post, but I'm learning every day :)

It seems that I'd need to create a custom lua "widget" (or whatever conky calls them) for megaclisas, which doesn't make sense to me since I already have the program which spits everything needed to the terminal.

Thanks again for the suggestion. I'm going to stick with the Terminator approach for now.
The feeling of helplessness that accompanies the use of Non-Free Software after learning and understanding the virtues brought forth through Free Software is not something any person can or should abide by (https://www.fsf.org/about/what-is-free-software)
adamk0001
 
Posts: 16
Joined: 2012-09-19 18:53

Re: Monitoring system metrics

Postby stevepusser » 2019-11-27 00:01

Conky doesn't need compositing, and can even show pdeudo transparency on the xfce desktop with it disabled, (as in the MX 18.3 Live session) but I'm pretty sure a simple script can also create an megaclisas output that Conky can display, though I'm not a Conky guru.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Clipgrab 3.8.6, Hedgewars 1.0.0, PulseEffects 4.6.9, Telegram-desktop 1.8.15, Pale Moon 28.8.0, KeepassXC 2.5.1
User avatar
stevepusser
 
Posts: 11316
Joined: 2009-10-06 05:53

Re: Monitoring system metrics

Postby Head_on_a_Stick » 2019-11-28 16:37

Put it all on a console screen with dvtm so it's always available without taking up any desktop space.
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable