IMPORTANT UPDATE: 03/09/2020:
NodeQuery went down. The project was functional but unmaintained for seemingly a very long time. Today, it went offline – and the SSL cert expired. It is probably a good idea to use an alternative (ex: HetrixTools) and to delete the agent by running the following:
rm -R /etc/nodequery && (crontab -u nodequery -l | grep -v "/etc/nodequery/nq-agent.sh") | crontab -u nodequery - && userdel nodequery
Rest of the article (old):
Why you’d want this:
If you’re like me and can’t stop buying virtual private servers that you probably don’t need for dirt cheap (LowEndBox!)… then you probably want to keep an eye on them.
Many of the low-end VPS providers oversell, especially if you opt for an OVZ plan instead of a KVM plan. I won’t get into detail about what these mean in this post, but trust me. If you have an OVZ VPS, and it cost you less than 20$ a year… it’s probably oversold.
This means that the server will most likely have a terrible performance, and might go down frequently. Worst case scenario? The company deadpools. That usually means: we’re gone, your servers are gone, and your data is gone without prior notice 🙂 .
Monitoring your servers with a solution like NodeQuery can quickly alert you if something isn’t right, bad connectivity, excessive load, or any error along the way. It’s also free, so why not?
OK, how do I get it then?
This is relatively easy. The requirements are:
- A VPS with (preferably) Ubuntu or a Debian based system.
- SSH access to the server (with root privileges).
- An email address.
- 5 (?) minutes.
Let’s get started![ifpaid 1 USD]
Step 1: Create a NodeQuery account:
You’ll need your email address for this step. Head to the signup page and create a NodeQuery account.
You may be asked to complete a captcha, and then you will be asked to verify your email. Do this and then proceed.
Now you can log in, so click the login button and fill the details you signed up with. You will be presented with a dashboard.
Step 2: Create a New Server:
Click the “New Server” button in the top right of the page. You will be presented with the following form:
The only field you’d want to alter for now is the “Name” field. Insert any name you would recognize for this particular server. It doesn’t have to be anything meaningful. The default values for alerts and resource usage are reasonable, so only alter them if you need to.
You will now be presented with a code snippet that you can copy. You will want to run this through an SSH terminal on your VPS with root permissions. This will install the monitoring agent and create an account that handles it. The whole setup is automated, so you only need to run the code and no further interaction is required.
After running the command, click “I’ve installed the agent, continue to server details.”
Step 3: Wait for initial data synchronization:
You will now be presented to an empty screen similar to the one below, this will take a few minutes to populate and establish a connection with your server.
After a few minutes, data will be collected and the connection will be established. You will now have to access to a wealth of information about your server. Load monitoring, RAM usage, Disk usage, Network usage, and even network latency. You can also quickly monitor processes and determine what is taking the most resources (similar to the top command).
That’s it! You will now receive email notifications whenever anything goes wrong, and you’ll be able to quickly monitor and manage your VPS from NodeQuery. This is especially helpful if you have multiples VPSs that you are not necessarily able to monitor individually easily.
One last thing…
If for whatever reason you decide to remove NodeQuery, the following link has a simple command you can run that will reverse the process by erasing the agent and the nodequery account from your server.
I hope you enjoyed the quick tutorial. I’ll be writing about HetrixTools, UptimeRobot, and other services that proved to be quite helpful to me when it comes to server monitoring and management, so expect those in the near future.
If you encounter any issues or have any questions, feel free to comment and I’ll try my best to reply.