Search Windows and Linux Networking

Showing posts with label Zabbix. Show all posts
Showing posts with label Zabbix. Show all posts

Friday, December 9, 2011

Step by Step How to: Uninstalling Zabbix Agent from Windows system.

Step by Step How to: Uninstalling Zabbix Agent from Windows system.

Suppose you have installed Zabbix Agent in C:\Program Files\Zabbix with following method :-

Echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
Echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
"C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –i
"C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –s


And you want to uninstall it now to do fire the following command from command prompt:

Note:- It is always good option to backup our configuration file want to use later.

C:\Program Files\Zabbix>zabbix_agentd.exe -x -c"C:\Program Files\Zabbix\zabbix_agentd.Conf"
C:\Program Files\Zabbix>zabbix_agentd.exe -d -c"C:\Program Files\Zabbix\zabbix_agentd.Conf"
rmdir /s "C:\Program Files\Zabbix"


This will uninstall windows zabbix agnet from your system. 1st command stop zabbix agent service , 2nd uninstalled zabbix agent and last one do cleanup by deleting Zabbix directory with all constant from it. 

Saturday, August 6, 2011

How to Install Mostly Required Packages on CentOS/RedHat


How to Install Mostly Required Packages on CentOS/RedHat
such as  make, gcc, mysql, php, perl, gd, posftfix etc.

To install make (used to compile)
# yum -y install make

To download and install the chroot BIND9 package
# yum -y install bind-chroot

To download and install MySQL
# yum -y install mysql mysql-devel mysql-server to download and install MySQL

To install Postfix, Dovecot, and related packages
# yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot

To install PHP and commonly-used optional packages   
# yum -y install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel php-bcmath php-mbstring

To install Perl libraries
# yum -y install perl-HTML-Parser perl-DBI perl-Net-DNS perl-Digest-SHA1 perl-libwww-perl
    
To download and install snmp
yum -y install net-snmp net-snmp-per

Other Pakages that may be required
yum -y install libjpeg libjpeg-devel
yum -y install gcc glibc glibc-common gd gd-devel


Friday, June 3, 2011

How to Install Zabbix Agent on Windows


Installing Zabbix Agent on Windows

Download zabbix agent file from http://www.zabbix.com/download.php and unzip that.

Open command prompt from Start > Run and  then type cmd then click ok

Create new folder for zabbix agent

mkdir c:\Program Files\zabbix

Now copy zabbix_agentd.exe, zabbix_get.exe and zabbix_sender.exe from win32 folder if your OS is x86 else copy from win64 for x64 bit

From command prompt run following command  to create configuration file for zabbix_agent

Note: - change IP Address of Zabbix server instead of 192.168.73.242 . Please be sure that commands are in single line
Echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
Echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
 "C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –i
 "C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –s

Now zabbix agent service is installed and started as automatic start.

OR

You can create batch file for installing zabbix agent . batch file copy that three files from share folder, Create new directory for zabbix agent  then copy required files and install and start service you only need run that zabbix_agent_windows.bat file

@echo off
echo copying exe
net use m: \\ipaddOfShareHost\Share\zabbix_Windows_agent\zabbix_agents_1.8.5.win
mkdir "c:\Program Files\zabbix"
xcopy m:\win32 "c:\Program Files\zabbix"
net use m: /delete
echo Creating configuration for %COMPUTERNAME%...
echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
echo Installing system service...
"c:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" -i
echo Starting agent...
"c:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" -s
echo Finished!
pause


Thursday, June 2, 2011

Monitoring Router or Other Devices using Simple check with Ping (ICMP) in Zabbix


Monitoring Router or Other Devices using Simple check with Ping (ICMP) in Zabbix

For ICMP check Zabbix required different utility for Ping (ICMP echo  ) that is fping. To support Zabbix to simple check you have to first install fping and set the location for fping

fping :- fping is a ping-like program which can determine the accessibility of multiple hosts using ICMP echo requests. fping is designed for parallelized monitoring of large numbers of systems, and is developed with ease of use in scripting in mind.

Install fping :-

You can install fping with following command :-

# yum install fping

Or You can install it by tarbell file



# tar -zxvf fping.tar.gz
# cd fping-2.4b2_to/
# ./configure
# make
# make check
# checkinstall
OR
# make install


Note:- Zabbix server must know where to find fping and be able to execute it.

