Ad Widget

Collapse

zabbix server is not runnning ,the information displayed maybe not current !

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baobamboo
    Junior Member
    • Jun 2014
    • 2

    #1

    zabbix server is not runnning ,the information displayed maybe not current !

    hi

    when i install Zabbix 2.0.11 in the rhel5.5 with yum ,the installation is ok ,but when i open the link :http://**.**.**.**.**/zabbix ,it prompt "zabbix server is not runnning ,the information displayed maybe not current "

    the rhel server selinux is disabled
    the service is ok :

    root@zabbix init.d]# ps -ef |grep zabbix
    103 3029 1 0 13:58 ? 00:00:00 /usr/sbin/zabbix_proxy -c /etc/zabbix_proxy.conf
    avahi 3205 1 0 13:58 ? 00:00:00 avahi-daemon: running [zabbix.local]
    zabbix 3873 1 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    zabbix 3876 3873 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    zabbix 3877 3873 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    zabbix 3878 3873 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    zabbix 3879 3873 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    zabbix 3881 3873 0 14:06 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
    root 4951 3536 0 14:29 pts/2 00:00:00 vi zabbix.conf.php
    103 5011 1 0 14:30 ? 00:00:00 /usr/sbin/zabbix_server -c /etc/zabbix_server.conf
    root 5096 3537 0 14:34 pts/1 00:00:00 grep zabbix

    [root@zabbix init.d]# service zabbix-server status
    -l (pid 5011) is running...

    in the zabbix_server.log it show that :

    5011:20140528:151222.951 Database is down. Reconnecting in 10 seconds.
    5011:20140528:151232.952 [Z3001] connection to database 'zabbix' failed: [0] could not connect to server: Connection refused
    Is the server running on host "localhost" and accepting
    TCP/IP connections on port 5432?

    5011:20140528:151232.952 Database is down. Reconnecting in 10 seconds.
    5011:20140528:151242.953 [Z3001] connection to database 'zabbix' failed: [0] could not connect to server: Connection refused
    Is the server running on host "localhost" and accepting
    TCP/IP connections on port 5432?

    5011:20140528:151242.953 Database is down. Reconnecting in 10 seconds.
    5011:20140528:151252.956 [Z3001] connection to database 'zabbix' failed: [0] could not connect to server: Connection refused
    Is the server running on host "localhost" and accepting
    TCP/IP connections on port 5432?

    5011:20140528:151252.956 Database is down. Reconnecting in 10 seconds.


    the mysql is ok :

    mysql> help show ;
    Name: 'SHOW'
    Description:
    SHOW has many forms that provide information about databases, tables,
    columns, or status information about the server. This section describes
    those following:

    SHOW CHARACTER SET [like_or_where]
    SHOW COLLATION [like_or_where]
    SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]
    SHOW CREATE DATABASE db_name
    SHOW CREATE FUNCTION func_name
    SHOW CREATE PROCEDURE proc_name
    SHOW CREATE TABLE tbl_name
    SHOW DATABASES [like_or_where]
    SHOW ENGINE engine_name {LOGS | STATUS }
    SHOW [STORAGE] ENGINES
    SHOW ERRORS [LIMIT [offset,] row_count]
    SHOW FUNCTION CODE func_name
    SHOW FUNCTION STATUS [like_or_where]
    SHOW GRANTS FOR user
    SHOW INDEX FROM tbl_name [FROM db_name]
    SHOW INNODB STATUS
    SHOW PROCEDURE CODE proc_name
    SHOW PROCEDURE STATUS [like_or_where]
    SHOW [BDB] LOGS
    SHOW MUTEX STATUS
    SHOW OPEN TABLES [FROM db_name] [like_or_where]
    SHOW PRIVILEGES
    SHOW [FULL] PROCESSLIST
    SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
    SHOW PROFILES
    SHOW [GLOBAL | SESSION] STATUS [like_or_where]
    SHOW TABLE STATUS [FROM db_name] [like_or_where]
    SHOW TABLES [FROM db_name] [like_or_where]
    SHOW TRIGGERS [FROM db_name] [like_or_where]
    SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]
    SHOW WARNINGS [LIMIT [offset,] row_count]

    like_or_where:
    LIKE 'pattern'
    | WHERE expr

    If the syntax for a given SHOW statement includes a LIKE 'pattern'
    part, 'pattern' is a string that can contain the SQL "%" and "_"
    wildcard characters. The pattern is useful for restricting statement
    output to matching values.

    Several SHOW statements also accept a WHERE clause that provides more
    flexibility in specifying which rows to display. See
    http://dev.mysql.com/doc/refman/5.0/en/ ... -show.html.

    URL: http://dev.mysql.com/doc/refman/5.0/en/show.html


    mysql> SHOW DATABASES;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | mysql |
    | test |
    | zabbix |
    +--------------------+
    4 rows in set (0.00 sec)

    mysql> select zabbix ;
    ERROR 1054 (42S22): Unknown column 'zabbix' in 'field list'
    mysql> SELECT zabbix ;
    ERROR 1054 (42S22): Unknown column 'zabbix' in 'field list'
    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> select * from zabbix ;
    ERROR 1146 (42S02): Table 'zabbix.zabbix' doesn't exist
    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 |
    | globalvars |
    | graph_discovery |
    | 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 |
    | host_inventory |
    | hostmacro |
    | hosts |
    | hosts_groups |
    | hosts_templates |
    | housekeeper |
    | httpstep |
    | httpstepitem |
    | httptest |
    | httptestitem |
    | icon_map |
    | icon_mapping |
    | ids |
    | images |
    | interface |
    | item_discovery |
    | items |
    | items_applications |
    | maintenances |
    | maintenances_groups |
    | maintenances_hosts |
    | maintenances_windows |
    | mappings |
    | media |
    | media_type |
    | node_cksum |
    | nodes |
    | opcommand |
    | opcommand_grp |
    | opcommand_hst |
    | opconditions |
    | operations |
    | opgroup |
    | opmessage |
    | opmessage_grp |
    | opmessage_usr |
    | optemplate |
    | profiles |
    | proxy_autoreg_host |
    | proxy_dhistory |
    | proxy_history |
    | regexps |
    | rights |
    | screens |
    | screens_items |
    | scripts |
    | service_alarms |
    | services |
    | services_links |
    | services_times |
    | sessions |
    | slides |
    | slideshows |
    | sysmap_element_url |
    | sysmap_url |
    | sysmaps |
    | sysmaps_elements |
    | sysmaps_link_triggers |
    | sysmaps_links |
    | timeperiods |
    | trends |
    | trends_uint |
    | trigger_depends |
    | trigger_discovery |
    | triggers |
    | user_history |
    | users |
    | users_groups |
    | usrgrp |
    | valuemaps |
    +-----------------------+
    103 rows in set (0.01 sec)

    mysql> select * from users;
    +--------+-------+---------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    | userid | alias | name | surname | passwd | url | autologin | autologout | lang | refresh | type | theme | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
    +--------+-------+---------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    | 1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 | | 1 | 0 | en_US | 30 | 3 | default | 0 | | 0 | 50 |
    | 2 | guest | Default | User | d41d8cd98f00b204e9800998ecf8427e | | 0 | 900 | en_GB | 30 | 1 | default | 0 | | 0 | 50 |
    +--------+-------+---------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    2 rows in set (0.00 sec)

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

    mysql> quit


    Mysql 启动了数据库zabbix 也有呀.zabbix_server.conf 中关于数据库的设置,我是按照下面的设置做的:

    # vi /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix

    数据库的状态是ok的.
    mysql> status
    --------------
    mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1

    Connection id: 18420
    Current database: zabbix
    Current user: root@localhost
    SSL: Not in use
    Current pager: stdout
    Using outfile: ''
    Using delimiter: ;
    Server version: 5.0.77 Source distribution
    Protocol version: 10
    Connection: Localhost via UNIX socket
    Server characterset: latin1
    Db characterset: utf8
    Client characterset: latin1
    Conn. characterset: latin1
    UNIX socket: /var/lib/mysql/mysql.sock
    Uptime: 5 days 21 hours 2 min 3 sec

    Threads: 1 Questions: 367106 Slow queries: 0 Opens: 487 Flush tables: 1 Open tables: 64 Queries per second avg: 0.723
    --------------

    when i regrant the permission with the follow command :
    grant all on zabbix.* to zabbix@localhost identified by 'Zabbix';


    the error is remain .

    who can provide some help for me ?

    thanks
    bao
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hello and welcome!

    This is second forum post today already when people try to install outdated Zabbix versions. Has this become a trend or what?

    The current version is now 2.2.3 while you are installing 2.0.11.

    Anyways, it seems that Zabbix server cannot connect to database by saying this [Z3001] connection to database 'zabbix' failed: [0] could not connect to server.

    I did not read all the information you provided about your issue but there is one thing I noticed.
    You have provided the following setting in your /etc/zabbix/zabbix_server.conf file:
    Code:
    DBPassword=zabbix
    While in SQL you spefify the password with capital "Z"
    Code:
    grant all on zabbix.* to zabbix@localhost identified by 'Zabbix';
    Change the DBPassword in zabbix_server.conf to Zabbix and restart zabbix_server process to check it.

    Did that help?

    Best Regards,
    Ingus

    Comment

    Working...