Timberline Employee Blog

From our living-room to yours

Entries Comments



Compiling Zabbix SVN for CentOS 5.0

28 June, 2007 (09:54) | Computer Security | By: Ben

Zabbix is a complex monitoring tool that allows an administrator to easily view the state of the network. Easily view, that is, once it is set up completely.

At the time of this writing Zabbix has no RPMs to download for CentOS. I made mine with two scripts. It could have been one script if I wanted. getsvn and make_zabbix are the two scripts. Place both in the same empty directory and run getsvn. Update your release number so rpm -Uvh works. You can get some of the files needed by make_zabbix from a src.rpm on a similar platform. Fedora has a 1.4 src at a mirror. Use midnight commander open the src.rpm, navigate to CONTENTS.cpio and extract zabbix.spec, zabbix-agent.init, zabbix-logrotate.in, zabbix-server.init, and zabbix-web.conf. 

Now copy zabbix.spec to zabbixsrcrpm.spec and edit zabbix.spec. Before the make line add these lines:

make dist
# copy tar.gz file for src.rpm
cp %{name}-%{version}.tar.gz ../../SOURCES
# move in src.rpm .spec
mv ../../SPECS/%{name}srcrpm.spec ../../SPECS/%{name}.spec
cd ..
tar xvfz %{name}-%{version}/%{name}-%{version}.tar.gz
cd %{name}-%{version}

What this does is create a few more missing files like include/dbsync.h and creates a tar.gz file. This tar.gz file is what will be used for the src.rpm. It is also extracted in the same build directory and the spec file for the src.rpm is moved in place at this point too.  When your src.rpm is completed you can also run rpmbuild –rebuild zabbix*src.rpm and it should compile correctly.

File: getsvn

#!/bin/tcsh -f

set NAME=zabbix
set VER=1.4.1
set TARGZ=$NAME-$VER.tar.gz
set old_dir = `pwd`

# increment rpm numbers so rpm -Uvh works
nano zabbix.spec
nano zabbixsrcrpm.spec

svn co svn://svn.zabbix.com/branches/$VER
mv $VER “$NAME-$VER”

cd “$NAME-$VER”

aclocal -I m4
autoconf
autoheader
automake -a
automake

cd old_dir
tar cvfz “$TARGZ” “$NAME-$VER”
rm -rf “$NAME-$VER”
./make_zabbix

File: make_zabbix
#!/bin/tcsh -f

set TARGZ=zabbix-1.4.1.tar.gz
set RSPEC=zabbix.spec
set RSPEC2=zabbixsrcrpm.spec
set F1=zabbix-agent.init
set F2=zabbix-logrotate.in
set F3=zabbix-server.init
set F4=zabbix-web.conf

cp “$TARGZ” /usr/src/redhat/SOURCES
cp “$F1″ /usr/src/redhat/SOURCES
cp “$F2″ /usr/src/redhat/SOURCES
cp “$F3″ /usr/src/redhat/SOURCES
cp “$F4″ /usr/src/redhat/SOURCES
cp “$RSPEC” /usr/src/redhat/SPECS
cp “$RSPEC2″ /usr/src/redhat/SPECS

set old_dir = `pwd`
cd /usr/src/redhat/SPECS
rpmbuild -ba –clean –rmsource `basename $RSPEC`

mv /usr/src/redhat/RPMS/i386/zabb* /usr/src/redhat/SRPMS/zabb* $old_dir
rm /usr/src/redhat/SPECS/`basename $RSPEC`

GNU Email and File Encryption

19 June, 2007 (13:34) | Computer Security | By: Ben

I have found a few programs to relatively securely encrypt email and files. One of those is the GPG Gnu Privacy Guard.

So now that you’ve decided to converse by email, you’ve learned that every email you send can be stored forever on some obscure server your email made its way through.So what do you do now?Simply, encrypt.

One tool, GnuPG, is a GPL licensed encryption engine. It doesn’t do anything by itself. However when combined with a few other tools Outlook integration is only a few steps away. I used Gpg4WIN from gpg4win.org. It includes the whole suite of tools needed to interface Outlook and the GnuPG encryption engine. The site is a German site and the included documents are in German so I chose to download the light package without documents. If you look around you can find an English manual.