First check the correct path of fping and then modify zabbix_server.conf file for correct path

# whereis fping
fping: /usr/local/sbin/fping

Now give necessary permission  
# ls -l /usr/local/sbin/fping
-rwxr-xr-x 1 root root 48903 Jun  2 11:01 /usr/local/sbin/fping
# chgrp zabbix /usr/local/sbin/fping
# ls -l /usr/local/sbin/fping
-rwxr-xr-x 1 root zabbix 48903 Jun  2 11:01 /usr/local/sbin/fping
# chmod 4710 /usr/local/sbin/fping
# ls -l /usr/local/sbin/fping
-rws--x--- 1 root zabbix 48903 Jun  2 11:01 /usr/local/sbin/fping

# vi /etc/zabbix/zabbix_server.conf

FpingLocation=/usr/local/sbin/fping

Now restart zabbix server service for changes take effect .

# service zabbix_server restart
Now Zabbix is ready for simple icmp check.

Now open http://ip-address/zabbix and Login to Zabbix as admin

If you have not already added host add it first before creating item

Crate New Host for Router.

To crate new host go to configuration | Hosts and Select Create Host. In New host form type the host name of Router. Basically Router and switch are SNMP supported devices so select SNMP Devices in Group field. Then type the IP Address of Router and then Save the host.

Now we have added Router to our Zabbix monitoring software but it not knowing what to check so for that we have to create item to know Zabbix what to check and using which method. We can be monitor Router using SNMP or by simply sending ping request.

 For now we check our router is live or not using simple check.

So click Item next to Route we just added and then click Crate Item. In Crate Item new form Host is already selected as your router. In description box type the description for the test. For example  Network Reachability using ping . In Type drop down box select Simple Check . In key box type icmpping. In type of information drop down menu select Numeric (float). In Units box type ms . In update interval (in Sec) change it to 60 and show value drop down menu select host status and save the item by clicking Save.

Now we have created test to check network reachability of router. Now we want zabbix have to send a mail if router is unreachable for that we have to create trigger and action. Because we have already configured action for trigger; we have to crate trigger for newly created item. So for that click on trigger next to Router we have added and click Create Trigger . In new Trigger form type the identical information that sense as what is wrong
Type that in Name field. For, example Router is down or unreachable.
In expression field click add this will open new page for condition. Click Select next to item box and then select item we just created Network Reachability using ping and then click insert and then click save.


Now when ever our router get down or unreachable Zabbix will send mail saying that Router is down or unreachable.

Wednesday, June 1, 2011

Sending test notification from Zabbix



Testing Zabbix server by sending Test Notification 

For now we have installed zabbix and configure zabbix for Mail configuration and for action. But how do we know that it is actually working. For so we have to do something that is working and then we have to manually create trouble on that zabbix will monitor that and it find that there is problem with that item. So it take action against that by sending mail to admin as we configure last time . so what we will do we add localhost in zabbix and create item to monitor /tmp/text.txt file exsit and create trigger if file not exist. After that we delete that file so trigger will execute and zabbix take action by sending notification mail to admin.
For testing purposes we have to do following tasks:-
  1. Add HOST
  2. Create Item
  3. Create Trigger
  4. Create problem

Adding HOST: - By default zabbix_server host is added and it is disable for monitoring . do not enable it. For testing, we add host manually. So to add host first of all login in to zabbix  with user name admin and default password zabbix. Then go to Configuration > Hosts and then select Create Host. In New host window type the hostname for example zabbix. In Group field windows remove zabbix_server and add Linux Server. In IP address box type the IP address 127.0.0.1 for monitor localhost and insure that status is equal to monitored is selected then click to save the host.



Create Item:- create file as /tmp/test.txt using command
# touch /tmp/test.txt
 Now next to zabbix (host we just added ) there are no item . Select item next to zabbix and select Create Item . In new item windows host equal to zabbix will already selected. Type Description “/tmp/test.txt file exists for testing” , Type equal to Zabbix agent and then type most important thing Key is equal to vfs.file.exists[/tmp/test.txt] there are many field s there but for testing purpose it is in up for us . Click Save to Save the newly created item.

Create Trigger :-  Now we crate trigger for /tmp/test.txt file. Now next to zabbix host in trigger field select trigger then click Create Trigger . In New trigger Name file give the identical name for identify . For example /tmp/test.txt file does not exist and then type {zabbix:vfs.file.exists[/tmp/test.txt].last(0)}=0 in expression field and select warning in Severity drop down list. And click Save to save our trigger.

