Archive for the ‘linux’ Category

Cacti on CentOS4 Quick Howto

October 6, 2006

Hi,

I’ve been asked to write my How-To on the CentOS Wiki. I don’t want to have to manage 2 versions, so here is the link.

Sorry for the inconvenience…

Wget

October 5, 2006

Ah, I do feel good when I solve a complex problem with a simple tool. wget. This time, I wanted to take a backup of the database I have hosted somewhere. The only way to get these databases’ backup files is to go the control panel of my hoster, cpanel. Usually, then I think about that, it is too late (as these files are the current databases, so if I just screwed something, these files are useless)

I then remembered that wget can send authentication, so I basically use wget in a cronjob that downloads the database files and put them in a folder named after the current day’s name. This way, I have 7 days of backup history. I like that :) .

Virtual Private Servers Pitfalls

September 2, 2006

It didn’t take much time until I found pitfalls with VPSs. Today, I got bit by memory problem. My VPS had 128 MB RAM max. Before installing my usual packages, the memory usage was around 20 MB. Nothing! :) . But then I installed my packages, forgot to tweak apache to minimize memory requirement. Installed mysql for cacti, configured cacti…

Then, this morning, I realize that many processes were missing on my VPS. Why? I had enabled the yum daily cronjob…. mistake! Do you have an idea of how much memory yum uses? Too much.

Tektonic told me that they stopped selling UM0 packages because of that: too many clients having memory problems. I upgraded my plans to UM1. I’m wondering though… how does Vpslink do with the smallest plan, only 64 MB RAM!

I can’t end this post without adding again how much helpful the folks at Tektonic have been up to now.

Virtual Private Servers

September 2, 2006

Hi,

Time for another knowledge-sharing post.

I recently discovered a very good alternative to shared, reseller, or dedicated hosting: A virtual private server (VPS).

In fact, a VPS is a virtual machine running, with many other virtual machines (VM). There are many packages, but the cheapest are:

Tektonic (Based on Virtuozzo. I own 3 VPS from them. Very, very nice and responsive people. They’ve been very supportive for me in my beginnings with VPSs.
OpenHosting (Based on linux Vserver, fedora core 4 only for now, interesting utility billing system)
Vpslink (Based on OpenVZ, the open-source version of Virtuozzo, never tried yet)

Tektonic puts limit on outbound bandwidth that can be sometimes harsh. (Unmetered 1 mbps max for the smallest plan (15$/month)). That is more interesting for applications that don’t need much outbound traffic (like remote backup, you have an unmetered 100mbps!) or e-mail, which don’t really need an instant transfer, but can be problematic for web hosting. Vpslink, on the other hand, use total monthly transfer and offert gigabit connexions on all their packages. Their restriction is more on RAM (64 MB only on the smallest plan). Can it even run yum or up2date???

Both Tektinic and Vpslink offer control panels, but Vpslink might be better because all the plans are using the monthly traffic method to restrict bandwidth. The most expensive unmanaged plan at Tektonic (100$month) only allows 4 mbps outbound.

Vpslink offer for unmanaged virtual private server for web hosting is the one that makes the most sense, IMHO. However, there may be some features lacking compared to Tektonic, since they use OpenVZ. For example, is there an iptables firewall available? In Virtuozzo, it is configurable via the control panel. In OpenVZ?

  • 40$/month
  • 20 GB HDD spac
  • 500GB monthly traffic
  • 3 IP addresses
  • 512 MB RAM
  • 5$/month for the ServerCP control panel
  • 10$/month for DirectAdmin control panel

To learn linux, or for test servers, Tektonic is really the best solution…

Tektonic offers managed VPS, if you need more features. Vpslink does that through its parent company, Spy. User Mode Linux is another technology, used by BlackNightSolutions. Nice Irish folks…

If you need to host 3-4 domains or more and would like to have a control panel, I recommend looking at a Tektonic and Vpslink. Openhosting doesn’t offer a control panel. Only webmin is available, and virtualmin is not “officially” supported. Openhosting is also more expensive, but a lot less restricted in hardware resource.

The choice is yours!

As usual, comments welcome!

Nagios

August 8, 2006

I just started playing with Nagios, an open-source monitoring software package (GPL). I used to use monit instead, but there are two limitations of monit that made me switch:

  • It can only do port/protocol checks on remote hosts
  • It has no tolerance setting for check failures (it sends a warning as soon as there is one failure)

On the other hand, Nagios has tools that allows a Nagios server to perform “local” checks on remote servers, via the network (check_snmp, check_nt, check_nrpe and check_ssh). It has as side effect that it can monitor Windows servers quite well. The web interface enough for my needs.

Note: I’m still using monit for process checks, as Nagios can’t do that as well as monit does (monit uses the information in the lockfile to see if the process is still in memory, and uses user-defined commands to restart the process if it is not in memory).

Here is how Nagios works, basically:

  • The tools that do the checks are called plugins
  • Objects have to be defined (timeperiods,hosts, contacts, services, commands), and group of objects can be created.
  • It uses smart checking algorithms so that your server doesn’t do 1000 checks at 13:48 and 3 checks at 13:56
  • It can do a command in some situations (restart apache, for example)

Nagios has also other very nice features… Here is how I configured my server:

  • It does several port/protocol checks on remote servers
  • It uses nrpe (check_nrpe) to perform “local” checks on remote servers
  • When a check fails 4 times, it sends a notification (email)
  • When it notified 3 times and the problem is still not solved or acknowledged, it escalates the notifications (sends to my cell as well).
  • For some servers, I allow nagios to wake me up. For some others, they can only send messages to my cell between 7:30 and 22:00 (using timeperiods)

Nagios’ configuration is a lot less painful than I thought. To make it easier, I created one file for each organization for which I monitor servers for.

Future plans: Failover

Using nsca, it is possible to have a Nagios server “standby”, that would detect if the “master” Nagios server is down, and perform the checks and notifications during this downeime. nsca allows this “standby” server to have all information about previous checks.

BTW, I used the rpm packages from Dag Wieers, and they work fine with my CentOS 4 system. I tried installing nagios on a Fedora Core 4 machine, but the rpm packages for nagios in Fedora-extras are confusing…