Zabbix backup script without history data

Here is simple backup script for Zabbix 2 configuration data (hosts, items, templates etc). It will not backup history/event/trend data, so backup file is relatively small.

Just replace ZBX_DB and ZBX_USER with Zabbix database name and username.

mysqldump -u ZBX_USER -p ZBX_DB \
	--ignore-table=ZBX_DB.acknowledges \
	--ignore-table=ZBX_DB.alerts \
	--ignore-table=ZBX_DB.auditlog \
	--ignore-table=ZBX_DB.auditlog_details \
	--ignore-table=ZBX_DB.escalations \
	--ignore-table=ZBX_DB.events \
	--ignore-table=ZBX_DB.history \
	--ignore-table=ZBX_DB.history_log \
	--ignore-table=ZBX_DB.history_str \
	--ignore-table=ZBX_DB.history_str_sync \
	--ignore-table=ZBX_DB.history_sync \
	--ignore-table=ZBX_DB.history_text \
	--ignore-table=ZBX_DB.history_uint \
	--ignore-table=ZBX_DB.history_uint_sync \
	--ignore-table=ZBX_DB.trends \
	--ignore-table=ZBX_DB.trends_uint \
	| gzip > zbx_db.sql.gz

PHP exec system calls not working in Debian 6

After migrating Current website to Debian 6, PHP calls exec and system stopped working.
The reason for it is debian package dash which modifies behaviour of system default shell:

# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Dec  9 20:25 /bin/sh -> dash

To revert this this behaviour to standard, execute

# dpkg-reconfigure dash

dash dpkg-reconfigure debian linux

Select “No” and default shell will be changed to standard bash.

You can check it with following command:

# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Dec  9 20:26 /bin/sh -> bash

BackTrack Remove disks or other media

After creating a bootable USB image for BackTrack 5 R3 with Unetbootin you may encounter an error:

Remove disks or other media
Press any key to restart

This means you have incorrect image on USB drive.

Simple solution is to use a different ISO to USB utility:

You can download it from following URL:
http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/

Ansible No Package matching found available installed or updated

When trying to manage packages with yum module via Ansible, on fresh installed RHEL / Centos Linux systems, you may face following error:

msg: No Package matching 'sendmail-cf' found available, installed or updated

This is caused by missing package yum-utils.

It can be installed with Ansible raw module (also used for installing python-simplejson for Ansible):

ansible 1.2.3.4 -m raw -a "yum -y install yum-utils" --user=userx --sudo

Bootable FreeDOS Live image for BIOS upgrade

Download Link: http://pingtool.org/downloads/fd11src_live.iso

I was struggling with BIOS upgrades for our new Dell servers, as Dell didn’t provide bootable ISO image for BIOS upgrades.
After searching for DOS bootable images I have found FreeDOS project.

Unfortunately FreeDOS 1.1 LiveCD mode is not supported out of the box.

Using modified iso image from this page you can boot directly to DOS without need to install anything:

To add your own files to the iso, just use trial version of Magic ISO Maker (300MB maximum), or some similar program.
Just put your custom files in FREEDOS folder and after booting you will be able to run them in DOS environment.

After boot process is complete run dir command to see what files are in current directory.

E:\FREEDOS> dir

On the following picture you can see that Dell BIOS update utility – M620-0~0.EXE is present in the directory.

The only thing left is to execute it:

E:\FREEDOS> M620-0~0.EXE

This Bootable DOS ISO was tested on HP, DELL, Supermicro iKVMs and on VmWare.

Download Link: http://pingtool.org/downloads/fd11src_live.iso