Maintaining server uptime is an absolute necessity in pretty much every environment in our modern life, and server monitoring solutions serve that specific purpose. Server monitoring systems keep tabs on where you're server's at, where it's running into bottlenecks or other issues, helps maintain backups and reserve copies. A good server monitoring platform is really like a tool chest; a collection of things that seem small on their own, but they work together to both secure your server and allow you to react in critical situations.
Generally, the current crop of Linux server monitoring solutions can be separated into 3 catergories:
- System monitoring (*top, vmstat, dstat, iostat, nmon, lsof, netstat)
- Network monitoring (Nagios, Zabbix, Icinga, Munin, Cacti, Monit, RRDtool, OpenMS, MRTG, Netdata, Shinken, Ganglia)
- Cloud systems monitoring (New Relic, AWS CloudWatch, AppDynamics, Scout, Optier, Pingdom, PagerDuty, Datadog, HostTracker)
Normally all of these tools are launched manually by the systems administrator, to check the system's status at that given time, and we'll be going over the utilities in these groups over the course of a few days starting with:
These tools are mostly console utilities to monitor current system status, and usually can't be set up to run automatically or log activity. Utilities like atop, top, htop will return a list of processes and information about them like their load average and system resource usage, and allows you to sort the list by those attributes. Some of these utilites are more feature heavy than others. Atop can actually log its output, allowing a systems admin to go over it later. Htop has a user friendly UI, even letting you use a mouse in console. Iotop tracks disk usage, while iftop can monitor network traffic. Apachetop and mytop specifically monitor, in real time, database operations for Apache and MySQL respectively.
The "stat" utilities, vmstat, dstat, and iostat, are similar, functionally, to "top" utilites but don't generate a list. Instead they're used to look at surface level resource usage to analyze the system under load.
Nmon is a very broad utility, allowing you to get a list of running processes, disk, cpu and ram usage and get access to graphs that are easy to flip through with its relatively intuitive interface.
Netstat and lsof are next on our list, and they're mainly used to monitor the status of network connections. Between the two, lsof has a lot more functionality. Besides listing current connections, it could also list the running processes or files using those connections. While netstat is still used today, due to it's simplicity (which is why we're mentioning it), it's also relatively obsolete especially in comparison to lsof. Usually, network monitors like this are used for remote server monitoring and they allow you to keep track of nearly the entire server, whether it's access to hosts using ICMP or monitoring the status of RAID arrays.
We've covered common tools used for system monitoring in this article, but there's more coming up. Next article will drop in a few days, and you can be notified immediately when it happens if you follow us on Facebook and Twitter!
-Until next time!