Skip to content

Commit

Permalink
* Closes #158, see [here](#158)
Browse files Browse the repository at this point in the history
* Closes #164, see [here](#164)
  • Loading branch information
marcus67 committed Jan 28, 2022
1 parent 3d92abe commit 18e6e88
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 24 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

This document lists all changes of `LittleBrother` with the most recent changes at the top.

## Version 0.4.15 Revision 115 (January 18th, 2022)
## Version 0.4.15 Revision 115 (January 28th, 2022)

* Upgrade to `python_base_app` version 0.2.31
* Closes #158, see [here](https://github.com/marcus67/little_brother/issues/158)
* Closes #164, see [here](https://github.com/marcus67/little_brother/issues/164)

## Version 0.4.14 Revision 114 (January 6th, 2022)

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The latest major feature changes are:

| Version | Feature/Fix | (Issue) Link |
|----------|---------------------------------------------------------------|----------------------------------------------------------------------|
| 0.4.15 | *Bug Fix*: Do not fail on Debian package upgrades | [Issue 158](https://github.com/marcus67/little_brother/issues/158) |
| 0.4.14 | *Bug Fix*: Correct detection of users in master-only setups | [Issue 163](https://github.com/marcus67/little_brother/issues/163) |
| 0.4.12 | *New*: Client process available as snap | [Snapcraft Support](https://github.com/marcus67/snap-little-brother) |
| 0.4.9 | *New*: Automatic check for new versions of `LittleBrother` | [Issue 150](https://github.com/marcus67/little_brother/issues/150) |
| | *Improvement*: Separate LDAP search DN for groups and users | [Issue 144](https://github.com/marcus67/little_brother/issues/144) |
Expand Down Expand Up @@ -156,6 +158,8 @@ See [this page](NON-DEBIAN-INSTALLATION.md) for details.

| Distribution | Version | Architecture | Comments | Most Recent Test |
| ------------ | ------------- | ------------ | ---------------------------------------------------------------------- | ---------------- |
| Ubuntu | 20.04 | amd64 | | 28.JAN.2022 |
| Debian | 11 (bullseye) | amd64 | Feedback from a user as regular install using Mate desktop | 28.JAN.2022 |
| Ubuntu | 18.10 | amd64 | See [pip3 issue](https://github.com/marcus67/little_brother/issues/53) | 03.JUN.2019 |
| Debian | buster | amd64 | This distribution (buster-slim) is used as base image for Docker | 01.JAN.2020 |
| Debian | 10.3 (buster) | amd64 | Feedback from a user as regular install with Mate desktop | 05.MAR.2020 |
Expand All @@ -168,8 +172,6 @@ There is a snap available for the client process. See [snap-little-brother](http

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/little-brother-slave)



## Quick Install (Debian Package)

This guide will take you through the steps required to install, configure, and run the `LittleBrother` application
Expand Down
15 changes: 9 additions & 6 deletions WEB_FRONTEND_MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,22 @@ In order to keep the overview over the network of PCs the tab `Topology` provide

It shows the master and all slave nodes with the following columns:

* *Node Type*: Denotes the type of node ("Master" or "Slave"). There is exactly one master and `0..N` slaves. If
* *Node Type*: Denotes the type of node ("Master" or "Slave"). There is exactly one master and `0..N` slaves. If
the node process is running in a Docker container it will have an additional `(Docker)` remark.

* *Node Name*: Denotes Unique name of the node. I usually corresponds to the host DNS name but it can be set in the
* *Node Name*: Denotes Unique name of the node. I usually corresponds to the host DNS name but it can be set in the
configuration file.

* *App Version*: Denotes the version of the `LittleBrother` process on that node.
* *App Version*: Denotes the version of the `LittleBrother` process on that node.

* *Revision*: Denotes the revision of the `LittleBrother` process on that node.
* *Revision*: Denotes the revision of the `LittleBrother` process on that node.

* *Distribution*: Denotes the Linux distribution running on that node as reported
by package [`distro`](https://pypi.org/project/distro/).

* *Python Version*: Denotes the version of the Python interpreter running the `LittleBrother` process on that node.
* *Python Version*: Denotes the version of the Python interpreter running the `LittleBrother` process on that node.

* *Time Since Last Ping*: Denotes the time since the master has received the most recent statistics from that node.
* *Time Since Last Ping*: Denotes the time since the master has received the most recent statistics from that node.
Since the default ping time is five seconds this value will usually not exceed four seconds.

### Detection of Suspicious Constellations
Expand Down
2 changes: 1 addition & 1 deletion contrib/python_base_app
4 changes: 3 additions & 1 deletion little_brother/app_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import sys
import time

import distro
import prometheus_client

from little_brother import admin_event
Expand Down Expand Up @@ -564,7 +565,8 @@ def get_client_stats(self):
minor=sys.version_info.minor,
micro=sys.version_info.micro),
p_running_in_docker=tools.running_in_docker(),
p_running_in_snap=tools.running_in_snap()
p_running_in_snap=tools.running_in_snap(),
p_linux_distribution=distro.name(pretty=True)
)

if not self.is_master():
Expand Down
8 changes: 8 additions & 0 deletions little_brother/client_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ def runtime(self):

return ""

@property
def linux_distribution(self):
if self.client_stats is not None and self.client_stats.linux_distribution is not None:
return self.client_stats.linux_distribution

else:
return _("n/a")

@property
def node_type(self):
return _("Master") if self.is_master else _("Slave")
Expand Down
4 changes: 3 additions & 1 deletion little_brother/client_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

class ClientStats(object):
def __init__(self, p_version=None, p_revision=None, p_python_version=None,
p_running_in_docker=None, p_running_in_snap=None):
p_running_in_docker=None, p_running_in_snap=None,
p_linux_distribution=None):
self.version = p_version
self.revision = p_revision
self.python_version = p_python_version
self.running_in_docker = p_running_in_docker
self.running_in_snap = p_running_in_snap
self.linux_distribution = p_linux_distribution
self.resident_memory_bytes = 0.0
self.start_time_seconds = 0.0
self.cpu_seconds_total = 0.0
Expand Down
16 changes: 16 additions & 0 deletions little_brother/static/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,22 @@ a.CVE_HYPERLINK:visited {
padding-right: 2px;
}

.col-sm-1 {
padding-left: 2px;
padding-right: 2px;
}

.col-sm-2 {
padding-left: 2px;
padding-right: 2px;
}

.col-sm-3 {
padding-left: 2px;
padding-right: 2px;
}


.col-xs-1 input {
padding-left: 1px;
padding-right: 1px;
Expand Down
26 changes: 14 additions & 12 deletions little_brother/templates/topology.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,23 @@

<DIV CLASS="container STANDARD_TABLE">
<DIV CLASS="row ROWLEVEL_1 TITLE_ROW">
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('Node Type')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('Node Name')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('App Version')}}</DIV>
<DIV CLASS="col-xs-2 hidden-xs localetext">{{_('Revision')}}</DIV>
<DIV CLASS="col-xs-2 hidden-xs localetext">{{_('Python Version')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('Time Since Last Ping')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('Node Type')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{_('Node Name')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-1 localetext">{{_('App Version')}}</DIV>
<DIV CLASS="hidden-xs col-sm-1 localetext">{{_('Revision')}}</DIV>
<DIV CLASS="hidden-xs col-sm-4 col-md-3 localetext">{{_('Distribution')}}</DIV>
<DIV CLASS="hidden-xs col-sm-1 localetext">{{_('Python Version')}}</DIV>
<DIV CLASS="col-xs-3 col-sm-1 col-md-2 localetext">{{_('Time Since Last Ping')}}</DIV>
</DIV>
{% for info in topology_infos %}
<DIV CLASS="row ROWLEVEL_3">
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{ _(info.node_type) }} {{ info.runtime }}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{ info.host_name }}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext {{ info.version_class }}">{{ info.version_string }}</DIV>
<DIV CLASS="col-xs-2 hidden-xs localetext">{{ info.client_stats.revision }}</DIV>
<DIV CLASS="col-xs-2 hidden-xs localetext">{{ info.client_stats.python_version }}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext {{ info.last_message_class}}">{{ info.seconds_without_ping | seconds_as_humanized_duration }}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{ _(info.node_type) }} {{ info.runtime }}</DIV>
<DIV CLASS="col-xs-3 col-sm-2 localetext">{{ info.host_name }}</DIV>
<DIV CLASS="col-xs-3 col-sm-1 localetext {{ info.version_class }}">{{ info.version_string }}</DIV>
<DIV CLASS="hidden-xs col-sm-1 localetext">{{ info.client_stats.revision }}</DIV>
<DIV CLASS="hidden-xs col-sm-4 col-md-3 localetext">{{ info.client_stats.linux_distribution }}</DIV>
<DIV CLASS="hidden-xs col-sm-1 localetext">{{ info.client_stats.python_version }}</DIV>
<DIV CLASS="col-xs-3 col-sm-1 col-md-2 localetext {{ info.last_message_class}}">{{ info.seconds_without_ping | seconds_as_humanized_duration }}</DIV>
</DIV>
{% endfor %}
</DIV>
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ urllib3>=1.26.2
prometheus_client>=0.9.0
humanize>=3.2.0
wtforms>=3.0.0a1 # not directly required, pinned by Snyk to avoid a vulnerability
distro>=1.6.0

0 comments on commit 18e6e88

Please sign in to comment.