Posts Tagged ‘Linux’

Upgrading Zabbix from 2.4.x to 3.0.x on CentOS 7

April 13, 2016 Leave a comment

Before starting with the upgrade I recommend familiarising yourself with these pages.

Note! If you are upgrading from earlier versions then you need to upgrade from 1.8.x – 2.x to 2.4.x first. Have a look at my previous post about upgrading Zabbix.

Steps to upgrade

  1. If you are running Zabbix on a virtual machine take a snapshot to revert back to if something goes wrong.
  2. Clean up yum
    yum clean all
  3. Check what zabbix packages you have installed and take a note of them.
    rpm -qa | grep zabbix
  4. Stop Zabbix service.
    systemctl stop zabbix-server
  5. Backup Zabbix (you can skip these if you are using a snapshot)
    mkdir ~/etc_zabbix.bak
    cp -r -p /etc/zabbix/* ~/etc_zabbix.bak
    mkdir ~/web_zabbix.bak
    cp -r -p /usr/share/zabbix/* ~/web_zabbix.bak
    mysqldump -u zabbix -p zabbix > ~/zabbix_dump.sql
  6. Remove old zabbix repo and add the new 3.0.x repo
    rpm -e zabbix-release
    rpm -ivh
  7. Run yum update and install the new packages
    yum update
  8. Verify that new packages have been installed
    rpm -qa | grep zabbix
  9. Restart Zabbix services
    systemctl restart zabbix-agent
    systemctl restart zabbix-server
Categories: CentOS, Linux, Zabbix Tags: , ,

How to get access to NexentaStor shell (bash)

March 8, 2016 Leave a comment

Here is something I picked up when I tried out NexentaStor as a storage solution for my lab.

Nexenta Management Console is quite restrictive command-line interface. If you need access to the shell, you can launch one from NMC.

nmc@nexenta01:/$ option expert_mode=1 -s
nmc@nexenta01:/$ !bash
You are about to enter the Unix ("raw") shell and execute low-level Unix command(s). Warning: using low-level Unix commands is not recommended! Execute? Yes


Categories: Bash, Linux, Nexenta, Storage Tags: , , ,

Add additional disk space to disk in CentOS or RHEL

June 15, 2015 Leave a comment

There are multiple steps required to get this done. Below is a simple basic guide with commands:

  • Download gparted.iso (link) and boot to gparted
  • Deactive the disk you want to resize
  • Resize the disk
  • Apply the changes to the disk
  • Reboot into CentOS or RHEL and run the commands:

    1. lvm vgdisplay

    [user@Server~]# lvm vgdisplay
    — Volume group —
    VG Name               VolGroup
    System ID
    Format                lvm2
    Metadata Areas        1
    Metadata Sequence No  4
    VG Access             read/write
    VG Status             resizable
    MAX LV                0
    Cur LV                2
    Open LV               2
    Max PV                0
    Cur PV                1
    Act PV                1
    VG Size               99.51 GiB
    PE Size               4.00 MiB
    Total PE              25474
    Alloc PE / Size       4994 / 19.51 GiB
    Free  PE / Size       20480 / 80.00 GiB
    VG UUID               iKGKSv-WEVw-0vNB-pRQO-8a5T-q4Z4-8knkhN

    2.  lvm vgdisplay (take a note of the volume you want to extend)

    [user@server~]# lvm lvdisplay
    — Logical volume —
    LV Path                /dev/VolGroup/lv_root
    LV Name                lv_root
    VG Name                VolGroup
    LV UUID                9nSUAm-9Krp-itTW-YuZc-XgtG-m8GS-5C4dLx
    LV Write Access        read/write
    LV Creation host, time ,
    LV Status              available
    # open                 1
    LV Size                95.60 GiB
    Current LE             24474
    Segments               2
    Allocation             inherit
    Read ahead sectors     auto
    – currently set to     256
    Block device           253:0

    3. Run lvextend -l +100%FREE /dev/VolGroup/lv_root

    Size of logical volume VolGroup/lv_root changed from 15.60 GiB (3994 extents) to 95.60 GiB (24474 extents).
    Logical volume lv_root successfully resized

    4. Run lvm vgdisplay to confirm the new disk size

    5. Run resize2fs -p /dev/VolGroup/lv_root (this will add the extra space to the volume)

    6. Run df -h to confirm that the new volume size has been applied

    [user@server log]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    94G   15G   75G  17% /
    tmpfs                 935M     0  935M   0% /dev/shm
    /dev/xvda1            477M   92M  360M  21% /boot

Upgrading Zabbix from 1.8.x to 2.4.x

May 28, 2015 2 comments

Rough guide to get your monitoring server up to Zabbix 2.4.x on CentOS 6.x
The upgrade needs to be done in 3 stages.

Stage 1 – Upgrade from 1.8.x to 2.0.x: All steps, with 4a;5a;
Stage 2 – Upgrade from 2.0.x to 2.2.x: Only steps 1;2;3;4b;5b;7;8;
Stage 3 – Upgrade from 2.2.x to 2.4.x: Only steps 1;2;3;4c;5c;7;8;9;

  1. Stop Zabbix Services
    /etc/init.d/zabbix-server stop
    /etc/init.d/zabbix-agent stop
  2. Take a backup of zabbix configuration files (/etc/zabbix/*)
    mkdir ~/etc_zabbix.bak
    cp -r -p /etc/zabbix/* ~/etc_zabbix.bak
  3. Take a backup of Zabbix database (mysql)
    mysqldump -u zabbix -p zabbix > ~/zabbix_dump.sql
  4. Remove your existing Zabbix Installation
    a) yum erase zabbix*
    b) yum erase zabbix20* – remove zabbix 2.0 –
    c) yum erase zabbix22* – remove zabbix 2.2

    Note! For version 2.0 and 2.2 installed via epel use commands below

  5. Install Zabbix
    a) yum –enablerepo=epel install zabbix20-server-mysql zabbix20-agent zabbix20-web-mysql
    b) yum install zabbix22-server-mysql zabbix22-agent zabbix22-web-mysql
    c) Add 2.4 repo:  rpm -ivh
    Install zabbix 2.4: yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
  6. Upgrade DB Schema from 1.8.x to 2.0.x consists of 2 steps. (Only required for 1.8 to 2.0)
    a) make upgrade script executable.
    chmod +x /usr/share/zabbix-mysql/upgrades/2.0/upgrade
    b) run the script
    cd /usr/share/zabbix-mysql/upgrades/2.0/
    ./upgrade -u zabbix -p zabbix

    Note! Bear in mind that upgrade will take a while and you will get multiple DB password prompts
    Note2! for Stage2 and Stage3, mysql upgrade will happen automatically after you start Zabbix

  7. Next compare and update your configuration files. Old config files are in the zabbix folder (/etc/zabbix/) with the following extension .rpmsave
    Use the following commands to compare:
    diff /etc/zabbix/zabbix_agentd.conf.rpmsave /etc/zabbix_agentd.conf
    diff /etc/zabbix/zabbix_server.conf.rpmsave /etc/zabbix_server.conf
    Or use a tool called winmerge
  8. Start Zabbix-services
    /etc/init.d/zabbix-server start
    /etc/init.d/zabbix-agent start
  9. Enable autostart for Zabbix services
    chkconfig zabbix-server on
    chkconfig zabbix-agent on


Squid WARNING! Your cache is running out of filedescriptors

May 19, 2015 Leave a comment

Note! This “fix” applies to RHEL / Red Hat / CentOS / Fedora.

Recently I noticed that our Squid was running a bit odd, getting stuck with CPU at 100%. After digging around in logs I found the following warning:

WARNING! Your cache is running out of filedescriptors

I found out that I just needed to rise the limit. There are multiple things that need doing.

First we will up the limit in the security/limits.conf file
Second we need to add the following line max_filedesc to squid.conf

Check the current limit:
squidclient -p 3128 mgr:info | grep ‘file descri’

Sample Output:
Maximum number of file descriptors:   1024
Available number of file descriptors:  338
Reserved number of file descriptors:   100

So the default limit is 1024 which is not a lot if you have over 50+ clients using the Squid.

Edit the following file :
vi /etc/security/limits.conf

and add the following limit:
* – nofile 4096

Log off from squid (close ssh session etc) and log back in.

Run the following command to see if the new limit is in place.

ulimit -a | grep ‘open files’

Sample Output:
open files                      (-n) 4096

Modify the Squid.conf and add the following line (somewhere to the bottom of the config)

max_filedesc 4096

Note! You can make it higher than 4096

Now restart the squid with the following command
service squid restart

Run the command from above again to verify that new limits are in place.


Categories: CentOS, Linux, RHEL, Squid Tags: , , ,

How to install Dropbox on Ubuntu 9.10 (Karmic Koala)

July 5, 2009 21 comments

I’m not sure why but Dropbox’s .deb file made for Jaunty is not working, so I had to find an alternative solution. This is a rough guide how to get Dropbox to work on your Karmic Koala

Step 1: Go to Dropbox web and download the source. Here is a direct link to it

Step 2: Unpack the source code

Step 3: You will need the following packages (or equivalent):


So fire up Synaptic Package Manager and install them.

or  install them via terminal using this command:

sudo apt-get install libnautilus-extension-dev libnotify-dev python-docutils

Step 4:

Go the nautilus-dropbox dir (the one that got created when you unpacked the source code). Configure, compile and install the Dropbox. In the nautilus-dropbox dir just do:

$ ./configure
$ make
$ sudo make install

After installing the Dropbox you must restart Nautilus. You can do that by issuing the following command (note: if you’re running compiz, doing so may lock up your computer – log out and log back in instead):

$ killall nautilus

When all that is done go to Applications -> Internet and you see Dropbox there. Select it and it will finish installing Dropbox. When that’s done set it up by providing your credentials or registering and getting a new account.

PS! This guide was written using Alpha 2.

Edit: Thanks sanbor for your comment, I corrected it.


Categories: Linux, Ubuntu Tags: , , ,

How to upgrade ALSA in Ubuntu 9.04 to 1.0.20

June 14, 2009 Leave a comment

I was having issues with Skype the other day . Somehow my mic was not working. I read several howto’s and played with several options, but nothing seemed to work. But  I found another way to fix it. It meant that I needed to upgrade my ALSA from the current version (1.0.18rc3) to 1.0.20. I used this blog to do it.