Create Problem :- Now every thing is looking ok . Now we have to crate problem by deleting the test.txt file so that zabbix will check that there is not such file so it take the action

# rm -rf /tmp/test.txt

After few min you got an email with subject zabbix /tmp/test.txt file does not exist: Problem

Now troubleshoot the problem by create same file using command

# touch /tmp/test.txt

After few min you got another email with subject zabbix /tmp/test.txt file does not exist: OK


Configure Action on Zabbix


Configure Zabbix for Action
Last time we configure Zabbix for email parameter to use for to send email notification now we have to configure action on Zabbix server to do something upon certain conditions match.

To configure actions, open Configuration > Actions. There are no existing actions listed, so click Create Action.
.
In action windows type name for example "Send Mail" In event source select Triggers .

In Default subject:- On {HOSTNAME} {TRIGGER.NAME}: {TRIGGER.STATUS}

In Default message :- On {HOSTNAME} {TRIGGER.NAME}: {TRIGGER.STATUS}
                                   Last value: {ITEM.LASTVALUE}

                                  {TRIGGER.URL}

In Action Operations click New :-

Select send message in operation type  and send message to select  single user then click on select and then select admin and click add and click save.


Tuesday, May 31, 2011

Configure zabbix for Email Notification Parameters


Configure zabbix for Email Notification

To send mail you have to told your system which SMTP server to use which account to use (from address) for sending mail and where to send mail (To address).
In zabbix these setting are configure in two phases in first phase we have to told zabbix  which smtp server to use and which email address to use to send notification and in second phase we told zabbix whom to send mail.

Phase:-1) Configure Email Parameter

To configure the parameters for e-mail sending, go to Administration | Media types and click on Email in the Description column.

Change the SMTP server, SMTP helo, and SMTP email fields to use a valid e-mail server. If your have installed mail server on zabbix server  then you can specify  localhost for SMTP Server In The SMTP email address will be used as the From address, so make sure it's set to something your server will accept. This email address zabbix is going to use for sending email notification. After giving all required information click save


Phase:-2) Configure Email Parameter

To configure zabbix to tail whom to send mail go to Administration | Users and select user admin. In Admin user property windows In media section select add. In new windows select type as Email in send to field type valid email address on which you want notification and click add.  In admin user property windows in media section now you will see email address for admin user. Click save.  

That's it. Now our zabbix know which SMTP server to use for sending mail , which email address to use for mail from filed and lastly where to send mail RCPT filed to send mail. 

Step by Step Installing Zabbix on CentOS


Step by Step Installing Zabbix on CentOS

Install Apache Server on CentOS, RedHat, Linux

# yum install httpd
# chkconfig httpd on
# service httpd start
 Starting httpd:                                            [  OK  ]

Install PHP

#  yum install php

Install MySQL

# yum install mysql-server mysql php-mysql
# service mysqld start
# chkconfig mysqld on

Install Mail Server

Remove sendMail

# yum remove sendmail

# yum install postfix

The configuration file is located at /etc/postfix/main.cf. Edit the file and make sure you change the following lines with your domain name.

1) What domain name to use in outbound mail
  Eg:- mydomain = example.com
     myorigin = $mydomain
2) What domains to receive mail for
  Eg:- mydestination = 
3) What clients to relay mail from
  Eg:- mynetworks = 192.168.10.0/24 , 192.168.73.0/24, 127.0.0.0/8
4) What destinations to relay mail to
  Eg:- relay_domains = $mydestination
5) What delivery method: direct or indirect
  (For direct delivery to Internet.)
  Eg:-  relayhost = 

Now edit the mail configruaration file and set parameter to send mail with our register domain name.
# vi /etc/postfix/main.cf

myhostname= zabbix.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination =
mynetworks = 192.168.19.0/24 , 192.168.73.0/24, 127.0.0.0/8
relay_domains = $mydestination
relayhost =  

# chkconfig postfix on
# /etc/init.d/postfix restart
Shutting down postfix:                                     [FAILED]
Starting postfix:                                                [  OK  ]

Test mail server by sending test mail from telnet

# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 zabbix.glam.com ESMTP Postfix
helo
501 Syntax: HELO hostname
helo example.com
250 zabbix.example.com
mail from:zabbix@example.com
250 2.1.0 Ok
rcpt to:abc_username@gmail.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: test message
this is the test mail
.
250 2.0.0 Ok: queued as F02B840410
quit
221 2.0.0 Bye
Connection closed by foreign host.

Zabbix Installation

We will be installing following components:

    Zabbix Server (for gathering data)
    Zabbix Agent (for monitoring)
    Net-SNMP (for SNMP Support)
    Jabber (for notifications)
    OpenIPMI (for monitoring)
    cURL (for web monitoring)

First install all the dependencies with yum using the command

# yum install zlib-devel mysql-devel glibc-devel curl-devel gcc automake mysql libidn-devel openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel

For Jabber:- we will need the packages iksemel-devel wich depends on iksemel,
however these RPM's arent in the CentOS Repo's so we will be downloadind them from a external site.

# wget http://dag.wieers.com/rpm/packages/iksemel/iksemel-1.3-1.el5.rf.i386.rpm
# wget http://dag.wieers.com/rpm/packages/iksemel/iksemel-devel-1.3-1.el5.rf.i386.rpm

# ls -l
-rw-r--r-- 1 root root 118688 Aug  6  2007 iksemel-1.3-1.el5.rf.i386.rpm
-rw-r--r-- 1 root root   6695 Aug  6  2007 iksemel-devel-1.3-1.el5.rf.i386.rpm

# rpm -ivh iksemel-1.3-1.el5.rf.i386.rpm

warning: iksemel-1.3-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:iksemel                ########################################### [100%]

# rpm -ivh iksemel-devel-1.3-1.el5.rf.i386.rpm

warning: iksemel-devel-1.3-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:iksemel-devel          ########################################### [100%]

Install Check Install for future software management   
# wget http://www.asic-linux.com.mx/~izto/checkinstall/files/rpm/checkinstall-1.6.1-1.i386.rpm

# rpm -ivh checkinstall-1.6.1-1.i386.rpm

Preparing...                ########################################### [100%]
   1:checkinstall           ########################################### [100%]



Download Zabbix tar file :-

# ls -l
-rw-r--r-- 1 root root  118688 Aug  6  2007 iksemel-1.3-1.el5.rf.i386.rpm
-rw-r--r-- 1 root root    6695 Aug  6  2007 iksemel-devel-1.3-1.el5.rf.i386.rpm
-rw-r--r-- 1 root root 4184672 Apr 16 01:01 zabbix-1.8.5.tar.gz
# tar -zxvf zabbix-1.8.5.tar.gz

# ls -l
-rw-r--r--  1 root root  118688 Aug  6  2007 iksemel-1.3-1.el5.rf.i386.rpm
-rw-r--r--  1 root root    6695 Aug  6  2007 iksemel-devel-1.3-1.el5.rf.i386.rpm
drwxr-xr-x 12 1001 1001    4096 Apr 16 00:50 zabbix-1.8.5
-rw-r--r--  1 root root 4184672 Apr 16 01:01 zabbix-1.8.5.tar.gz
# cd zabbix-1.8.5

# ./configure --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent

In the end, a summary of compiled components is printed. Verify that you have the following enabled:
   Enable server:                         yes
   Server details:
   With database:                       MySQL
    WEB Monitoring via:             cURL
    Native Jabber:         yes
    SNMP:                                net-snmp
    IPMI:                                    openipmi
    SSH:                                     no

# make

Now we should install it. Despite the output of configure and many How Tos suggesting so, do not run make install. It unnecessarily complicates package management and can lead to weird problems in future. Instead, you should create proper packages for your distribution.

To create a proper Zabbix package make sure that CheckInstall is installed and execute as root:

# checkinstall --nodoc --install=yes -y

You Should be able to choose what kind of package that you wish you create,
because CentOS is based on RedHat we are going for [R], type R and press Enter.

Initial configuration

Create new user as zabbix with password set as zabbix
# useradd -m -s /bin/bash zabbix
# passwd zabbix
Changing password for user zabbix.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
# pwd
/root/zabbix-1.8.5
# mkdir /etc/zabbix
# cp misc/conf/zabbix_server.conf  /etc/zabbix/
# cp misc/conf/zabbix_agentd.conf  /etc/zabbix/

