You have an error in your SQL syntax - NagiosQL

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
Shwele
Posts: 47
Joined: Tue Oct 03, 2017 3:00 am

You have an error in your SQL syntax - NagiosQL

Post by Shwele »

Hello guys, I finally am able to reset config with NagiosQL via interface, but I am unaware whenever this issue is alarming or not.

When I want to add new host/service/group on the bottom of page is written:

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 '`value' at line 4


Googling didn't help, neither searching here with this issue.

Also, another thing as a side question, I have installed nagios plugins, does it come with services or not? If you have some link/tutorial how to add needed services to nagios can you please guide me to it.

Thanks in advance.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: You have an error in your SQL syntax - NagiosQL

Post by npolovenko »

Run this command to repair MYSQL on your system: Replace the <usename> and <password> with valid entries.

Code: Select all

mysqlcheck -f -r -u <username> -p<password> --all-databases
If that doesn't work, run the command this way to rebuild the index.

Code: Select all

mysqlcheck -f -r -u <username> -p<password> --all-databases --use_frm
Let us know if that fixed it.

Now as far as your second question. When you install core, many standard plugins already have services defined for the localhost. So when you go to the web interface and click on services you'll see them already working. For other plugins, you usually need to create a service definition yourself. The easiest way to learn is to follow examples. You can find them in this folder: usr/local/nagios/etc/templates .Also, id recommend taking a look at usr/local/nagios/etc/nagios.cfg file.
You can also read this documentation:
https://assets.nagios.com/downloads/nag ... tions.html
And, if you have a particular plugin in mind we can help you create a service definition as well.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Shwele
Posts: 47
Joined: Tue Oct 03, 2017 3:00 am

Re: You have an error in your SQL syntax - NagiosQL

Post by Shwele »

Heya @npolovenko, sorry for slow response, workload sometimes gets me.

Here is the output from first command:

Code: Select all

