Ad Widget

Collapse

Zabbix Not Running | Fresh install CentOs 6.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edgdelgado
    Junior Member
    Zabbix Certified Specialist
    • Jul 2013
    • 19

    #1

    Zabbix Not Running | Fresh install CentOs 6.4

    Hi guys,

    I just installed my Server and cant get it running, see bellow:
    Server_1
    CentOs 6.4
    Zabbix 2.0.8

    Server_2
    CentOs 6.4
    Postgresql 9.2

    Install:
    ./configure --prefix=/opt/zabbix --enable-server --disable-static --disable-proxy --enable-agent --with-postgresql --with-libcurl --with-net-snmp --with-ssh2 --with-openipmi

    Zabbix folder: /opt/zabbix

    database.conf
    DBHOST
    DBNAME
    DBUSER
    DBPORT
    DBPASSWORD
    all checked

    /etc/init.d/zabbix_server

    Code:
    #!/bin/bash
    #
    # chkconfig: - 90 10
    # description:  Starts and stops Zabbix Server using chkconfig
    #				Tested on Fedora Core 2 - 5
    #				Should work on all Fedora Core versions
    #
    # @name:	zabbix_server
    # @author:	Alexander Hagenah <[email protected]>
    # @created:	18.04.2006
    #
    # Modified for Zabbix 2.0.0
    # May 2012, Zabbix SIA
    #
    # Source function library.
    . /etc/init.d/functions
    
    # Variables
    # Edit these to match your system settings
    
    	# Zabbix-Directory
    	BASEDIR=/opt/zabbix
    
    	# Binary File
    	BINARY_NAME=zabbix_server
    
    	# Full Binary File Call
    	FULLPATH=$BASEDIR/sbin/$BINARY_NAME
    
    	# PID file
    	PIDFILE=/tmp/$BINARY_NAME.pid
    
    	# Establish args
    	ERROR=0
    	STOPPING=0
    
    #
    # No need to edit the things below
    #
    
    # application checking status
    if [ -f $PIDFILE  ] && [ -s $PIDFILE ]
    	then
    	PID=`cat $PIDFILE`
    	
    	if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null && [ $BINARY_NAME == `ps -e | grep $PID | awk '{print $4}'` ]
    	then
    		STATUS="$BINARY_NAME (pid `pidof $APP`) running.."
    		RUNNING=1
    	else
    		rm -f $PIDFILE
    		STATUS="$BINARY_NAME (pid file existed ($PID) and now removed) not running.."
    		RUNNING=0
    	fi
    else
    	if [ `ps -e | grep $BINARY_NAME | head -1 | awk '{ print $1 }'` ]
    		then
    		STATUS="$BINARY_NAME (pid `pidof $APP`, but no pid file) running.."
    	else
    		STATUS="$BINARY_NAME (no pid file) not running"
    	fi
    	RUNNING=0
    fi
    
    # functions
    start() {
    	if [ $RUNNING -eq 1 ]
    		then
    		echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"
    	else
    		action $"Starting $BINARY_NAME: " $FULLPATH
    		touch /var/lock/subsys/$BINARY_NAME
        fi
    }
    
    stop() {
    	echo -n $"Shutting down $BINARY_NAME: "
    	killproc $BINARY_NAME
    	RETVAL=$?
    	echo
    	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BINARY_NAME
    	RUNNING=0
    }
    
    
    # logic
    case "$1" in
    	start)
    		start
    		;;
    	stop)
    		stop
    		;;
    	status)
    		status $BINARY_NAME
    		;;
    	restart)
    		stop
    		sleep 10
    		start
    		;;
    	help|*)
            echo $"Usage: $0 {start|stop|status|restart|help}"
    		cat <<EOF
    
    			start		- start $BINARY_NAME
    			stop		- stop $BINARY_NAME
    			status		- show current status of $BINARY_NAME
    			restart		- restart $BINARY_NAME if running by sending a SIGHUP or start if not running
    			help		- this screen
    
    EOF
    	exit 1
    	;;
    esac
    
    exit 0

    when /etc/init.d/zabbix_server
    Status OK

    Code:
    zabbix    1298  0.0  0.2  76464  1272 ?        S    13:36   0:00 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1301  0.3  0.2  76464  1284 ?        S    13:36   0:03 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1302  0.0  0.2  76464  1064 ?        S    13:36   0:00 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1303  0.0  0.2  76464  1064 ?        S    13:36   0:00 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1304  0.0  0.2  76464  1064 ?        S    13:36   0:00 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1305  0.4  0.2  76472  1264 ?        S    13:36   0:04 /opt/zabbix/sbin/zabbix_agentd
    zabbix    1458  0.8  0.4  99708  2248 ?        S    13:46   0:03 /opt/zabbix/sbin/zabbix_server

    /tmp/zabbix_server.log - Why about Database if my zabbix_server.conf is right?



    Code:
     1420:20130904:134445.833 Database is down. Reconnecting in 10 seconds.
      1420:20130904:134455.834 [Z3001] connection to database 'zabbix' failed: [0] could not connect to server: Connection refused
            Is the server running on host "localhost" (::1) and accepting
            TCP/IP connections on port 5432?
    could not connect to server: Connection refused
            Is the server running on host "localhost" (127.0.0.1) and accepting
            TCP/IP connections on port 5432?
    could not connect to server: Connection refused
            Is the server running on host "localhost" (10.156.22.22) and accepting
            TCP/IP connections on port 5432?
    /tmp/zabbix_agentd.log

    Code:
    10051]: [111] Connection refused)
      1263:20130904:092242.594 agent #2 started[listener]
      1248:20130904:105314.612 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.8 (revision 38017).
      1253:20130904:105314.665 agent #0 started [collector]
      1255:20130904:105314.665 agent #2 started[listener]
      1256:20130904:105314.665 agent #3 started[listener]
      1257:20130904:105314.665 agent #4 started [active checks]
      1254:20130904:105314.666 agent #1 started[listener]
      1257:20130904:105314.666 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:
    php config
    Code:
    <?php
    // Zabbix GUI configuration file
    global $DB;
    
    $DB['TYPE']     = 'POSTGRESQL';
    $DB['SERVER']   = '10.156.22.23';
    $DB['PORT']     = '0';
    $DB['DATABASE'] = 'zabbixdb';
    $DB['USER']     = 'zabbix';
    $DB['PASSWORD'] = 'xxxx';
    
    // SCHEMA is relevant only for IBM_DB2 database
    $DB['SCHEMA'] = '';
    
    $ZBX_SERVER      = '10.156.22.22';
    $ZBX_SERVER_PORT = '10051';
    $ZBX_SERVER_NAME = 'FOZ PE';
    
    $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
    ?>





    Any other information let me know...


    Thx!
  • tartan75
    Junior Member
    • Nov 2012
    • 7

    #2
    Maybe I'm miss-understanding, but is the database on a seperate server, yet the log suggests the zabbix_server.conf points to localhost?

    Comment

    • dkanbier
      Junior Member
      Zabbix Certified Specialist
      • Jul 2013
      • 13

      #3
      Another odd thing is that the log file says it tries to connect to database "zabbix" where the config states the name of the database as "zabbixdb".

      Plus the specified port to use for the database says "0", I don't think that is possible.

      Are you really sure your config file is used? Try to move yours and restart the server and see if it complains about a missing config file.

      If you're sure about the config file I'd do (in order):

      1. Check if the postgresql database is running and listening:

      Log in on the database node and execute:

      Code:
      # netstat -ap |grep 5432
      It should report a process listening on that port. Of course, if you configured postgresql to run on another port use that one. If no lines are reported, postgresql is not listening so fix that first.

      2. Make sure you configured the database server to receive connections

      Log in on the zabbix server and use telnet to connect to the database server:

      Code:
      # telnet 10.156.22.23 5432
      It should establish a connection. If not:
      • Do you have a firewall (iptables) running on either of the nodes?
      • Does the telnet command work if you try it on the database node?
      • Did you configure postgresql to allow connections to be made from the network instead of localhost?
      • Did you rule out SELinux?


      Depending on the outcome of some of these questions you can take further steps. I'd be happy to give a hand

      Comment

      • Ronex
        Junior Member
        • Jan 2015
        • 1

        #4
        ZAbbix server not work normaily

        Excuse me, I have finished Zabbix server setup,
        (Pls refer to attache file)
        zabbix is running, but I just can see the 10050 listening port only, lack of 10051
        listening port. Could any one tell me why, pls ? Tks.

        Zabbix server: 2.0.13
        CentOS 6
        Attached Files

        Comment

        • pantera
          Member
          • Dec 2014
          • 39

          #5
          Originally posted by Ronex
          Excuse me, I have finished Zabbix server setup,
          (Pls refer to attache file)
          zabbix is running, but I just can see the 10050 listening port only, lack of 10051
          listening port. Could any one tell me why, pls ? Tks.

          Zabbix server: 2.0.13
          CentOS 6
          Look to zabix_server.log in /tmp directory
          For detailed log:
          # vi /etc/zabbix/zabbix_server.conf
          DebugLevel=4

          Comment

          Working...