Top CPU and Memory Processes on Linux
Lists the top 10 processes by CPU and by memory. The first output to read on a slow server.
- Windows18
- macOS5
- Linux5
- Network3
- Disk and storage4
- Inventory4
- Security9
- Updates4
- Maintenance4
Script
#!/bin/bash
echo "Top by CPU:"
ps -eo pid,user,comm,%cpu,%mem --sort=-%cpu | head -11
echo
echo "Top by memory:"
ps -eo pid,user,comm,%cpu,%mem --sort=-%mem | head -11Run it on every device with Moftgate
- 01
Add the script
In the Moftgate console, open Scripts > New script and paste the code.
- 02
Select the OS
Select Linux as the target operating system.
- 03
Test it
Run it on one test device first and read the output.
- 04
Roll out
Send it to all targets by group, profile or tag. Each device result is recorded separately.
These may help too
Check Windows Uptime
Shows the last boot time and how many days the device has been on. Devices that do not restart for a long time do not finish patches.
Windows · PowerShellList Startup Programs on Windows
Lists programs that start at sign-in with their command and location. Use it to review slow boots and suspicious persistence.
Windows · PowerShellReset the Print Spooler
Stops the Spooler service, deletes stuck print jobs and starts the service again. Use it for jobs stuck in the queue.
Manage scripts from one console
Target selection, a confirmation step, per-device output and an audit log. The first 200 endpoints are free for a year.