Understanding Linux CPU Load

You might be familiar with Linux load averages already. Load averages are the three numbers shown with the uptime and top commands – they look like this:

load average: 0.09, 0.05, 0.01

Most people have an inkling of what the load averages mean: the three numbers represent averages over progressively longer periods of time (one, five, and fifteen minute averages), and that lower numbers are better. Higher numbers represent a problem or an overloaded machine. But, what's the the threshold? What constitutes "good" and "bad" load average values? When should you be concerned over a load average value, and when should you scramble to fix it ASAP?

First, a little background on what the load average values mean. We'll start out with the simplest case: a machine with one single-core processor.

The traffic analogy

A single-core CPU is like a single lane of traffic. Imagine you are a bridge operator … sometimes your bridge is so busy there are cars lined up to cross. You want to let folks know how traffic is moving on your bridge. A decent metric would be how many cars are waiting at a particular time. If no cars are waiting, incoming drivers know they can drive across right away. If cars are backed up, drivers know they're in for delays.

So, Bridge Operator, what numbering system are you going to use? How about:

Read more

Share

Reset root Password for Redhat/CentOS/Sl Linux 5.x

You can log in using single-user mode and create a new root password.

To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:

  1. At the boot loader menu, use the arrow keys to highlight the installation you want to edit and type [A] to enter into append mode.

  2. You are presented with a prompt that looks similar to the following:

    grub append> ro root=LABEL=/
  3. Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:

    ro root=LABEL=/ single
  4. Press [Enter] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:

    sh-2.05b#
  5. You can now change the root password by typing

    passwd root

    You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.

Share

zimbra admin password reset

To reset the administrative password:

su - zimbra
zmprov sp <admin email address> <new password>

To get a list of all administrators:

su - zimbra
zmprov gaaa

To access the admin console:

https://YOURHOST:7071

Remember that the administrative console (sometimes) requires a full email address as the login name, so you may be using the correct password and the wrong login!

Share

XRDP in OpenSuse 11.0/11.2/11.3

This tutorial is for advanced users who prefer to skate all the detail that attaches to a "new user" Tutorial. The details (wherein lies the devil) are here: Windows Linux RDP Remote Desktop Connections using openSUSE as Client or Server (terminal server) FWIW there's also an 11.1 version there.

Tested in openSUSE 11.2 KDE & Gnome 32 & 64 bit. In 11.3 I tested KDE & Gnome 64 bit and KDE 32 bit.
There are 4 simple steps

Step 1: Download and install the software

This link contains the RPMs. They work for openSUSE 11.2 and 11.3. Drill down to either the 32 bit i586 RPMs or the 64 bit x86_64 RPMs and download one each of these RPMs: xorg-x11-server-dmx, xorg-x11-server-rdp and xrdp. There are dependency issues to cater for so put the three in a folder anywhere and add that folder as a "local directory" in Yast's –> Software –> Repositories module. Install all three. That's for the server. If you need the client, you also install the RPM for rdesktop from your standard media.

Step 2: Open the firewall

GoTo Yast's firewall module –> Allowed Services –> Select –> Remote Desktop Protocol –> Add.

Step 3: Start the service

If you want the service on permanently goto Yast –> System –> Services / Runlevels –> xrdp –> Enable
If you want the service occasionslly, enable it with "sudo /usr/sbin/rcxrdp start" and turn it off with "sudo /usr/sbin/rcxrdp stop".

Step 4: Port Forwarding

Go to your router by http:// and forward port TCP 3389 to the server IP address.
 

Share

Zimbra 8 Community edition on Scientific Linux 6 (64 Bit)

Install SL 6.3 (64 bit)

  • Installing SL6.3 (64bit)  with 'minimal' installation mode
  • Post installing, fix with the Static IP Address (Public IP and I assume the system is not behind firewall)
  • Double check with /etc/resolv.conf file parameters

Prerequisites for ZImbra installation

Let's firsy update-

yum update

Let's install some pckages as well

yum – y install sudo sysstat gmp libidn libstdc++ bind bind-chroot bind-libs bind-utils wget php perl nc sqlite

and few more packages-

yum install compat-libstdc++-33 sysstat

If anything missed out you'll know in the next steps, if anything left google it, chances are you'll be able to yum it :), however for this time being the environment is made. Now proceed to download Zimbra.

Make some backend job-

  • Make sure 'SELINUX' is disabled
  • The iptables service is stopped
  • 'postfix' service is stopped and disabled at runtime and on boot

Download ZImbra

My downloaded edition was-

