pm2-server-monit is a PM2 module designed to automatically monitor crucial server vital signs, integrating seamlessly into the PM2 ecosystem for process management. It tracks key metrics such as CPU average usage, free and used memory, drive space, network speed (input/output), total opened files, running processes, and active TTY/SSH sessions. The current stable version is 3.0.0. While no explicit release cadence is documented, the jump from v2.0 to v3.0 suggests periodic updates incorporating significant feature enhancements or internal changes. Its primary differentiator is its deep integration with PM2, allowing server monitoring to be managed and viewed alongside application processes, making it particularly useful for environments already leveraging PM2 for their Node.js applications. Unlike standalone monitoring agents, pm2-server-monit leverages the PM2 daemon to collect and report system statistics.
npm install pm2-server-monitVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install the pm2-server-monit module, configure its monitoring parameters, and check its operational logs via the PM2 command-line interface.
Review the module's documentation for updated configuration options related to drive and network monitoring. Verify metrics post-upgrade using `pm2 logs pm2-server-monit`.
Increase `disk_refresh_rate`, `memory_refresh_rate`, `cpu_refresh_rate`, and `network_refresh_rate` values to higher intervals (in seconds) to reduce the monitoring overhead. For example, `pm2 set pm2-server-monit:cpu_refresh_rate 10`.
Always check the module's logs using `pm2 logs pm2-server-monit` for specific error messages or warnings that might indicate unsupported features or underlying issues on your operating system.
Increase the refresh rate configuration values for `disk_refresh_rate`, `memory_refresh_rate`, `cpu_refresh_rate`, and `network_refresh_rate` using `pm2 set` commands.
Check the module's logs using `pm2 logs pm2-server-monit` for specific error messages or warnings related to the missing metrics to diagnose platform support or runtime issues.
Ensure PM2 is installed globally (`npm install -g pm2`) and then retry `pm2 install pm2-server-monit`. Check network connectivity and user permissions if the issue persists.