Ad Widget

Collapse

Zabbix 2.2 + SQLITE3 = Missing database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jlemes
    Junior Member
    • Dec 2013
    • 15

    #1

    Zabbix 2.2 + SQLITE3 = Missing database

    Hello guys,

    I'm implementing a small project where I use the Raspberry Pi to run Zabbix Server with the SQLite3 database to monitor hosts on IPv6. I do not need scalability, but simply because I have a few hardware resources and will monitor only a few hosts.

    PROBLEM: In Step 3 "Set DB connection" configuration via web he can not find the SQLite database that I created when testo connection error "Missing database" appears.

    PROCEDURES:
    1. I run ./Configure and make install correctly as shown below, did the import schema.sql , images.sql and data.sql for zabbix.db which is located in /var/lib/slite/zabbix.db this folder file are as owner zabbix:zabbix and it's permission is 644 .

    2 . Zabbix_server.conf in the database looks like this: DBName=/var/lib/slite/zabbix.db , parameters DBUser and DBPassword are not set.


    Code:
    # ./configure --prefix=/etc/zabbix --enable-server --enable-agent --enable-ipv6 --with-sqlite3 --with-net-snmp=/usr/bin/net-snmp-config --with-jabber --with-libcurl=/usr/bin/curl-config --with-ssh2 --with-openipmi
    
    --omitted--
    
    Configuration:
    
      Detected OS:           linux-gnu
      Install path:          /etc/zabbix
      Compilation arch:      linux
    
      Compiler:              gcc
      Compiler flags:        -g -O2     -I/usr/include      -I/usr/local/include -I/usr/lib/perl/5.14/CORE -I. -I/usr/include  -I/usr/include -I/usr/include  
    
      Enable server:         yes
      Server details:
        With database:         SQLite v3.x
        WEB Monitoring:        yes
        Native Jabber:         yes
        SNMP:                  net-snmp
        IPMI:                  openipmi
        SSH:                   yes
        ODBC:                  no
        Linker flags:          -rdynamic        -L/usr/lib    -L/usr/lib/i386-linux-gnu   -L/usr/lib  -L/usr/lib -L/usr/lib -L/usr/lib 
        Libraries:             -lm -ldl -lrt  -lresolv       -lsqlite3 -liksemel   -lcurl   -lnetsnmp -lcrypto  -lnetsnmp -lcrypto -lssh2 -lOpenIPMI -lOpenIPMIposix 
    
      Enable proxy:          no
    
      Enable agent:          yes
      Agent details:
        Linker flags:          -rdynamic     -L/usr/lib/i386-linux-gnu 
        Libraries:             -lm -ldl -lrt  -lresolv    -lcurl 
    
      Enable Java gateway:   no
    
      LDAP support:          no
      IPv6 support:          yes
    
    ***********************************************************
    *            Now run 'make install'                       *
    *                                                         *
    *            Thank you for using Zabbix!                  *
    *              <http://www.zabbix.com>                    *
    ***********************************************************

    HELP: I think it's something I'm doing wrong, but I have no idea what it is . I'm newbie to Zabbix and is my second implementation of the tool, as configured with MySQL and it worked perfectly, including IPv6. Does anyone have any idea how to help me?

    If you need more details just ask, and if possible suggest me where I can get such detail because they do not know the entire structure of Zabbix.

    Thank you and sorry Google translate =)

    João L.
  • jlemes
    Junior Member
    • Dec 2013
    • 15

    #2
    Guys,

    Unable to rotate the Zabbix Server with SQLite , but I face some problems .

    What I did to run ?
    Installed everything normally, but zabbix_server.conf changed in the database with the absolute file path (/var/lib/sqlite/zabbix.db) , as owner of this file let the user www-data Apache , otherwise it does not can access the file .

    Current issues :
    - If the Zabbix services ( server and agent ) start with the system , I can not access or configure Zabbix Frontend .
    Code:
     Inventory Reports Configuration Administration
    Zabbix Server
    Overview | Hosts
    
    History : Configuration of hosts ' Dashboard ' Configuration of hosts ' Dashboard ' Host inventory
    sem_get ( ) : failed for key 0x7a020458 : Permission denied [ hosts.php : 22 → require_once ( ) → ZBase - > run () → ZBase - > initdb ( ) → DBConnect ( ) → init_sqlite3_access ( ) → sem_get ( ) in / var / www / zabbix / include / db.inc.php : 1222 ]
    sem_acquire ( ) expects parameter 1 to be resource , boolean Given [ hosts.php : 22 → require_once ( ) → ZBase - > run () → ZBase - > initdb ( ) → DBConnect ( ) → lock_sqlite3_access ( ) → sem_acquire ( ) in / var / www / zabbix / include / db.inc.php : 1233 ]
    sem_release ( ) expects parameter 1 to be resource , boolean Given [ hosts.php : 22 → require_once ( ) → ZBase - > run () → ZBase - > initdb ( ) → DBConnect ( ) → unlock_sqlite3_access ( ) → sem_release ( ) in / var / www / zabbix / include / db.inc.php : 1244 ]
    - It seems that there is competition for access to the data base zabbix.db SQLite , in some moments I notice that an error is as below indicating that the database is locked .

    Code:
     SQLite3 :: exec ( ) : database is locked [ dashboard.php : 21 → require_once ( ) → ZBase - > run () → ZBase - > AuthenticateUser ( ) → CWebUser :: checkAuthentication ( ) → CAPIObject - > checkAuthentication ( ) → CAPIObject - > __call ( ) → czbxrpc :: call ( ) → czbxrpc callAPI :: ( ) :: → czbxrpc transactionEnd ( ) → DBend ( ) → DBcommit ( ) → DBexecute ( ) → SQLite3 - > exec ( ) in / var / www / zabbix / include / db.inc.php : 570 ]
    Error in query [ COMMIT ] Error code [ 5 ] Message [database is locked ]
    
    SQLite3 :: exec ( ) : can not start the transaction Within a transaction [ dashboard.php : 282 make_sysmap_menu → ( ) → make_sysmap_submenu ( ) → CAPIObject -> get ( ) → CAPIObject - > __call ( ) → czbxrpc :: call ( ) → czbxrpc callAPI :: ( ) :: → czbxrpc transactionBegin ( ) → dbstart ( ) → DBexecute ( ) → SQLite3 - > exec ( ) in / var / www / zabbix / include / db.inc.php : 570 ]
    Error in query [ BEGIN ] Error code [ 1 ] Message [ can not start a transaction Within a transaction ]
    SQLite3 :: exec ( ) : database is locked [ dashboard.php : 491 → require_once ( ) → add_user_history ( ) → DBexecute ( ) → SQLite3 - > exec ( ) in / var / www / zabbix / include / db.inc.php : 570 ]
    Error in query [ UPDATE SET user_history title1 = title2 , url1 = url2 , title2 = TITLE3 , url2 = url3 , TITLE3 = TITLE4 , url3 = url4 , TITLE4 = TITLE5 , url4 = url5 , TITLE5 = ' Dashboard ' , url5 = ' dashboard . php 'WHERE userid = 1 ] Error code [ 5 ] Message [database is locked ]
    SQLite3 :: exec ( ) : database is locked [ dashboard.php : 491 → require_once ( ) → Cprofile :: flush ( ) → DBend ( ) → DBcommit ( ) → DBexecute ( ) → SQLite3 - > exec ( ) in / var / www / zabbix / include / db.inc.php : 570 ]
    Error in query [ COMMIT ] Error code [ 5 ] Message [database is locked ]
    I also can not add hosts to be monitored, the following error appears :

    Code:
     Incorrect value " " is unsigned int field " valuemapid ."
    I know that SQLite is just experimental , but would like help from you = ) .

    Thank you very much .

    Comment

    • Bosit
      Junior Member
      • Jan 2014
      • 11

      #3
      Hi Joao.

      I can see that you have implemented a Zabbix Server on a Raspberry with MySQL.

      Can you give me your proceed ?

      I tested and I can't install it.

      Thankx.

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        Code:
        sem_get ( ) : failed for key 0x7a020458 : Permission denied
        It looks that you have a problem with semaphores in PHP. Try to compile PHP with --enable-sysvsem:
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        • jlemes
          Junior Member
          • Dec 2013
          • 15

          #5
          Originally posted by Bosit
          Hi Joao.

          I can see that you have implemented a Zabbix Server on a Raspberry with MySQL.

          Can you give me your proceed ?

          I tested and I can't install it.

          Thankx.
          Hi Bosit,

          Well, I made the same procedure of normal installation of Zabbix.

          The documentation is on portuguese, but the Google Translate help =)

          Link:


          Any question please contact me.

          Comment

          • jlemes
            Junior Member
            • Dec 2013
            • 15

            #6
            Originally posted by jan.garaj
            Code:
            sem_get ( ) : failed for key 0x7a020458 : Permission denied
            It looks that you have a problem with semaphores in PHP. Try to compile PHP with --enable-sysvsem:
            http://uk1.php.net/manual/en/sem.installation.php
            Hi Jan,

            Thank you for helping, I will try this when have time.

            I will post the results here.

            Comment

            Working...