Installing zabbix agent on linux machine

June 25, 2011

I have tested this on different versions of centos and it works fine for system which deployment tools has been installed on it.
1-tar -xzvf zabbix-1.6.2.tar.gz
2-cd zabbix-1.8.4
3-./configure –enable-agent –prefix=/usr/local/zabbix
4-make install
Possible errors = error: no acceptable C compiler found in $PATH
The solution depends on what has already been installed on the server. Usually ‘yum install gcc’ is all that is required.

yum install gcc
yum install gcc.x86_64
Still not working? Try ‘yum update yum’, then ‘yum remove gcc gcc.x86_64’ then ‘yum install gcc’. It should work!

In this step we should configure the agent that we installed:
1-adduser zabbix
Add the zabbix agent ports to your /etc/services file.
2-echo ‘zabbix_agent 10050/tcp’ >> /etc/services
3-echo ‘zabbix_trap 10051/tcp’ >> /etc/services
Copy the sample configs to /etc/zabbix for the agentd.
4-mkdir /etc/zabbix
5-cd zabbix-1.8.4
6-cp misc/conf/zabbix_agentd.conf /etc/zabbix
Now go to /etc/zabbix/zabbix_agentd.conf, and edit:
7-Server=10.0.84.114[Example IP address of the Zabbix Server]
8-Hostname=Mail_Server [Exactly the same name as our zabbix host name – See #1 above. NOTE:This name is case sensitive!]
Next, configure /etc/init.d/
Note: If you are not using a redhat OS, look in zabbix-1.6.2/misc/init.d/ and choose a more appropriate directory before executing the following command.
9-cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd
10-Now go to /etc/init.d/zabbix_agentd, and edit
Just below #!/bin/sh: add these two lines, including the # hash marks.
# chkconfig: 345 95 95
# description: Zabbix Agentd
11-Then edit these two lines, to read as shown below:
BASEDIR=/usr/local/zabbix
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd [change bin to sbin]
12-Configure automatic starting and stopping of services:
chkconfig –level 345 zabbix_agentd on
13-Next, edit /etc/hosts.allow on the Linux agent to allow the Zabbix Server IP address.
14-Dealing with the Firewall:
If using Webmin, you need to insert a line such as this:
If protocol is TCP and source is and destination port is 10050
This will result in a line in iptables as follows:
ACCEPT tcp – 0.0.0.0/0 tcp dpt: 10050
If you don’t have Webmin, you may need to ‘man iptables’ to check the commands necessary to insert that line in your iptables.

Almost there now:
/etc/init.d/zabbix_agentd start
Check the zabbix_agentd log to see if all is okay!
cat /tmp/zabbix_agentd.log
5392:20090202:115848 zabbix_agentd started. ZABBIX 1.6.2.
5393:20090202:115848 zabbix_agentd collector started
5394:20090202:115848 zabbix_agentd listener started
5395:20090202:115848 zabbix_agentd listener started
5396:20090202:115848 zabbix_agentd listener started
5397:20090202:115848 zabbix_agentd active check started [10.0.84.114:10051]
Log looks ok!

Now go back to the Zabbix Server web-interface and enable the Mail_Server host. After a few moments you should be able to see data in Monitoring –> Latest data.

DB2 initializing in batch mode

May 28, 2011

we can use the following script to initialize db2 environment in command line mode of windows server and run any sql query on it.
@echo off
rem If we’re not called from DB2CLP, call ourselves again
if “%DB2CLP%” == “” db2cmd /c /i /w %0 %* & goto :eof
rem Now the real stuff
db2 connect to MYDB
db2 select * from sysibm.sysdummy1
db2 connect reset
rem etc.
this is a nice solution to run db2 scripts in windows batch mode.

linux default startup mode

May 4, 2011

when installing linux in graphical mode, it will enter to gui when starting.
to prevent this we should modify /etc/inittab file as below:
id:5:initdefault:
change this to :
id:3:initdefault:
or vise versa.

How to Linux disable X Windows KDE during system boot

May 2, 2011

How can I configure my system to disable X Windows KDE during Linux system coming up / booting up?

A. Usually almost all Linux distribution use following runlevels for text and GUI mode:

=> Runlevel – 2/3 : Text mode
=> Runlevel – 5 : GUI mode

These modes are defined in /etc/inittab file.

Open file /etc/inittab
# vi /etc/inittab

Find out entry that read as follows:
id:5:initdefault:

Set the default runlevel to 3 (text mode)
id:3:initdefault:

Save and close the file

Reboot the system
# reboot

Now you will boot into text mode only. If you want to see GUI (KDE desktop) type the following command:
$ startx

java environment variable

March 16, 2011

after applying necessary setting, my .bash_profile looks like this:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export java_home=/usr/java/jdk1.6.0_20
export PATH=$java_home/bin:$PATH

unset USERNAME

Disabling Time Synchronization in vmware

December 19, 2010

In virtual environment, time is an important issue.you can use vmware tools interface, we can configure client machine not to sync its time with host.
The time synchronization checkbox controls only whether time is periodically resynchronized while the virtual machine is running. Even if this box is unselected, VMware Tools by default synchronizes the virtual machine’s time after a few specific events that are likely to leave the time incorrect.
To completely disable time synchronization in the guest, perform one of these options:
Open the virtual machine’s configuration file (.vmx) in a text editor and set these options to zero. If the entries do not exist, add them.
Note: 0 = disabled, 1 = enabled.
tools.syncTime = “0″
time.synchronize.continue = “0″
time.synchronize.restore = “0″
time.synchronize.resume.disk = “0″
time.synchronize.shrink = “0″
time.synchronize.tools.startup = “0″
Select the virtual machine in the VMware Infrastructure Client inventory. On the Summary tab, click Edit Settings, then click the Options tab and select General (under Advanced). Click Configuration Parameters, then click Add Row and add this information:
tools.syncTime = “0″
time.synchronize.continue = “0″
time.synchronize.restore = “0″
time.synchronize.resume.disk = “0″
time.synchronize.shrink = “0″
time.synchronize.tools.startup = “0″
# In some cases, the virtual machine may need to be rebooted.
look at this VMware KB for more information

linux ntp client and server configuration

December 18, 2010

we can use linux ntp to sync all lan machines time from a linux ntp server.
after installing ntp rpm package, we will modify default ntp.conf file as below:
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
this cause the machine hardware clock to be used as our time source.
in client machine we just need to have this in ntp.conf file:
server 192.168.1.110
useful links:
http://linuxwave.blogspot.com/2007/08/setting-up-your-own-ntp-server.html
http://www.cyberciti.biz/tips/howto-linux-kill-and-logout-users.html
http://www.cyberciti.biz/faq/rhel-fedora-centos-configure-ntp-client-server
http://www.brennan.id.au/09-Network_Time_Protocol.html

Enable SSH on Solaris 10

December 4, 2010

1. Change the file /etc/ssh/sshd_config with PermitRootLogin yes to replace PermitRootLogin no

2. restart the services by the following command:

#svcadm restart svc:/network/ssh:default

failed to update disk partition information-step by step fix

December 1, 2010

the following link describe the problem and solution completely:

Unsupported Console and SSH on ESXi 4

November 21, 2010

This will likely not generate as much fanfare as it did for the 3.5 release of ESXi, however I can confirm that it does indeed still work in vSphere ESXi 4. This is the procedure I used to get it up and running on my “Lab” box.

1. alt-f1 (Note: As pointed out below, you will not see your typing on this screen, just trust us, it is there).
2.type “unsupported
3. root pw
4. vi /etc/inetd.conf
5. delete the “#” from ssh
6. services.sh restart

then you can connect to this host through any ssh client.


Follow

Get every new post delivered to your Inbox.