Archive for the ‘Ubuntu’ Category

Zabbix 1.6.1 on Ubuntu Hardy Heron 8.04

Sunday, November 9th, 2008

After working with other Open Source monitoring systems over the years, I decided to give Zabbix a try. Net-Saint then Nagios was always good, but getting it going initially and then adding the trending graphing was always a pain. Big Brother was another good one, but now that Quest Software owns it, the BTF version gets less and less appealing. Zenoss is another that I have used recently, but not super-impressed with the ability to create a nice services dashboard that I want to monitor a bunch of hosts and services on one screen. So, Zabbix, I thought, was worth a shot. Also, just getting the monitoring then having to do some hokey, non-documented grapher for Nagios was not going to be fun again so time to try something new.

Good news is the manual is pretty good. My recommendation is to go with Ubuntu for the host OS if possible. I was always a RedHat/Centos guy, but just not really into hunting for dependencies and RPMs anymore. Apt-get is just too great to handle and when you want to get something done quickly, it is just really nice.

Some of the following has been lifted from other places on the net but here goes what worked for me…

1. Hit the basics that need to be in-place. When you do your Heron install, you can hit them then or after with apt-get. Of course, you need;

Apache
PHP5
MySQL-Server

and a few other ones you probably don’t have

php5-gd
snmp
libsnmp9-dev   (this is important for NET-SNMP support for Zabbix at config time)
snmpd

You can issue this to get the ones that are not so standard:

$ sudo apt-get install php5-gd snmp libsnmp9-dev snmpd

(wait for a while)

2. Create zabbix user/group

$ sudo adduser zabbix

(it will walk you through the user info q&a) then when done and he user to the ‘admin’ group as well

$ sudo adduser zabbix admin

3. Create the mysql db for the backend (make sure mysqld is running prior of course). There is no password for the default root user for new mysqld installs, so no need to enter a password. You should change that and secure mysql of course later…

$ mysql -uroot

mysql> create database zabbix;
mysql> quit;

4. Download zabbix from their site. The version I am dealing with now is 1.6.1 http://www.zabbix.com/download.php and place it somewhere on the server and unzip/untar it so you have a directory with the release contents.You probably would be served best to place it into the home directory of the zabbix user (i.e - /home/zabbix/zabbix-1.6.1). By this time, I am just staying as root user throughout after getting sick of sudo.

5. Setting up the mysql db with the sql files from the release -

cd into the zabbix release directory (I will use /home/zabbix/zabbix-1.6.1 from now on) and run

$ cat create/schema/mysql.sql | mysql -uroot zabbix
$ cd create/data
$ cat data.sql | mysql -uroot zabbix
$ cat images_mysql.sql | mysql -uroot zabbix

That should get the db populated. To check mysql later and manage other mysql dbs with a nice GUI, phpmyadmin is what I would recommend. But onward!

6. While sitting in the release directory (/home/zabbix/zabbix-1.6.1) run the configure as root or sudo:

#./configure –enable-proxy –with-mysql –with-net-snmp –with-libcurl –enable-server –enable-agent

If this fails, stop and make sure you have everything installed from step #1. I missed a few things initially but if you have everything installed, it should go. Then

# make

# make install

7. Create config directory and copy the defaults over;

$ sudo mkdir /etc/zabbix
$ sudo chown -R zabbix.zabbix /etc/zabbix/
$ cp misc/conf/zabbix_* /etc/zabbix/

I would not mess with the configs just yet. I always over think settings so I tend to see if it can run then tweak after. These ran fine on Hardy Heron without modification initially.

8. Get the web interface files placed:

