As we know that we can run Moodle on any traditional system running windows or any flavor of Linux. But the question arise how do you monitor the health of the server hosting Moodle. As a Moodle hosting providing company we have to consider the monitoring a vital aspect of the solution and service we are providing to our customer. So, how we are monitoring the Moodle hosting server? The answer is like any other windows and Linux server. I will share some of the key aspects you have to monitor using nagios as a monitoring system.
Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better. Nagios offers complete monitoring and alerting for servers, switches, applications, and services.
There are plenty of ways you can monitor a server using nagios for example through ssh, nrpe or snmp. In this blog post I will be explaining monitoring parameters of an Ubuntu server running Moodle. Following are the parameters we will be monitoring in Ubuntu server:-
- Disk usage (Depends upon the kind of content uploaded and the disk available)
- Web server (in our case it is Apache)
- APT Updates ( To get the critical updates)
- CPU Load
- Memory (Very important because Moodle is memory intensive sometime take more than 50mb per user as mentioned by Moodle and observer depend upon the kind of operation)
- MySQL Server
- Ping (Connectivity)
- Swap File usage
- Total Process
- Users (For Security)
How to’s
- Install nrpe agent on Ubuntu server.
- Add a firewall rule to access the port 5666 from the remote Nagios server.
- Edit the file /etc/nagios/nrpe.d/agent.cfg and add the following 2 lines
- dont_blame_nrpe=1
- allowed_hosts=ip address of your nagios server (192.168.1.1)
- This will allow the Nagios server to probe Moodle server through nrpe.
- Also check the plugins available under /usr/lib/nagios/plugins and copy any custom Plugin you want to incorporate along with it.
- List of plugins required for monitoring the above parameters are:
-
-
- check_disk
- check_httpd
- check_apt
- check_load
- check_memory
- check_mysql
- check_ping
- check_swap
- check_procs
- check_users
- Start the service /etc/init.d/nagios-nrpe-server start
- Now check the status of the services from the nagios server.
- You will get some of the graphs like below.
-
-
- Also you can have escalation in case of any parameter failure through email or sms. Hope this post help you; please feel free to ask questions so that I will try to compose something more useful.