Now edit zabbix_server.conf file to modify and database name , database user and dbpassword
Look for DBName, DBUser and DBPassword

# vi /etc/zabbix/zabbix_server.conf

DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

# chmod 400 /etc/zabbix/zabbix_server.conf
# chown zabbix /etc/zabbix/zabbix_server.conf

Creataing and populating the database
First of make sure the mysql daemon is running using
# service mysqld status
If not you can start it with

# service mysqld start

Set root password for mysql. for now I am giving redhat
# mysqladmin -u root password redhat
# mysql_secure_installation

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.01 sec)

mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Note: - Use the same password you set in zabbix_server.conf file instead of zabbix if you have given other one.

# mysql -u zabbix -p zabbix < create/schema/mysql.sql

# mysql -u zabbix -p zabbix < create/data/data.sql

# mysql -u zabbix -p zabbix < create/data/images_mysql.sql

Cross check if zabbix database created with table for so do

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------------+
| Tables_in_zabbix      |
+-----------------------+
| acknowledges          |
| actions               |
| alerts                |
| applications          |
| auditlog              |
| auditlog_details      |
| autoreg_host          |
| conditions            |
| config                |
| dchecks               |
| dhosts                |
| drules                |
| dservices             |
| escalations           |
| events                |
| expressions           |
| functions             |
| globalmacro           |
| graph_theme           |
| graphs                |
| graphs_items          |
| groups                |
| help_items            |
| history               |
| history_log           |
| history_str           |
| history_str_sync      |
| history_sync          |
| history_text          |
| history_uint          |
| history_uint_sync     |
| hostmacro             |
| hosts                 |
| hosts_groups          |
| hosts_profiles        |
| hosts_profiles_ext    |
| hosts_templates       |
| housekeeper           |
| httpstep              |
| httpstepitem          |
| httptest              |
| httptestitem          |
| ids                   |
| images                |
| items                 |
| items_applications    |
| maintenances          |
| maintenances_groups   |
| maintenances_hosts    |
| maintenances_windows  |
| mappings              |
| media                 |
| media_type            |
| node_cksum            |
| nodes                 |
| opconditions          |
| operations            |
| opmediatypes          |
| profiles              |
| proxy_autoreg_host    |
| proxy_dhistory        |
| proxy_history         |
| regexps               |
| rights                |
| screens               |
| screens_items         |
| scripts               |
| service_alarms        |
| services              |
| services_links        |
| services_times        |
| sessions              |
| slides                |
| slideshows            |
| sysmaps               |
| sysmaps_elements      |
| sysmaps_link_triggers |
| sysmaps_links         |
| timeperiods           |
| trends                |
| trends_uint           |
| trigger_depends       |
| triggers              |
| user_history          |
| users                 |
| users_groups          |
| usrgrp                |
| valuemaps             |
+-----------------------+
88 rows in set (0.01 sec)

mysql> quit;
Bye
[root@zabbix zabbix-1.8.5]#

