npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sysmon-linux

v1.0.0

Published

A real-time Linux system monitoring tool with high CPU process detection

Readme

sysmon - Linux System Monitor

A real-time Linux system monitoring tool that displays CPU, memory, processes, and uptime information in a clean, colorful interface.

Features

🖥️ Real-time System Monitoring

  • ⏱️ System uptime and load average
  • 💻 CPU usage percentage (accurate calculation)
  • 📊 Process count with high CPU process detection (≥90%)
  • 💾 Memory usage with color-coded alerts
  • 🎨 Color-coded display based on resource usage levels

🔍 High CPU Process Detection

  • Shows detailed information about processes using ≥90% CPU
  • Displays process name, PID, and exact CPU percentage
  • Helps quickly identify resource-hungry applications

Performance Optimized

  • Uses /proc filesystem for fast data collection
  • No external dependencies beyond standard Python libraries
  • Lightweight and efficient

Installation

Quick Start

  1. Clone or download the script:
cd /home/nmsglobal/DEVEL/CHATGPT5_PLAN/sysmon
chmod +x sysmon.py
  1. Run directly:
./sysmon.py

System-wide Installation

sudo cp sysmon.py /usr/local/bin/sysmon
sudo chmod +x /usr/local/bin/sysmon

Usage

Basic Usage

# Default: updates every 60 seconds
sysmon

# Custom interval (e.g., 5 seconds)
sysmon -i 5

# Single display and exit
sysmon --once

# No color output
sysmon -n

Command Line Options

| Option | Description | Default | |--------|-------------|---------| | -i, --interval | Update interval in seconds | 60 | | -n, --no-color | Disable colored output | False | | --once | Display once and exit | False | | -v, --version | Show version information | - | | -h, --help | Show help message | - |

Examples

Monitor with 10-second updates

sysmon -i 10

Quick system check

sysmon --once

Continuous monitoring without colors (for logs)

sysmon -n -i 30 > system_monitor.log

Output Example

==================================================
    LINUX SYSTEM MONITOR
==================================================
Last Update: 2024-01-19 15:30:45
--------------------------------------------------
⏱  Uptime: 5d 3h 45m
📈 Load Average: 1.25 1.18 1.05
💻 CPU: 75.5% (4 cores)
📊 Processes: 245 total, 2 high CPU (≥90%)
   └─ stress-ng (PID 12345, 95.2% CPU)
   └─ python3 (PID 12346, 92.1% CPU)
💾 Memory: 4096MB / 8192MB (50.0%)
--------------------------------------------------
Refresh interval: 60s | Press Ctrl+C to exit

System Requirements

  • OS: Linux (tested on Ubuntu, Debian, CentOS)
  • Python: 3.6 or higher
  • Permissions: Read access to /proc filesystem

How It Works

The tool reads system information directly from the Linux /proc filesystem and uses system commands:

  • /proc/uptime - System uptime
  • /proc/loadavg - Load average information
  • /proc/stat - CPU usage calculation
  • /proc/meminfo - Memory statistics
  • ps aux - Real-time process CPU usage for high CPU detection (≥90%)

Color Coding

Memory usage is color-coded for quick status assessment:

  • 🟢 Green: < 60% usage (healthy)
  • 🟡 Yellow: 60-80% usage (moderate)
  • 🔴 Red: > 80% usage (high)

Troubleshooting

Permission Denied

If you encounter permission errors, ensure you have read access to /proc:

ls -la /proc/uptime

No Color in Terminal

Some terminals may not support ANSI color codes. Use the -n flag to disable colors.

High CPU Usage

If monitoring at very short intervals (< 5 seconds), consider increasing the interval to reduce system load.

Development

Running Tests

python3 -m unittest test_sysmon.py

Contributing

Feel free to submit issues or pull requests for improvements.

License

MIT License - Feel free to use and modify as needed.

Author

System Monitor CLI Tool - Created as part of Linux system administration toolkit.

Version

1.0.0 - Initial release with core monitoring features