db_nagiosql_v33.tbl_command                        OK
db_nagiosql_v33.tbl_configtarget                   OK
db_nagiosql_v33.tbl_contact                        OK
db_nagiosql_v33.tbl_contactgroup                   OK
db_nagiosql_v33.tbl_contacttemplate                OK
db_nagiosql_v33.tbl_datadomain                     OK
db_nagiosql_v33.tbl_group                          OK
db_nagiosql_v33.tbl_host                           OK
db_nagiosql_v33.tbl_hostdependency                 OK
db_nagiosql_v33.tbl_hostescalation                 OK
db_nagiosql_v33.tbl_hostextinfo                    OK
db_nagiosql_v33.tbl_hostgroup                      OK
db_nagiosql_v33.tbl_hosttemplate                   OK
db_nagiosql_v33.tbl_info                           OK
db_nagiosql_v33.tbl_language                       OK
db_nagiosql_v33.tbl_lnkContactToCommandHost        OK
db_nagiosql_v33.tbl_lnkContactToCommandService     OK
db_nagiosql_v33.tbl_lnkContactToContactgroup       OK
db_nagiosql_v33.tbl_lnkContactToContacttemplate    OK
db_nagiosql_v33.tbl_lnkContactToVariabledefinition OK
db_nagiosql_v33.tbl_lnkContactgroupToContact       OK
db_nagiosql_v33.tbl_lnkContactgroupToContactgroup  OK
db_nagiosql_v33.tbl_lnkContacttemplateToCommandHost OK
db_nagiosql_v33.tbl_lnkContacttemplateToCommandService OK
db_nagiosql_v33.tbl_lnkContacttemplateToContactgroup OK
db_nagiosql_v33.tbl_lnkContacttemplateToContacttemplate OK
db_nagiosql_v33.tbl_lnkContacttemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkGroupToUser                 OK
db_nagiosql_v33.tbl_lnkHostToContact               OK
db_nagiosql_v33.tbl_lnkHostToContactgroup          OK
db_nagiosql_v33.tbl_lnkHostToHost                  OK
db_nagiosql_v33.tbl_lnkHostToHostgroup             OK
db_nagiosql_v33.tbl_lnkHostToHosttemplate          OK
db_nagiosql_v33.tbl_lnkHostToVariabledefinition    OK
db_nagiosql_v33.tbl_lnkHostdependencyToHost_DH     OK
db_nagiosql_v33.tbl_lnkHostdependencyToHost_H      OK
db_nagiosql_v33.tbl_lnkHostdependencyToHostgroup_DH OK
db_nagiosql_v33.tbl_lnkHostdependencyToHostgroup_H OK
db_nagiosql_v33.tbl_lnkHostescalationToContact     OK
db_nagiosql_v33.tbl_lnkHostescalationToContactgroup OK
db_nagiosql_v33.tbl_lnkHostescalationToHost        OK
db_nagiosql_v33.tbl_lnkHostescalationToHostgroup   OK
db_nagiosql_v33.tbl_lnkHostgroupToHost             OK
db_nagiosql_v33.tbl_lnkHostgroupToHostgroup        OK
db_nagiosql_v33.tbl_lnkHosttemplateToContact       OK
db_nagiosql_v33.tbl_lnkHosttemplateToContactgroup  OK
db_nagiosql_v33.tbl_lnkHosttemplateToHost          OK
db_nagiosql_v33.tbl_lnkHosttemplateToHostgroup     OK
db_nagiosql_v33.tbl_lnkHosttemplateToHosttemplate  OK
db_nagiosql_v33.tbl_lnkHosttemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkServiceToContact            OK
db_nagiosql_v33.tbl_lnkServiceToContactgroup       OK
db_nagiosql_v33.tbl_lnkServiceToHost               OK
db_nagiosql_v33.tbl_lnkServiceToHostgroup          OK
db_nagiosql_v33.tbl_lnkServiceToServicegroup       OK
db_nagiosql_v33.tbl_lnkServiceToServicetemplate    OK
db_nagiosql_v33.tbl_lnkServiceToVariabledefinition OK
db_nagiosql_v33.tbl_lnkServicedependencyToHost_DH  OK
db_nagiosql_v33.tbl_lnkServicedependencyToHost_H   OK
db_nagiosql_v33.tbl_lnkServicedependencyToHostgroup_DH OK
db_nagiosql_v33.tbl_lnkServicedependencyToHostgroup_H OK
db_nagiosql_v33.tbl_lnkServicedependencyToService_DS OK
db_nagiosql_v33.tbl_lnkServicedependencyToService_S OK
db_nagiosql_v33.tbl_lnkServicedependencyToServicegroup_DS OK
db_nagiosql_v33.tbl_lnkServicedependencyToServicegroup_S OK
db_nagiosql_v33.tbl_lnkServiceescalationToContact  OK
db_nagiosql_v33.tbl_lnkServiceescalationToContactgroup OK
db_nagiosql_v33.tbl_lnkServiceescalationToHost     OK
db_nagiosql_v33.tbl_lnkServiceescalationToHostgroup OK
db_nagiosql_v33.tbl_lnkServiceescalationToService  OK
db_nagiosql_v33.tbl_lnkServiceescalationToServicegroup OK
db_nagiosql_v33.tbl_lnkServicegroupToService       OK
db_nagiosql_v33.tbl_lnkServicegroupToServicegroup  OK
db_nagiosql_v33.tbl_lnkServicetemplateToContact    OK
db_nagiosql_v33.tbl_lnkServicetemplateToContactgroup OK
db_nagiosql_v33.tbl_lnkServicetemplateToHost       OK
db_nagiosql_v33.tbl_lnkServicetemplateToHostgroup  OK
db_nagiosql_v33.tbl_lnkServicetemplateToServicegroup OK
db_nagiosql_v33.tbl_lnkServicetemplateToServicetemplate OK
db_nagiosql_v33.tbl_lnkServicetemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkTimeperiodToTimeperiod      OK
db_nagiosql_v33.tbl_lnkTimeperiodToTimeperiodUse   OK
db_nagiosql_v33.tbl_logbook                        OK
db_nagiosql_v33.tbl_menu                           OK
db_nagiosql_v33.tbl_relationinformation            OK
db_nagiosql_v33.tbl_service                        OK
db_nagiosql_v33.tbl_servicedependency              OK
db_nagiosql_v33.tbl_serviceescalation              OK
db_nagiosql_v33.tbl_serviceextinfo                 OK
db_nagiosql_v33.tbl_servicegroup                   OK
db_nagiosql_v33.tbl_servicetemplate                OK
db_nagiosql_v33.tbl_settings                       OK
db_nagiosql_v33.tbl_tablestatus                    OK
db_nagiosql_v33.tbl_timedefinition                 OK
db_nagiosql_v33.tbl_timeperiod                     OK
db_nagiosql_v33.tbl_user                           OK
db_nagiosql_v33.tbl_variabledefinition             OK
All seems well and ok, doesn't seem to need fixing but I ran it anyhow to reindex it. Output bellow as well:

Code: Select all

warning  : Number of rows changed from 0 to 24
status   : OK
db_nagiosql_v33.tbl_configtarget
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_contact
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_contactgroup
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_contacttemplate
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_datadomain
warning  : Number of rows changed from 0 to 2
status   : OK
db_nagiosql_v33.tbl_group                          OK
db_nagiosql_v33.tbl_host
warning  : Number of rows changed from 0 to 3
status   : OK
db_nagiosql_v33.tbl_hostdependency                 OK
db_nagiosql_v33.tbl_hostescalation                 OK
db_nagiosql_v33.tbl_hostextinfo                    OK
db_nagiosql_v33.tbl_hostgroup
warning  : Number of rows changed from 0 to 4
status   : OK
db_nagiosql_v33.tbl_hosttemplate
warning  : Number of rows changed from 0 to 5
status   : OK
db_nagiosql_v33.tbl_info
warning  : Number of rows changed from 0 to 236
status   : OK
db_nagiosql_v33.tbl_language
warning  : Number of rows changed from 0 to 10
status   : OK
db_nagiosql_v33.tbl_lnkContactToCommandHost        OK
db_nagiosql_v33.tbl_lnkContactToCommandService     OK
db_nagiosql_v33.tbl_lnkContactToContactgroup       OK
db_nagiosql_v33.tbl_lnkContactToContacttemplate
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkContactToVariabledefinition OK
db_nagiosql_v33.tbl_lnkContactgroupToContact
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkContactgroupToContactgroup  OK
db_nagiosql_v33.tbl_lnkContacttemplateToCommandHost
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkContacttemplateToCommandService
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkContacttemplateToContactgroup OK
db_nagiosql_v33.tbl_lnkContacttemplateToContacttemplate OK
db_nagiosql_v33.tbl_lnkContacttemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkGroupToUser                 OK
db_nagiosql_v33.tbl_lnkHostToContact               OK
db_nagiosql_v33.tbl_lnkHostToContactgroup          OK
db_nagiosql_v33.tbl_lnkHostToHost                  OK
db_nagiosql_v33.tbl_lnkHostToHostgroup
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkHostToHosttemplate
warning  : Number of rows changed from 0 to 3
status   : OK
db_nagiosql_v33.tbl_lnkHostToVariabledefinition    OK
db_nagiosql_v33.tbl_lnkHostdependencyToHost_DH     OK
db_nagiosql_v33.tbl_lnkHostdependencyToHost_H      OK
db_nagiosql_v33.tbl_lnkHostdependencyToHostgroup_DH OK
db_nagiosql_v33.tbl_lnkHostdependencyToHostgroup_H OK
db_nagiosql_v33.tbl_lnkHostescalationToContact     OK
db_nagiosql_v33.tbl_lnkHostescalationToContactgroup OK
db_nagiosql_v33.tbl_lnkHostescalationToHost        OK
db_nagiosql_v33.tbl_lnkHostescalationToHostgroup   OK
db_nagiosql_v33.tbl_lnkHostgroupToHost
warning  : Number of rows changed from 0 to 3
status   : OK
db_nagiosql_v33.tbl_lnkHostgroupToHostgroup        OK
db_nagiosql_v33.tbl_lnkHosttemplateToContact       OK
db_nagiosql_v33.tbl_lnkHosttemplateToContactgroup
warning  : Number of rows changed from 0 to 4
status   : OK
db_nagiosql_v33.tbl_lnkHosttemplateToHost          OK
db_nagiosql_v33.tbl_lnkHosttemplateToHostgroup
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkHosttemplateToHosttemplate
warning  : Number of rows changed from 0 to 4
status   : OK
db_nagiosql_v33.tbl_lnkHosttemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkServiceToContact            OK
db_nagiosql_v33.tbl_lnkServiceToContactgroup       OK
db_nagiosql_v33.tbl_lnkServiceToHost
warning  : Number of rows changed from 0 to 19
status   : OK
db_nagiosql_v33.tbl_lnkServiceToHostgroup          OK
db_nagiosql_v33.tbl_lnkServiceToServicegroup       OK
db_nagiosql_v33.tbl_lnkServiceToServicetemplate
warning  : Number of rows changed from 0 to 19
status   : OK
db_nagiosql_v33.tbl_lnkServiceToVariabledefinition OK
db_nagiosql_v33.tbl_lnkServicedependencyToHost_DH  OK
db_nagiosql_v33.tbl_lnkServicedependencyToHost_H   OK
db_nagiosql_v33.tbl_lnkServicedependencyToHostgroup_DH OK
db_nagiosql_v33.tbl_lnkServicedependencyToHostgroup_H OK
db_nagiosql_v33.tbl_lnkServicedependencyToService_DS OK
db_nagiosql_v33.tbl_lnkServicedependencyToService_S OK
db_nagiosql_v33.tbl_lnkServicedependencyToServicegroup_DS OK
db_nagiosql_v33.tbl_lnkServicedependencyToServicegroup_S OK
db_nagiosql_v33.tbl_lnkServiceescalationToContact  OK
db_nagiosql_v33.tbl_lnkServiceescalationToContactgroup OK
db_nagiosql_v33.tbl_lnkServiceescalationToHost     OK
db_nagiosql_v33.tbl_lnkServiceescalationToHostgroup OK
db_nagiosql_v33.tbl_lnkServiceescalationToService  OK
db_nagiosql_v33.tbl_lnkServiceescalationToServicegroup OK
db_nagiosql_v33.tbl_lnkServicegroupToService       OK
db_nagiosql_v33.tbl_lnkServicegroupToServicegroup  OK
db_nagiosql_v33.tbl_lnkServicetemplateToContact    OK
db_nagiosql_v33.tbl_lnkServicetemplateToContactgroup
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkServicetemplateToHost       OK
db_nagiosql_v33.tbl_lnkServicetemplateToHostgroup  OK
db_nagiosql_v33.tbl_lnkServicetemplateToServicegroup OK
db_nagiosql_v33.tbl_lnkServicetemplateToServicetemplate
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_lnkServicetemplateToVariabledefinition OK
db_nagiosql_v33.tbl_lnkTimeperiodToTimeperiod      OK
db_nagiosql_v33.tbl_lnkTimeperiodToTimeperiodUse
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_logbook
warning  : Number of rows changed from 0 to 304
status   : OK
db_nagiosql_v33.tbl_menu
warning  : Number of rows changed from 0 to 40
status   : OK
db_nagiosql_v33.tbl_relationinformation
warning  : Number of rows changed from 0 to 244
status   : OK
db_nagiosql_v33.tbl_service
warning  : Number of rows changed from 0 to 19
status   : OK
db_nagiosql_v33.tbl_servicedependency              OK
db_nagiosql_v33.tbl_serviceescalation              OK
db_nagiosql_v33.tbl_serviceextinfo                 OK
db_nagiosql_v33.tbl_servicegroup                   OK
db_nagiosql_v33.tbl_servicetemplate
warning  : Number of rows changed from 0 to 2
status   : OK
db_nagiosql_v33.tbl_settings
warning  : Number of rows changed from 0 to 19
status   : OK
db_nagiosql_v33.tbl_tablestatus
warning  : Number of rows changed from 0 to 2
status   : OK
db_nagiosql_v33.tbl_timedefinition
warning  : Number of rows changed from 0 to 24
status   : OK
db_nagiosql_v33.tbl_timeperiod
warning  : Number of rows changed from 0 to 5
status   : OK
db_nagiosql_v33.tbl_user
warning  : Number of rows changed from 0 to 1
status   : OK
db_nagiosql_v33.tbl_variabledefinition             OK
Same error at the bottom in red persists even after running those 2 commands. As you can see in provided pics:
https://imgur.com/a/l3SQj

