sys_alert banner

sys_alert

5 devlogs
8h 33m 50s

A low-level, Server error alert in linux.
While it detected any error of server, it sends message to user with linux socket

This project uses AI

I used ChatGPT to translate the Chinese REAMDE.md content into English. It also help me for debugging (typo or some easy stuffs).

Demo Repository

Loading README...

yangtw0612

Now, it can display some information on the Home page when CPUs usage or memory usage is too high.

I putted those function in util.c

I encountered a strange issue:
Even when multiple CPUs were under high load, the output looked like:
CPU11
CPU11
CPU11
Eventually, I found the problem:
→ I used the wrong index when writing into the error array, causing repeated overwrites.

I also test this project using stress and stress-ng.

Attachment
0
yangtw0612

Today I implemented a simple TUI (text-based user interface) using termios.

During development, I needed to avoid blocking the main loop, so I couldn’t directly use functions like getchar() for input. Instead, I used read() along with fcntl to enable non-blocking input handling.

I also refactored the CPU usage calculation function. Previously, I had sleep(1) inside the function, which caused the UI to feel unresponsive. I moved the sleep call into the main loop to improve responsiveness and overall control of the update cycle.

Now the program supports switching between different views using keys 1, 2, 3, and 4.

In the future, I plan to integrate ncurses to build a more advanced and user-friendly interface.

Attachment
Attachment
Attachment
Attachment
0
yangtw0612

Today, I implemented memory and process monitoring in my sys_alert tool.

I parsed system information from /proc and stored important data in structs for better organization and future extensibility. I then displayed key metrics to observe system behavior.

During this process, I learned what these system metrics actually mean and identified which data is critical for detecting abnormal conditions or potential system errors.

This work improves the foundation of the monitoring system and prepares for future alerting features.

Attachment
0
yangtw0612

Shipped this project!

Hours: 1.4
Cookies: 🍪 7
Multiplier: 4.68 cookies/hr

I built sys_alert, a Linux system monitoring tool written in C.

Currently, it monitors CPU usage for each core by reading data from /proc/stat and displays it in real time.

The most challenging part for me was parsing strings in C and handling the raw data correctly.

Next, I plan to add memory tracking and a process viewer.

yangtw0612

Worked on sys_alert today.

  • Implemented CPU usage monitoring
  • Parsed /proc/stat
  • Fixed calculation bugs

Next: improve UI and add process viewer

Attachment
0