What do you use as a system monitor - Servers Administration, Networking, & Virtualization

Users browsing this thread: 1 Guest(s)
VMS
Members
(13-02-2022, 05:49 AM)venam Wrote: On that note, I also forgot I have a script for battery status that pops up at certain intervals.

I do have one too on NetBSD, and the concept is somehow similar:

Code:
#!/bin/sh
    CHARGE=$(/usr/sbin/envstat | grep charge: | sed 's/.*(\(.*\))/\1/')
    BATT=$(echo $CHARGE | awk '{print $1}')

if envstat | grep -Eiq 'charging.*true'; then
  STATUS=charging
else
  STATUS=discharging
fi
notify-send "$(echo -e "battery = $BATT \nstatus  = $STATUS")"

It relies on envsys(4) (Environmental Systems framework), which was written by the creator of Void's XBPS and can print a lot of useful info from monitor devices and sensors in quite a fancy and human-readable fashion.

Usually I bind this to something like Mod4 + b in CTWM.
Similarly, I bind Mod4 + v to:

Code:
#!/bin/sh
VOL=$(mixerctl -n outputs.master | cut -d , -f 1 | \
     awk '{print $1/254*100}' | cut -d . -f 1)
notify-send "volume: $VOL %"

In my ~/.profile I have this little function to monitor power-management related events. I usually have a sticky term running it in foreground.

Code:
pwrd()
        {
             ( tail -f -n0 /var/log/messages & ) | sed -n -e 's/^.*sensor_battery: //p'
        }

As a pseudo graphical resource monitor, I really love systat; the interface might look a bit ugly by modern standards, as it relies on the native curses library, which is more limited compared to ncurses, but it does its job and does it well. systat can display various statistics at the same time including cpu load, virtual memory, processes, swap usage, disk i/o, open sockets, established connections, network traffic...for example `systat iostat` looks like that:

[Image: systat.png]

To quickly display the number of total used buffers in megabytes, I also use this script; useful on server and public access BSD systems like SDF or GREX.

Code:
#!/bin/sh
vmstat -s | awk '
/ bytes per page$/ { bpp = $1 }
/ cached file pages$/ { cfp = $1 }
/ cached executable pages$/ { cep = $1 }
END { print((cfp + cep) * bpp / 1024 / 1024); }'

As for graphical tools, I really like a tool ported from old versions of SPARC32 Solaris and called xmeter. I was unable to find a description to link here, but, from the man page:

Quote: Xmeter displays a periodically updating histogram of the system
statistics gathered by rstat(3) for the specified hosts. Meters can be
displayed in a vertical, horizontal or rectangular arrangement. As
statistics range between 4 user defineable levels (OK, WARN, ERROR or
FATAL), the background, foreground, highlight, border and internal
border colors, and the background bitmap of each meter can be changed.

rstat is a daemon capable of returning performance statistics obtained from the kernel. These can be read using the rup(1) command. rstat is a Sun RPC protocol, and I suppose that's why I was unable to find a port of xmeter for Linux.


Messages In This Thread
What do you use as a system monitor - by venam - 10-02-2022, 01:22 PM
RE: What do you use as a system monitor - by movq - 12-02-2022, 04:51 AM
RE: What do you use as a system monitor - by pfr - 14-02-2022, 10:31 PM
RE: What do you use as a system monitor - by VMS - 15-02-2022, 01:14 PM
RE: What do you use as a system monitor - by jkl - 21-02-2022, 11:31 AM
RE: What do you use as a system monitor - by prx* - 24-02-2022, 06:02 PM
RE: What do you use as a system monitor - by gaak - 31-10-2022, 04:21 AM