Category Archives: Sysadmin

Cacti: Graphics Galore

One of my objectives for this year is to build a central monitoring and statistical system for our unit. For the statistical part I’ve chosen Cacti.

Last year I’ve already implemented a pilot project using Cacti, which gave me a chance of testing several templates to fit our needs. Unfortunately the machine where I implemented it was rather old (one of the disks died), and was running Debian Sid, so it was kind of broken…

With a new machine available, I now have the service up and running. For now I’m posting a few pretty pictures of the potential of Cacti. In the future I’ll blog about installing and configuring specific templates.

Firstly we have a graphic which analyses the Postfix Log:

Some Apache statistics:

Some MySQL statistics:

Some FlexLM License Statistics:

And, even… Meteorological Statistics:


Upgrade from Debian Lenny to Squeezy

Now that Debian Squeezy has officially been released, here’s how to upgrade from Lenny to Squeeze (at least how I’m doing it):

  1. Edit you /etc/apt/sources.list and replace the lenny entries with squeeze
  2. Run aptitude update
  3. Run aptitude install apt dpkg aptitude
  4. Run aptitude safe-upgrade
  5. Run aptitude full-upgrade
  6. After rebooting and checking the grub chainload into grub2 was successfull, run upgrade-from-grub-legacy

The only problem I’ve encountered was with the MySQL Server upgrade from 5.0 to 5.1, it just simply fails. But I’ve upgraded a machine two weeks ago, so I don’t know if the problem has been resolved.

Centralized Apache Logs with Syslogd

One of the projects I have for this year is the centralization of all Apache logs we have scattered across all our machines.

I know this kind of guide has been done before, but here’s my implementation for our systems.

  1. Install rsyslogd: apt-get install rsyslog. Some older machines we had were still using the older sysklogd, but form what I’ve gathered, it doesn’t support UDP transmission of the logs, so I didn’t fit me.
  2. Add the following rules to /etc/rsyslogd.conf:
    local1.crit @destination-host @destination-host
  3. Restart rsyslogd: /etc/init.d/rsyslog restart
  4. Edit your apache settings to add the new log rules (normally /etc/apache2/sites-enabled/000-default):
    ErrorLog syslog:local1
    CustomLog “|/usr/bin/logger -p” combined
  5. Restart apache: /etc/init.d/apache2 restart
  6. On the central machine add the following rules to syslog (this part is actually recycled from a Nuno Dantas implementation of the central logs for postfix):
    source s_remote { udp(); };
    destination d_clients { file(“/destination-path/$HOST”); };
    log { source(s_remote); destination(d_clients); };
  7. Restart syslog. You should now have the apache logs coming…

After this, I implemented a AWStats central instance which parses all those nifty logs.