Telescribe is standalone application that helps remotely monitor client machines.
This project is currently in the pre-beta stage. There is no backward compatibility guarantee for the pre-beta stage; the versions of the beta and stable stage highly likely will not be compatible with the pre-beta versions.
The development will be mainly done in the develop
branch and only the successful and major commits will make it to the main
branch.
The build process requires the following:
- npm
- go
- https://github.com/hjjg200/go-act
- https://github.com/hjjg200/go-together
- https://github.com/hjjg200/go-jsoncfg
The install procedure is as follows:
- Run
build.sh
which will produce necessary things inbin
directory. - In the bin folder, do
./telescribe -server
to create config files. - Exit the app and modify the configuration to your taste.
- Distribute the binary file,
telescribe
, to client machines. - You can start the application on your client machines by:
./telescribe -host <IP_ADDRESS/DOMAIN> \
-alias <ALIAS_NAME|DEFAULT:default> \
-port <TARGET_PORT|DEFAULT:1226>
Post-installation process:
- You can simply edit the config files on the server machine in order to make changes to the configuration.
I started this personal project to learn about servers, monitoring, secure protocol, and web framework. These are the notes I personally made during the entire development process.
Hybrid encryption is currently deprecated.
- Every packet was encrypted using AES 256 GCM with a new key, and that key was encrypted using RSA public keys.
- This was done because of the content size limit of RSA encryption.
- A new master secret for each session was created at the handshake process using ECC P256.
- The master secret, then, was used for AES 256 GCM encryption.
- Every packet includes a nonce and AES-encrypted data.
In the early stage, no web framework was used.
Vue.js was chosen as the web framework to go due to its simplicity.
- SFCs were used for legibility and better structure.
Because of its pro-SVG features, Chartist.js was used to plot graphs for data.
As the data amount increased Chartist.js could not keep up with its performance, so D3.jss came in.
- Lower level APIs for graph plotting
- Better performance at high data count
Package gob was used to encode and store monitored data files.
As gob encoding took too much time to encode and decode data files, just simple binary format was used to encode and decode files.
Data are transmitted via web API in csv format which D3.js can understand.
- Largest Triangle Three Buckets was used to decimate data, in order to decrease the size and stress for the web user interface.
- The problem was that the more were the data, the more abstract became the graph.
- Aggregation was the chosen method for reducing the performance stress.
- Also, the graph web component was modified to only fetch the visible part of data; previously, the web UI fetched the entire data when plotting.
- Parsed raw
df
output to monitor device size and device usage. - Used
-kP
flags in order to get consistent outputs fromdf
across distributions.
- In the
df
source code, I found it usesstatvfs
for device information - Used
cgo
to use the function directly
Telescribe is a standalone app that can act either as a server or a client, which is used for monitoring machines. When it acts as a client, it monitors the machine that it is on and sends the data to its designated server. And for the configuration of each client is all stored in the server and is given to each client at handshake, client machines have to have nothing but the executable file.
And when it acts as a server, it handles connections from telescribe clients and general http clients, handling both connections on the same port. When you use a browser to connect, you'll see graphs and status of the monitored clients.
Telescribe is designed in such a way that the only thing you have to worry about is the machine that acts as a server; client configurations can be modified on the server and they are to be delivered and applied along with the very next packet; when an update was made to the server executable and the version does not match with that of a client, the server will give the client its executable and the client will update itself and restart. And in order to prevent any MITM attack that may coorupt the configuration or the executable file, the server has its private key to sign the data. Clients, therefore, have its known hosts list that contain the public key fingerprints of the servers they have identified and thus consider authentic.
The exterior-wise design is mainly done on the following Figma document:
https://www.figma.com/file/jVXjr7BLJLdOHWe2TSPuZW/Telescribe
Note that, however, the above document is not a faithful representation of the web design; rather, it must be taken as a prototype for it.
- Project requirements satisfied
- Maintainable
- Scalable
- Well-documented
- Support for non-procfs systems
- IPv6 support
Config validators- Custom executables in client configs, which are sent from the server to clients' machines for custom metrics
- Web anchors(#) or queries for fullName, timestamp, and selected items
- Client config mixins
- Realtime graph updating using WebSockets
- Cache recently viewed data aggregates
Data aggregatesDeprecate gob encoding and fully implement byte-level encoding- Proper HTTPS support
- Protocol documentation
- Monitor documentation
- Compatibility test for Debian, CentOS(Red Hat), Fedora, Ubuntu, and Mint Linux using LightSail
Better handling of responses and requestsElliptic curve encryptionHost-to-alias-and-role instead of current host-to-role to prevent redundant configsVue.jsAllow multi clients from same host with host-to-alias-and-role mapCombining all the data into one single graph and letting users to select which data to viewVibrant colors for graph legendFix auto update procedureRun client as daemon and spawn sub process so as to auto update would not terminate the appI/O monitoringDisk monitoringNetwork monitoringD3.jsDetect config change in server and notify the clientRESTful webhook for fatal status of clientsAllow users to select time frame of the shown data in web pageMake another div for tooltipProper handling of mouse events for mobile devicesWindow resize event handlerRestore the scrollLeft and the hand location when changing durationJS overhaulShorten monitor keysCompact viewBig data to csv rather than jsonApp.vue implementationIntuitive type namesRoles as tags: "bar": "minecraft-server cpu memory"Various http users with different permissionsPrevent the server from being shutdown when it is flushing caches: use go-together and signal waitingWeb: Custom number formatLog files like latest.log, 20191210.1.log.gz...Log file separation: access, eventsI/O wait monitoringPer-process monitoring
- Vue.js
- D3.js
- Moment.js