After installing you will need to generate a key using your name, email, and a good pass phrase using the GNU Privacy Assistant, GPA for short. Don’t loose your password. You will need it.

For secured communications with an outside party, that party must also have GPG software installed and you must exchange your public keys. Once you install their key on your computer you can encrypt emails automatically using a combination of your key and their key.

The second thing Gpg4WIN does for you is it allows you to sign your email against your public key. It is recommended that you email your public key to just those you communicate with and to avoid posting your key to the public key servers as it is possible for spammers to harvest emails from them. The easiest way to email your key to open up the WinPT Key Manager, right click on your key, and select send key to mail recipient.

Outlook Express needs a plug-in running in your system tray when you wish to sign or encrypt emails. You can download gpgoe from wald.intevation.org/projects/gpgoe. Only message bodies are encrypted with this plug-in, attachments and subject lines are not encrypted. To automatically encrypt attachments, use Sylpheed-Claws instead of Outlook Express. This program is included in the Gpg4WIN download but is not installed by default. The party on the other end will also need to run something other than Outlook Express to automatically decrypt your emails with attachments.

Encryption can be thought of like a lock on a door. It keeps the honest people out. As computers become faster and given enough time and processor power any encryption key can be broken. If security is of the utmost concern then don’t use a public method of communication. The key is here is to consider the cost of breaking in verses the payoff.

OpenOffice Tricks and Tips

11 May, 2007 (13:35) | Office Productivity | By: Ben

Let me preface that everybody has a favorite word processor. There are others out there and I’d be glad to hear about the free ones that work well for you.

OpenOffice is one of the best productivity suites to come around in a long time and here is why. Most people who use an office productivity suite do not use it for anything more than typing up a letter or sometimes calculating in a small spreadsheet. Most people in an office environment who don’t know there are viable and quite usable alternatives use Microsoft Word and Microsoft Excel to do these tasks. These programs are horribly overpriced and bloated for simple tasks. I reserve my MS Word and Excel licenses for my power users.

The OpenOffice versions of these programs are Writer and Calc. OpenOffice reads and writes Microsoft formatted documents with ease. When you open an existing document OpenOffice will save in whatever format it was originally. However when you create a new document and you wish to share this document with a Microsoft user, you will need to select “Save As”. In Writer select the save as type “Microsoft Word 97/2000/XP (.doc)” and in Calc select the save as type “Microsoft Excel 97/2000/XP (.xls)”. It is that easy.

Here is a fun tip that Microsoft Office XP can’t do. In OpenOffice File menu select “Export as PDF”. This will create an Adobe PDF file viewable on every platform with a PDF viewer. Most people have this viewer installed already. When you have “Tagged PDF” selected in the export screen your PDF file will also contain the hyperlinks, if any, from your source document. So if your document had a link to go a particular web page, your tagged PDF would also have this link. There are installable print drivers like the doPDF project that allow you to print to a PDF file but these free ones so far do not allow you to keep embedded hyperlinks. PDF files are difficult for most people to edit once they are created because most people only have this PDF viewers installed. This makes them an excellent document format to use for quotes emailed to customers with the added benefit that your customer can view them on nearly any platform.

The significant difference between Word and Writer and Excel and Calc lies in the scripting engines. Spreadsheet formulas are not scripting code. These formulas read just fine between Excel and Calc. Documents that make use of the scripting engines are high level documents that are literally programs in and of themselves. For Microsoft products these types of documents would have Visual Basic code embedded. It is not likely that you will come across these types of documents here.

Finally Microsoft provides viewers for Word and Excel. If you come across Word or Excel documents that just are not viewing or printing correctly then one of these viewers could help you out. The viewers are free. The actual Microsoft Office program to edit the files is what costs so much.

So when somebody here says “I need Excel” or “I need Word” I respond with, “You already have something better installed on your desktop. Look for a folder called OpenOffice.org.

File formats talked about in this article:
.doc - Microsoft Word
.xls - Microsoft Excel
.pdf - Adobe Acrobat
.odt – OpenOffice OpenDocument Text
.sxw – OpenOffice.org 1.0 Text Document
.ods – OpenOffice OpenDocument Spreadsheet
.sxc – OpenOffice.org 1.0 Spreadsheet