If you need nagios.cfg or additional info, let me know.

As for services...
Thing is I have disabled localhost and followed guide to set everything up in /etc/nagiosql/ folder.
As for the folder I only have:

Code: Select all

cgi.cfg  htpasswd.users  nagios.cfg  objects  resource.cfg
That is great that you are willing to help that much, I will look it up asap to prepare for next reply. Also read that documentation you shared with me.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: You have an error in your SQL syntax - NagiosQL

Post by npolovenko »

@Shwele, Yeah, you could use something like WinSCP to get the whole /usr/local/nagios/etc folder and then zip it and upload here, or pm it to me. Can you also share links to manuals that you've used to install Nagios Core and Nagios QL? Finally, please upload these two log files:

Code: Select all

/usr/local/nagios/var/nagios.log
/var/log/httpd/error_log
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Shwele
Posts: 47
Joined: Tue Oct 03, 2017 3:00 am

Re: You have an error in your SQL syntax - NagiosQL

Post by Shwele »

@npolovenko Sure thing, added it as attachment.
etc.rar
/usr/local/nagios/etc folder
(28 KiB) Downloaded 224 times
For manuals, for nagios I used this one:
https://support.nagios.com/kb/article/n ... tml#Ubuntu
As well for latest plugins.

For NagiosQL I mostly used this video even tho I dont speak Spanish, due that documentation was somewhat confusing and I couln't get it to work.
https://youtu.be/zLGFBZrYAC4?t=15m56s