http://files2.zimbra.com/downloads/8.0.0_GA/zcs-8.0.0_GA_5434.RHEL6_64.20120907144639.tgz

Once downloaded, get inside the extracted folder.

Read more

Share

Install nginx on virtualmin (GPL) server

Installing Nginx Support

Switching a system from the Apache webserver (installed by default by Virtualmin to Nginx should only be done if no virtual servers with websites have been created yet. Ideally the change should be done on a freshly installed system, running RHEL 6.0, CentOS 6.0 or Debian 6.0 or later. Virtualmin version 3.89 or above is also required.

The steps to remove Apache and install Nginx are :

  1. Shut down Apache with the command /etc/init.d/httpd stop ; service httpd off (on RHEL or CentOS), or /etc/init.d/apache2 stop ; update-rc.d apache2 remove (on Debian).
  2. Install Nginx with the command yum install nginx (on RHEL or CentOS) or apt-get install nginx (on Debian).
  3. Start the Nginx webserver with the command /etc/init.d/nginx start
  4. Install Virtualmin's Nginx plugin with the command yum install wbm-virtualmin-nginx wbm-virtualmin-nginx-ssl (on RHEL or CentOS) or apt-get install webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl (on Debian).

    Read more

Share

Redhat/CentOS install PHP on NginX server as fastcgi

tep # 1: Enable EPEL repo

ngnix is not included in the base system. Turn on EPEL repo to install nginx stable release:
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$(uname -m)/epel-release-5-3.noarch.rpm

Step # 2: Install ngnix

Type the following command at a shell prompt:
# yum install nginx
Sample output:

Loaded plugins: downloadonly, fastestmirror, priorities, protectbase
Loading mirror speeds from cached hostfile
 * epel: archive.linux.duke.edu
 * base: ftp.linux.ncsu.edu
 * updates: centos.mirror.nac.net
 * addons: mirror.cs.vt.edu
 * extras: centos.mirror.nac.net
0 packages excluded due to repository protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:0.6.34-1.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================
 Package                             Arch                                 Version                                    Repository                          Size
==============================================================================================================================================================
Installing:
 nginx                               x86_64                               0.6.34-1.el5                               epel                               319 k
Transaction Summary
==============================================================================================================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total size: 319 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nginx                                             [1/1]
Installed: nginx.x86_64 0:0.6.34-1.el5
Complete!

Read more

Share

Network Configuration on Debian or Ubuntu

 

Setting up an Ethernet Interface

The majority of network setup can be done via the interfaces configuration file at /etc/network/interfaces. Here, you can give your network card an IP address (or use dhcp), set up routing information, configure IP masquerading, set default routes and much more.

Remember to add interfaces that you want brought up at boot time to the 'auto' line.

See man interfaces for more options.

 

Using DHCP to automatically configure the interface

If you're just using DHCP then all you need is something like:

 

    auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp

Read more

Share

Ozeki NG MySQL Connectivity Parameters

Databse connection

===========================

Driver={mySQL ODBC 5.1 Driver};Server=192.168.0.100;Port=3306;Option=4;Database=mydb;Uid=userdb;Pwd=putmypwd;

Sending-Polling

============

SELECT id,sender,receiver,msg,msgtype,operator FROM ozekimessageout WHERE status=’send’

Sending-sending

=============

UPDATE ozekimessageout SET status=’sending’ WHERE id=’$id’

Sending-Sent

==============

UPDATE ozekimessageout SET status=’sent’, senttime=’$senttime’ WHERE id=’$id’

Sending-Not sent

===========

UPDATE ozekimessageout SET status=’notsent’ WHERE id=’$id’

SQL for receiving

==============

INSERT INTO ozekimessagein (sender, receiver, msg, senttime, receivedtime, msgtype, operator) VALUES (‘$originator’,’$recipient’,’$messagedata’,’$senttime’,’$receivedtime’,’$messagetype’,’$operatornames’)

Share

Nagios JBoss Plugin

Perl script to check thread and memory usage of a Jboss server.

I didn't like the Jboss checks that I've found which require Java or remote-run, so I wrote this. It's a simple check that looks at memory usage and busy threads. I did this with percentage thresholds to make it dynamic.

Usage: check_jboss_status.pl [-H ] [-P ] [-t ]
[-m
] [-a ]
[-h
]
-H The host to connect to (default: localhost)
-P The port to connect to (default: 8080)
-a The AJP ports to check for (default: 8009)
-h
The HTTP ports to check for (default: 8080,8443)
-t The percentage of threads busy for warning
(default: 80,50)
-m
The percentage of memory used for warning
(default: 80,50)

Read more

Share