Archive for 'Administration' Category

How to email the output of a cronjob to different addresses

By jbayer - Last updated: Thursday, May 10, 2012

Cron is a wonderful tool on a Linux/Unix box.  Normally, when a job runs and some output is generated, it is emailed to the owner of the job.  You can alter this by added the following line to the crontab file: However, if you have a number of jobs which are run by a […]


Perl script to add/remove Maintenance

By jbayer - Last updated: Tuesday, May 1, 2012

I found a perl script to add/remove a single host to maintenance in Zabbix.  I needed more, the ability to add multiple hosts to a single maintenance, as well as an entire group. The script I started with can be found at: The attached file is my modified version.  The changes I made are: […]



By jbayer - Last updated: Tuesday, April 10, 2012

We’ve been using etckeeper lately to back up our /etc directories with a version control system..  I was dissatisfied with it because it was only designed to backup /etc or a specific directory.  It did not have the capability to backup multiple directories, such as /etc, /usr/local/etc, /var/bind I’ve been corresponding with the author, Joey […]


Installing the new Zabbix 2.0.0rc2

By jbayer - Last updated: Tuesday, April 10, 2012

I’ve taken my script for an automatic installation of Zabbix and modified it to install the 2.0.0rc2. It is designed to work with any RHEL5+, CentOS 5+, Scientific Linux 5+ or higher systems. It is best to start with a minimal install. It will download and install all necessary packages. I’ve developed a directory structure […]


Installing Zabbix on Redhat/CentOS – v. 1.5

By jbayer - Last updated: Monday, April 9, 2012

Another update.  Changes below. Updated Zabbix version to 1.8.11 Added install of php-xml and php-xmlrpc, needed for template import Added better Apache config, inspired by Updated URL for epel repo Make default mysql conf file my-large.conf Added option to use Percona server Modified zabbix_agentd.conf to include files from zabbix_agentd.d Changed locations of log files, […]


Yum and RPM install history

By jbayer - Last updated: Friday, March 30, 2012

Sometimes I need to find out when something was installed.  The following two commands will show the history for yum and rpm, respectively To get a history of all the yum installs, look at: /var/log/yum.log   Rpm package installation history If you need when the packages installed in Red Hat or Fedora rpm -qa –queryformat […]


Installing latest virt-manager on RHEL6/CentOS6

By jbayer - Last updated: Monday, March 5, 2012

The virt-manager which comes with RHEL6/CentOS6 is somewhat old, being version 0.8.6, which was released on 1/14/2011.  The attached script will take a basic system and download/install all necessary RPMs, and then download and install the latest virt-manager, version 0.9.1 released 1/31/2012 There are a lot of nice improvements which make this a very worthwhile […]


Using Partitioning on Zabbix DB tables to improve performance

By jbayer - Last updated: Monday, March 5, 2012

This script will partition your zabbix database to improve the efficiency. It will also create stored procedures to do the necessary housekeeping, and create a cronjob to do this on a daily basis. This script was inspired by the following: While the basic SQL is from the above page, this script both creates the necessary SQL for the […]


Adding a bridge interface to Linux

By jbayer - Last updated: Thursday, March 1, 2012

A bridge is a way to connect two Ethernet segments together in a protocol independent way. Packets are forwarded based on Ethernet address, rather than IP address (like a router). Since forwarding is done at Layer 2, all protocols can go transparently through a bridge. Among other reasons, if you are running KVM or Xen, and you […]


Install latest virt-manager on RHEL6+, CentOS6+, SL6+

By jbayer - Last updated: Monday, February 27, 2012

RedHat ships an old version of virt-manager on RHEL 6.  This script will install the latest version of virt-manager and virtinst onto a clean RHEL 6 (or CentOS, SL, etc) system. Just download it and run as root.