It features an easy way to monitor daily, weekly, monthly and yearly periods.
- System load
- Kernel usage
- Filesystem usage
- Disk I/O
- Network (global and per service/port. And I want to emphasize that - per service and per port - very cool)
- and a bunch more which I turned off :)
Every graph in there is clickable and gives you a bigger picture of one of your interest.
Why Monitorix is so cool?
Monirorix is cool because:
- It's free and opensource. I (personally) don't care much about the later, but some of us like that
- Once installed, it can be accessed from any web browser. I monitor my server even from phone.
- It's lightweight
- It doesn't require a web server and can be configured either to use a web-server or to run in a stand-alone mode
- It shows the information in graphs which are configurable and easy to read
- It can be configured to fire alarms on certain conditions (i.e. I use an alarm to send me an email once the System Load is above 75% for the last 15 minutes. The second alarm I use is when the free space on / reaches 75%)
- It has a built-in Basic Access Authentication which is a very handy to have if combined with the access from the Internet
- It can automatically send email reports (daily, weekly, monthly, early) with all the graphs in there
How does Monitorix work?
Monitorix is a bunch of Perl scripts. It can be installed either from the official web site or as a package on many modern Linux/Unix distributions.
It reads data from various places and saves it in database files. It reads frequently enough, though. And writes database files frequently enough as well. So, that's not good to keep on running on a hard drive or SSD all the time. The later wears off and the former is too slow to operate fast.
Here is the good news:
Monitorix causes too much of Disk I/O - I wanna optimize it
Anything-sync-daemon is your best friend there. A good fellow Graysky developed it for us and published on his GitHub page. Read up the documentation on Arch wiki - it is pretty straight forward. Few words - it works by pushing a desired directory into tmpfs, which is essentially, your RAM. That really sky rockets your Monitorix. It works orders of magnitude faster. And don't worry, your data survives reboots. When the daemon starts it copies a directory into the RAM and when it stops, it transfers the data back to the drive.
Too much RAM is consumed, I wanna optimize that
That is also achievable. Out of the box Monitorix eats more than 40Mb. While it may sound goofy for modern servers, it doesn't sound the same when you want to install it on a BeagelBone or Raspberry Pi like I did. After tuning my installation consumes only 19Mb.
To cut some memory off Monitorix which is never used on purpose back to the system you need to open your monitorix.conf:
# vim /etc/monitorix.conf
- Go to <graph_enable> section and turn everything you don't want to see to "n" state.
- For each of the sections which stood in "y" check man monitorix.conf or the official documentation and see if the section has a list associated with it, i.e. fs is a good example - the smaller the list, the smaller the resulting db file will be. Warning from man:
WARNING: Every time the number of groups in this option changes, Monitorix will resize the fs.rrd file accordingly, removing all historical data.
Alerts are implemented as hooks to shell commands. The end-point can be any, starting from sh, Python and ending wherever your imagination can bring you. Alerts are really easy to use and a good example is shown right here in Automated Email Alerts.