A simple process monitor/logger built with python and psutil.
- Rename
settings.default.json
tosettings.json
. - Add your settings.
- Run
python pymemorymon.py
{
"update_rate": 1, // Check process state every 1 second.
// Global settings
"CREATE": true, // Monitor creation of process
"END": true, // Monitor end of process
"MEMORY": 10, // Monitor when memory usage is over 10%
"CPU": 50, // Monitor when CPU usage is over 50%. Note that this value
// could be over 100 if you have multi core cpu.
"ignore_pids": [0, 4], // Ignore "System", "System Idle Process" processes.
"ignore_names": [],
// Highlight color
"color": {
"END": "\u001b[1;37;41m",
"MEMORY": "\u001b[1;37;44m",
"CREATE": "\u001b[1;37;43m",
"CPU": "\u001b[1;37;42m"
},
// Settings by process name
"processes": {
"firefox.exe": {
"MEMORY": 20
},
"dllhost.exe": {
"CREATE": false,
"END": false
},
// Support wildcards. It use `fnmatch` to match process name
"flash_player_*" {
"CPU": 100
}
}
}
psutil
might be retricted to get process info if the process was created by different user.- Seems that it's possible to get process name after psutil 3.0: giampaolo/psutil#599
Use cmdline if process doesn't have name.