Error log doesn't contain nagios issues, grepped for nagios due that its staging server used for other things. And the output is empty.

Nagios log in attachment as well.
Attachments
nagios_log.log
nagios log
(128.71 KiB) Downloaded 589 times
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: You have an error in your SQL syntax - NagiosQL

Post by npolovenko »

@Shwele, What version of PHP, MYSQL are you running? And what's your operating System? Can you also run:

Code: Select all

tail -f /var/log/httpd/error_log 
And while this command runs try applying the configuration that was giving you errors. Show us the output from the log file.

Does it say in a web interface what version of Nagios QL you're running? It could be that your Nagios Core is using a newer version of PHP and it's modules than Nagios QL supports. I believe Nagios QL was discontinued and hasn't been updated for a while.
If you determine that your NagiosQL version is below 3.3.0, i'd recommend to install the latest version from here:
https://sourceforge.net/projects/nagios ... /nagiosql/ And you can find installation instructions in a doc folder.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Shwele
Posts: 47
Joined: Tue Oct 03, 2017 3:00 am

Re: You have an error in your SQL syntax - NagiosQL

Post by Shwele »

@npolovenko here ya go PHP:

Code: Select all

PHP 5.6.31-6+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
Here is list of mysql packages:

Code: Select all

ii  dbconfig-mysql                      2.0.4ubuntu1                                             all          dbconfig-common MySQL/MariaDB support
rc  libmysqlclient18:amd64              5.6.30-0ubuntu0.15.10.1                                  amd64        MySQL database client library
ii  mysql-client                        5.7.19-0ubuntu0.16.04.1                                  all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.7                    5.7.19-0ubuntu0.16.04.1                                  amd64        MySQL database client binaries
ii  mysql-client-core-5.7               5.7.19-0ubuntu0.16.04.1                                  amd64        MySQL database core client binaries
ii  mysql-common                        5.7.19-0ubuntu0.16.04.1                                  all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                        5.7.19-0ubuntu0.16.04.1                                  all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.7                    5.7.19-0ubuntu0.16.04.1                                  amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.7               5.7.19-0ubuntu0.16.04.1                                  amd64        MySQL database server binaries
ii  php5.6-mysql                        5.6.31-6+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
ii  php7.0-mysql                        7.0.24-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
Error log is empty, but here is nagios error when I try to add new host, I used test and put 192.168.1.1 IP for test purposes of creating it.
When I try to restart config via nagios control:

