Menu

MYSQL

Help
2009-06-30
2013-04-17
  • Michael Gordon

    Michael Gordon - 2009-06-30

    Has anyone gotten past the mysql part of the install? I have been able to:
    1. Create the events database
    2. Create the e table under the events database
    3. Grant the permissions
    But once I get to the triggers section, I am getting SQL Syntax errors. Here is the output:

       Welcome to the MySQL monitor.  Commands end with ; or \g.
       Your MySQL connection id is 3835
       Server version: 5.0.45 Source distribution

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

       mysql> create database events;
       Query OK, 1 row affected (0.01 sec)

       mysql> connect events
       Connection id:    3836
       Current database: events

       mysql> create trigger chu after update on nagios_hoststatus for each row begin replace into events.e  select new.host_object_id, now();
       ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

    Any help would be appreciated.

     
    • Michael Gordon

      Michael Gordon - 2009-06-30

      Nevermind. I got it. It was the structure. It should look more like this:

      mysql> create database events;
      mysql> connect events;
      mysql> create table e (object_id int(11) not null, status_update_time datetime, primary key(object_id));
      mysql> grant select on events.e to 'ndoutils'@'localhost';
      mysql> connect nagios;
      mysql> create trigger chu after update on nagios_hoststatus
                  for each row begin
                  replace into events.e select new.host_object_id, now();
                  end;
      mysql> create trigger csu after update on nagios_servicestatus
                  for each row begin
                  replace into events.e select new.service_object_id, now();
                  end;

       
    • Jens Friedrichs

      Jens Friedrichs - 2009-07-03

      Hi Michael

      I got over this part as well but the Birdseye didn´t show anything :(
      I tried nearly all databases and didnt get an error in the logs but i cant see anythin but a blackscreen with the 2 empty ticker

      mfg Jens

       
      • Michael Gordon

        Michael Gordon - 2009-07-14

        What is the database name that you created for ndoutils? In my case, I created "nagios", however, the code here is calling for "ndoutils". I had to change the code in backend.php to reflect that difference.

         
      • Michael Gordon

        Michael Gordon - 2009-07-14

        OK...It has something to do with the comments on the code. Go into each piece of code and remove the comments at the beginning...and more importantly, make sure that is no space or empty lines at the very tops of those files.

         
  • Jeroen Claeys

    Jeroen Claeys - 2010-01-14

    Hi Jens

    In case you haven't been able to solve this problem: use the firebug add-on for firefox. It will show you any errors created by the programming code.

    Greetings,
    Jeroen

     

Log in to post a comment.