[ Note: - If any problems occur the easiest way is to delete the db with
# mysql> drop database Zabbix;  and start from the beginning again. ]

Now login as zabbix user and execute the file to check all services are running with zabbix users
# su - zabbix
[zabbix@zabbix ~]$ /usr/local/sbin/zabbix_agentd
[zabbix@zabbix ~]$ /usr/local/sbin/zabbix_server

[zabbix@zabbix ~]$ ps -e | grep zabbix

26015 ?        00:00:00 zabbix_agentd
26016 ?        00:00:00 zabbix_agentd
26017 ?        00:00:00 zabbix_agentd
26018 ?        00:00:00 zabbix_agentd
26019 ?        00:00:00 zabbix_agentd
26020 ?        00:00:00 zabbix_agentd
26023 ?        00:00:00 zabbix_server
26025 ?        00:00:00 zabbix_server
26027 ?        00:00:00 zabbix_server
26028 ?        00:00:00 zabbix_server
26029 ?        00:00:00 zabbix_server
26030 ?        00:00:00 zabbix_server
26031 ?        00:00:00 zabbix_server
26032 ?        00:00:00 zabbix_server
26033 ?        00:00:00 zabbix_server
26034 ?        00:00:00 zabbix_server
26037 ?        00:00:00 zabbix_server
26039 ?        00:00:00 zabbix_server
26041 ?        00:00:00 zabbix_server
26042 ?        00:00:00 zabbix_server
26048 ?        00:00:00 zabbix_server
26050 ?        00:00:08 zabbix_server
26052 ?        00:00:00 zabbix_server
26054 ?        00:00:00 zabbix_server
26056 ?        00:00:00 zabbix_server
26060 ?        00:00:00 zabbix_server
26062 ?        00:00:00 zabbix_server
26064 ?        00:00:00 zabbix_server
26066 ?        00:00:00 zabbix_server
26067 ?        00:00:00 zabbix_server
26070 ?        00:00:00 zabbix_server
26072 ?        00:00:00 zabbix_server
[zabbix@zabbix ~]$


Creating startup scripts

Login in back to root

$ su -

After a successful login let us copy the scripts from our Zabbix source into our /etc/init.d/ folder. this can be done with the following command:

# cd zabbix-1.8.5
# cp misc/init.d/redhat/8.0/zabbix_* /etc/init.d/

This will copy zabbix_server and zabbix_agentd startup scripts.

# ls -l /etc/init.d/za*
-rw-r--r-- 1 root root 1718 May 27 14:39 /etc/init.d/zabbix_agentd
-rw-r--r-- 1 root root 1577 May 27 14:39 /etc/init.d/zabbix_server

Now change the progdir= location in following files

# vi /etc/init.d/zabbix_server

progdir=”/usr/local/sbin/”

# vi /etc/init.d/zabbix_agentd

progdir=”/usr/local/sbin/”

# chmod 755 /etc/init.d/zabbix_server
# chmod 755 /etc/init.d/zabbix_agentd
# chkconfig --add zabbix_server
# chkconfig --add zabbix_agentd
# chkconfig --list zabbix_server
zabbix_server   0:off   1:off   2:off   3:off   4:off   5:off   6:off

# chkconfig zabbix_server on

# chkconfig --list zabbix_server
zabbix_server   0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig --list zabbix_agentd
zabbix_agentd   0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig zabbix_agentd on
# chkconfig --list zabbix_agentd
zabbix_agentd   0:off   1:off   2:on    3:on    4:on    5:on    6:off

Now start the services
# /etc/init.d/zabbix_agentd start
Starting zabbix_agentd:                                    [  OK  ]


# /etc/init.d/zabbix_server start
Starting zabbix_server:                                    [  OK  ]

Check service is running and it bind with correct port
# ps -C zabbix_agentd
  PID TTY          TIME CMD
26224 ?        00:00:00 zabbix_agentd
26226 ?        00:00:00 zabbix_agentd
26227 ?        00:00:00 zabbix_agentd
26228 ?        00:00:00 zabbix_agentd
26229 ?        00:00:00 zabbix_agentd
26230 ?        00:00:00 zabbix_agentd

# netstat -ntpl

Installing the Web frontend

# yum install php-mysql php-gd php-bcmath php-mbstring php-xml

Once installed its time to copy the web files to the correct folder, with CentOS and Apache this would be /var/www/html/.

# cp -r frontends/php/ /var/www/html/

To make the page access able through http://localhost/zabbix we will have to to rename the folder to zabbix.

# cd /var/www/html
# mv php zabbix

Add alias in apache by editing configuration file

# vi /etc/httpd/conf/httpd.conf

Alias /zabbix /var/www/html/zabbix
<Directory /var/www/html/zabbix/>
  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>


Now make some changes in php.ini file to set time zone and other parameter. Most Likely Zabbix won't agree with all of your settings and will tell you to change them to the required settings.

# vi /etc/php.ini

max_execution_time = 300
date.timezone =Asia/Calcutta
memory_limit = 256M 
max_input_time = 600 
post_max_size = 32M
max_execution_time = 600
 
# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

For other time zone use following link:-


Now it's time to fire up a browser and navigate to Zabbix's address:
http://<server_ip_or_name>/zabbix.



Now follow the instruction on screen .

Most Likely Zabbix won't agree with all of your settings and will tell you to change them to the requiered settings. after changes in php.ini you should reload or restart appache server
useing command

# server httpd restart

and the try again
In Configure DB Connection Windows type zabbix as user name and password. and then click test connection.
In summary page verify  all settings and then click Next.
 In Configuration file check window download the configuration file and save that downloaded file to the location given and click retry. it become green then click next. at the last you will get following screen for authentication.

Now login as admin with password zabbix