mkdir /home/zabbix/web
cp -R /home/zabbix/zabbix-1.6.1/frontends/php/* /home/zabbix/web

You should chown and chmod the directory for the initial config to go smoothly later:

$ sudo chown -R zabbix /home/zabbix/web
$ sudo chgrp -R <your webserver user> /home/zabbix/web
$ sudo chmod -R 775 /home/zabbix/web

and add the alias to the apache default site

$ sudo vi /etc/apache2/sites-enabled/000-default

When in vi, paste something like this prior to the termination of the virtualhost:

Alias /zabbix/ /home/zabbix/web/
<Directory /home/zabbix/web>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

9. Start zabbix server and the agent:

$ sudo zabbix_server
$ sudo zabbix_agentd &

10. Check the php.ini and change these (the max_execution_time for me was 30 seconds initially)

max_execution_time = 300 ; Maximum execution time of each script, in seconds
date.timezone = <your timezone>

Timezone reference for php @

http://us3.php.net/manual/en/timezones.php

Mine is —->      date.timezone = America/Los_Angeles
11. Restart apache to kick-in the site changes alias and the php.ini changes if they were needed.

12. Go to http://<hostname / ip>/zabbix/

13. The initial login should be

Admin
zabbix

14. Walk through the install and because of what you did in step 8 above, you should be able to have it save the config to the directory. If not, you can save it and scp or sftp it up to the /home/zabbix/web/conf directory.

15. Add hosts and play with graphs now. You shoudl go add yourself as a separate user and change the main admin password, etc.

I am sure I missed something or could have done things in a better order, but this is what I was able to piece together from older version install guides on the web and what worked for me. There are addition setups that should be done so you HAVE to check the install guide, but this is the basic way to get operational at least on Ubuntu Hardy Heron.

Hope this helps,

Jonathan

UPDATE: For Ubuntu 8.10 I needed to also install

libcurl4-gnutls-dev
and I just installed all libmysql

$ sudo apt-get install libmysql*
$ sudo apt-get install libcurl4-gnutls-dev

Galleon for Tivo on Ubuntu Hardy

Monday, June 16th, 2008

I had a lot of issues with getting a recent install of Galleon operational on Ubuntu Hardy Heron. I was running Galleon off and on for years on OS X, but seemed like it was time to get it going on Ubuntu.

Not Easy.

It seems they really gear Galleon on the linux-side to be most workable with RedHat / Fedora flavors of linux. I had a multitude of issues getting it operational and if you are trying to get this going, I hope this helps.

1. Disable IPv6. I know, it is the future, but again, we have to disable it to get better performance and/or have something we need just work. In Ubuntu Hardy, you

sudo vi /etc/modprobe.d/aliases

Change:

alias net-pf-10 ipv6

to

alias net-pf-10 off ipv6

Then

sudo /etc/init.d/networking restart

or reboot the computer.

2. Download the galleon distribution. Unzip it somewhere, and vi the Makefile to comment out or delete the lines referring to ‘chkconfig’ in the install and uninstall parts. It is a RH deal not a Ubuntu deal.

3. Perform the

sudo make install

4. It should put everything in /usr/share/galleon . Go there and vi galleon in the bin directory and comment out the line towards the top referreing to /init.d/functions. Again, a reference to a RH deal.

5. Then, vi the run.sh script in the /usr/share/galleo/bin directory to get rid of the extra stuff and just go with

#!/bin/bash
#
# Run the Galleon server
#
/usr/share/galleon/bin/galleon console

After doing the above, things actually started to work for Galleon and Hardy Heron!

Good luck!

Denyhosts is your friend to stop ssh login attempts

Friday, May 23rd, 2008

Denyhosts

If you have a few linux servers that for whatever reason you have to leave open to ssh into on the standard port 22, denyhosts is a great way to get rid of the annoying daily logwatch email logs showing some losers somewhere have been spending all day doing a denial of service trying to brute-force attack their way in to ssh. Better ways are just to not even let ssh be accessible to non-legit IPs as well as disable ssh logins except for a couple of valid users, but in the case of mobile devices, locations, etc. you just sometimes need to have the ability to ssh into servers anywhere and other services might be dependent on the default port number, so changing it to get it out of the range of the script-kiddie or russian mafia is just not an option. It is one thing to have secure passwords, keys, etc. but just the fact they continue to bang on your servers can really rack-up bandwidth and annoyance.

Denyhosts is written in python and works with your logs to (based on your settings) inhibit attempts once thresholds you configure are met on login attempts. Really cool.

http://denyhosts.sourceforge.net

I have tested on ubuntu and centos and works great. The default configs are basically ready for centos/fedora/redhat out of the rpm or from source.

Moving Ubuntu Linux from PATA drive to SATA drive

Tuesday, May 20th, 2008

 Sata drivePata drive

I had mergy.org running on a very old laptop on a small ide 2.5″ drive. It was slow, but it was working. It got very tedious to work on though when anything went wrong and the webserver was really starting to get slow so I finally bit decided to move to newer hardware. But, the problem was that the drives on anything modern are serial ATA.

Here is what I did

1. Installed the same flavor and version of linux  on the new server and hard drive mimicing the partitions numbering on the old server. You could just get away with partitioning the drive in step 3 using one of the many RIPLinux bundled utils or fdisk, gparted, etc.

2. Took the drive out of the old laptop and put it in a usb external case and connected to the new server.

3. Booted on a RIPLinux CD - but any live CD would do really.

4. Blew away all files on the various partitions on the new server/drive

5. copied the files and directories over from the old drive with cp -prv

6. Changed the grub config in /boot to point to /dev/sda1 as opposed to /dev/hda1

7. Checked /etc/fstab to make sure mount points are OK

8. Edited the boot grub menu to make sure that point to the root directory

And it worked!

Recovery is Possible linux —> http://ftp.leg.uct.ac.za/pub/linux/rip/

Nice GUI LDAP Browser Application –> LUMA

Friday, April 18th, 2008

luma_browse

I have recently been doing a lot with LDAP and really needed a nice, flexible LDAP browser tool to run on Ubuntu Hardy.

Luma is great.  Very configurable and easy to work with. Has a plug-in architecture and just really slick from what else is out there now.

Check it out @

http://luma.sourceforge.net

Ubuntu Wifi Management With WICD

Saturday, February 2nd, 2008

Ubuntu Logo

Wifi

After running Ubuntu for quite a while now, most of the system is great and extremely functional. The real mess is with the lack of wireless management tools to handle multiple wireless networks. That is, until I have been working with WICD. WICD is the best manager I have used at it is great at storing keys, etc. This is really a must have for a desktop/laptop WIFI user. Installing it requires you remove the built-in ‘Network Manager’ that Gnome/Ubuntu installs, but you want to - trust me. It also handles toggling wired ethernet as well.

You should check it out -> wicd.sourceforge.net

wicd screenshot

Ubuntu Gutsy and IBm ThinkPad T42 Xorg Configuration

Sunday, January 27th, 2008

Ubuntu Logo

Thinkpad T42

Getting Ubuntu Gutsy running on an IBM ThinkPad T42 is easy, but the X Server can be a pain. Here is my config.

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section “Files”
EndSection

Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105″
Option “XkbLayout” “us”
EndSection

Section “InputDevice”
Identifier “Configured Mouse”
Driver “mouse”
Option “CorePointer”
Option “Device” “/dev/input/mice”
Option “Protocol” “ImPS/2″
Option “ZAxisMapping” “4 5″
Option “Emulate3Buttons” “true”
EndSection

Section “InputDevice”
Identifier “Synaptics Touchpad”
Driver “synaptics”
Option “SendCoreEvents” “true”
Option “Device” “/dev/psaux”
Option “Protocol” “auto-dev”
Option “HorizEdgeScroll” “0″
EndSection

Section “InputDevice”
Driver “wacom”
Identifier “stylus”
Option “Device” “/dev/input/wacom”
Option “Type” “stylus”
Option “ForceDevice” “ISDV4″# Tablet PC ONLY
EndSection

Section “InputDevice”
Driver “wacom”
Identifier “eraser”
Option “Device” “/dev/input/wacom”
Option “Type” “eraser”
Option “ForceDevice” “ISDV4″# Tablet PC ONLY
EndSection

Section “InputDevice”
Driver “wacom”
Identifier “cursor”
Option “Device” “/dev/input/wacom”
Option “Type” “cursor”
Option “ForceDevice” “ISDV4″# Tablet PC ONLY
EndSection

Section “Device”
Identifier “ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]”
Boardname “ati”
Busid “PCI:1:0:0″
Driver “ati”
Screen 0
Option “MergedFB” “off”
EndSection

Section “Monitor”
Identifier “Thinkpad T42 Display”
Modelname “Custom 1″
modeline “640×480@60″ 25.2 640 656 752 800 480 490 492 525 -vsync -hsync
modeline “800×600@56″ 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
modeline “800×600@60″ 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
modeline “1024×768@60″ 65.0 1024 1048 1184 1344 768 771 777 806 -vsync -hsync
modeline “1280×960@60″ 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
modeline “1280×1024@60″ 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
modeline “1400×1050@60″ 122.61 1400 1488 1640 1880 1050 1051 1054 1087 -hsync +vsync
Gamma 1.0
EndSection

Section “Screen”
Identifier “Default Screen”
Device “ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]”
Monitor “Thinkpad T42 Display”
Defaultdepth 24
SubSection “Display”
Depth 24
Virtual 1400 1050
Modes “1400×1050@60″ “1280×1024@60″ “1280×960@60″ “1024×768@60″ “800×600@60″ “800×600@56″ “640×480@60″
EndSubSection
EndSection

Section “ServerLayout”
Identifier “Default Layout”
screen 0 “Default Screen” 0 0
Inputdevice “Generic Keyboard”
Inputdevice “Configured Mouse”

# Uncomment if you have a wacom tablet
# InputDevice “stylus” “SendCoreEvents”
# InputDevice “cursor” “SendCoreEvents”
# InputDevice “eraser” “SendCoreEvents”
Inputdevice “Synaptics Touchpad”
EndSection
Section “Module”
Load “v4l”
EndSection
Section “device” #
Identifier “device1″
Boardname “ati”
Busid “PCI:1:0:0″
Driver “ati”
Screen 1
Option “MergedFB” “off”
EndSection
Section “screen” #
Identifier “screen1″
Device “device1″
Defaultdepth 24
Monitor “monitor1″
EndSection
Section “monitor” #
Identifier “monitor1″
Gamma 1.0
EndSection
Section “ServerFlags”
EndSection