How to Monitor Ports and Services with MonitorIX on CentOS6
This article will go over the steps on how to install MonitorIX and configure it to log a custom port, in this case the Minecraft port (25565).
MonitorIX can be used to monitor traffic and system usage to help diagnose problems or simply to view the systems performance.
What is MonitorIX?
Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible. It has been created to be used under production Linux/UNIX servers, but due to its simplicity and small size can be used on embedded devices as well.
What can I monitor with it?
MonitorIX can be used to monitor anything from mail statistics, disk usage, hardware temperatures to current traffic on your MySQL or custom defined port.
Follow the steps below to install MonitorIX on CentOS 6.
1. Required Packages
yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple perl-IO-Socket-SSL
Note: if you are unable to install some packages, you may have to enable to EPEL repo:
32-Bit wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 64-Bit wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm
Then re-try the installation
2. Install MonitorIX
rpm -ivh http://www.monitorix.org/monitorix-3.6.0-1.noarch.rpm
Note: be sure to check the MonitorIX Downloads page to see if there are new versions
After installation, you can start MonitorIX with
service monitorix start
After installation you can view the graphs at http://YOURSERVER.DOMAIN:8080/monitorix/ or http://YOURSERVERIP:8080/monitorix/
Defining Custom Ports to Monitor
By reading through the config, you can change settings such as titles, the port in which MonitorIX runs on, enabling certain graphs under <graph_enable> and so much more.
Here is an example of the <port> section to monitor traffic on the Minecraft port (25565):
PORT graph ----------------------------------------------------------------------------- <port> max = 12 rule = 24000 list = 25, 21, 80, 22, 110, 139, 3306, 53, 25565, 25565 <desc> 25 = SMTP, tcp, in, 0, 1000 21 = FTP, tcp, in, 0, 1000 80 = HTTP, tcp, in, 0, 1000 22 = SSH, tcp, in, 0, 1000 110 = POP3, tcp, in, 0, 1000 139 = NETBIOS, tcp, in, 0, 1000 3306 = MYSQL, tcp, in, 0, 1000 53 = DNS, udp, in, 0, 1000 25565 = MINECRAFT, tcp, in, 0, 1000 </desc> graphs_per_row = 3 </port>
By changing the max and adding/changing a port on the list = section you can add a new graph to the <desc> section. Make sure you close the document with CTRL+X and then Y to save, followed by ENTER.
Now you can restart the service
service monitorix restart
and view your newly monitored port.