Code: Select all

Error: Invalid max_check_attempts value for host 'test'
Error: Could not register host (config file '/etc/nagiosql/hosts/test.cfg', starting on line 14)

Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Invalid max_check_attempts value for host 'test'
Error: Could not register host (config file '/etc/nagiosql/hosts/test.cfg', starting on line 14)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
After trying to restart it from command line it also fails. Here is that new host file:

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.3.0
# Date:       2017-10-18 14:01:43
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define host {
        host_name                       test
        alias                           test
        address                         192.168.1.1
        register                        1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
I am running 3.3.0 NagiosQL version. Nagios version is nagios-4.3.4 . Yes, I am aware that, what are my options for other nagios managements via web interface? For now Im trying to set it up with ease and then bother when I have time for more complex stuff.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: You have an error in your SQL syntax - NagiosQL

Post by npolovenko »

@Shwele, Make sure that when you add a new host you fill out all the necessary fields in check_settings and alarm settings tabs.
screen1.png
screenshot-192.168.4.195-2017-10-18-12-46-06-594.png
After you make these edits resave the configuration. Make sure that your test host gets actually added to /usr/local/nagios/
Also, make sure that your localhost config target has the right destinations set up. They have to match paths on your system.
screenshot-192.168.4.195-2017-10-18-12-51-00-832.png
You might need to import timeperiods.cfg in Tools/DataImport.


As far as your MYSQL error, we were unable to replicate it. We followed this tutorial: https://tecadmin.net/install-nagiosql-w ... ntos-rhel/ But we used CentOS for our installation.

My personal recommendation would be to manually copy, modify and paste new hosts configurations into the right files in core. You don't really need to use NagiosQL unless your organisation has thousands of machines. At that point you might try Nagios XI which has a Core Configurations Manager which is a big step forward from NagiosQL.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Shwele
Posts: 47
Joined: Tue Oct 03, 2017 3:00 am

Re: You have an error in your SQL syntax - NagiosQL

Post by Shwele »

@npolovenko Looks like that was what was lacking, check_settings for the host itself, totally forgot about that.

I tried it as well, left the default database name. Its a petty error so I will return to this topic in case it is troublesome. It just seems like some calling is wrong in syntax but it doesn't quite affect it.

I have number of services when I go to supervision > services but when I open any of the example hosts , their service settings list is empty, even thought clearly they do exist!

This is what I have in relation data bellow:

Code: Select all

Relation to tbl_hostgroup, entry linux-servers - deletion possible
Relation to tbl_hosttemplate, entry linux-server - deletion possible
Relation to tbl_service, entry localhost-Total Processes - deletion not possible
Relation to tbl_service, entry localhost-Swap Usage - deletion not possible
Relation to tbl_service, entry localhost-SSH - deletion not possible
Relation to tbl_service, entry localhost-Root Partition - deletion not possible
Relation to tbl_service, entry localhost-PING - deletion not possible
Relation to tbl_service, entry localhost-HTTP - deletion not possible
Relation to tbl_service, entry localhost-Current Users - deletion not possible
Relation to tbl_service, entry localhost-Current Load - deletion not possible
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: You have an error in your SQL syntax - NagiosQL

Post by npolovenko »

@Shwele, Did you create new services through Nagios QL or did you import them from Nagios Core using the data import tool? I think the problem can be caused by wrong configuration paths. You should go over every line in that menu and make sure that all the paths are set up right for your particular system.
screenshot-192.168.4.195-2017-10-18-12-51-00-832.png
If you take a look at my host and service directory, it says /usr/local/nagios/etc/hosts and /usr/local/nagios/etc/services.
I had to add these to lines in nagios.cfg:

Code: Select all

cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/services
Than i imported localshot services from Nagios Core using the import tool.

Your issue could be caused by a lot of things. You should go to /var/log/ and look through all logs to see if you can find something.

If you'd like you can escalate this issue to our support techs by emailing to customersupport@nagios.com
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked