problem installing ndo2db/ndoutils on nagios 3.2.3

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.
Locked
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

problem installing ndo2db/ndoutils on nagios 3.2.3
I followed the instruction on
http://exchange.nagios.org/directory/Ad ... er/details
my machine is ubuntu the latest version.
in /var/nagios/nagios.log
i get
ndomod: Still unable to connect to data sink. 0 items lost, 26252 queued items to flush.
which means ndoutils are not functioning correctly.
also ndo.sock is not being created.
any help on this?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by scottwilkerson »

Is ndo2db running?
Is mysql running?

Do you have correct mysql server connect info in ndo2db.cfg?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

Code: Select all

root@oversun:~# service mysql status
mysql start/running, process 30189

root@oversun:~# /etc/init.d/ndoutils restart
Restarting ndoutils: ndoutils.
ndoutils.
root@oversun:~# service ndoutils status
Usage: /etc/init.d/ndoutils {start|stop|restart|force-reload}


below is the the configuration of  /etc/nagios3/ndo2db.cfg
p.s ndo.sock is not being created



#####################################################################
# NDO2DB DAEMON CONFIG FILE
#
# Last Modified: 01-02-2009
#####################################################################



# LOCK FILE
# This is the lockfile that NDO2DB will use to store its PID number
# in when it is running in daemon mode.

lock_file=/var/cache/nagios3/ndo2db.lock



# USER/GROUP PRIVILIGES
# These options determine the user/group that the daemon should run as.
# You can specify a number (uid/gid) or a name for either option.

ndo2db_user=patrol
ndo2db_group=produit



# SOCKET TYPE
# This option determines what type of socket the daemon will create
# an accept connections from.
# Value:
#   unix = Unix domain socket (default)
#   tcp  = TCP socket

socket_type=unix
#socket_type=tcp



# SOCKET NAME
# This option determines the name and path of the UNIX domain 
# socket that the daemon will create and accept connections from.
# This option is only valid if the socket type specified above
# is "unix".

socket_name=/var/cache/nagios3/ndo.sock



# TCP PORT
# This option determines what port the daemon will listen for
# connections on.  This option is only vlaid if the socket type
# specified above is "tcp".

tcp_port=5668



# ENCRYPTION
# This option determines if the ndo2db daemon will accept SSL to encrypt the 
# network traffic between module and ndo2db daemon.
# Both sides have to enable this feature which depends on SSL Libraries
# like openssl or kerberos 
# This option is only valid if the output type
# option specified above is "tcpsocket".
#
# A value of '1' will enable this feature

use_ssl=0



# DATABASE SERVER TYPE
# This option determines what type of DB server the daemon should
# connect to.
# Values:
# 	mysql = MySQL
#       pgsql = PostgreSQL

db_servertype=mysql



# DATABASE HOST
# This option specifies what host the DB server is running on.

db_host=localhost



# DATABASE PORT
# This option specifies the port that the DB server is running on.
# Values:
# 	3306 = Default MySQL port
#	5432 = Default PostgreSQL port

db_port=3306



# DATABASE NAME
# This option specifies the name of the database that should be used.

db_name=nagios



# DATABASE TABLE PREFIX
# Determines the prefix (if any) that should be prepended to table names.
# If you modify the table prefix, you'll need to modify the SQL script for
# creating the database!

db_prefix=nagios_



# DATABASE USERNAME/PASSWORD
# This is the username/password that will be used to authenticate to the DB.
# The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on
# the database.

db_user=ndoutils
db_pass=correctpaasword



## TABLE TRIMMING OPTIONS
# Several database tables containing Nagios event data can become quite large
# over time.  Most admins will want to trim these tables and keep only a
# certain amount of data in them.  The options below are used to specify the
# age (in MINUTES) that data should be allowd to remain in various tables
# before it is deleted.  Using a value of zero (0) for any value means that
# that particular table should NOT be automatically trimmed.

# Keep timed events for 24 hours
max_timedevents_age=1440

# Keep system commands for 1 week
max_systemcommands_age=10080

# Keep service checks for 1 week
max_servicechecks_age=10080

# Keep host checks for 1 week
max_hostchecks_age=10080

# Keep event handlers for 31 days
max_eventhandlers_age=44640

# Keep external commands for 31 days
max_externalcommands_age=44640




# DEBUG LEVEL
# This option determines how much (if any) debugging information will
# be written to the debug file.  OR values together to log multiple
# types of information.
# Values: -1 = Everything
#          0 = Nothing
#          1 = Process info
#	   2 = SQL queries

debug_level=1



# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed

debug_verbosity=0



# DEBUG FILE
# This option determines where the daemon should write debugging information.

debug_file=/var/cache/nagios3/ndo2db.debug



# MAX DEBUG FILE SIZE
# This option determines the maximum size (in bytes) of the debug file.  If
# the file grows larger than this size, it will be renamed with a .old
# extension.  If a file already exists with a .old extension it will
# automatically be deleted.  This helps ensure your disk space usage doesn't
# get out of control when debugging.

max_debug_file_size=1000000
Moderator note: Use code tags when posting long output
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by lmiltchev »

Try stopping nagios and ndo2db, then run:

Code: Select all

/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
/etc/init.d/nagios start
Note: Adjust the paths if you need to.
Be sure to check out our Knowledgebase for helpful articles and solutions!
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

Good times of the day,
I stopped nagios and ndoutils
and ran the following:

Code: Select all

root@oversun:~# /usr/local/nagios/bin/ndo2db -c /etc/nagios3/ndo2db.cfg
Support for the specified database server is either not yet supported, or was not found on your system.
I presume this is something about the sql server?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

Can you post the of :

Code: Select all

cat /etc/my.cnf
ls -la $(grep "socket" /etc/my.cnf | sed 's/.*=//g')
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

root@oversun:~# cat /etc/my.cnf
cat: /etc/my.cnf: No such file or directory
root@oversun:~# ls -la $(grep "socket" /etc/my.cnf | sed 's/.*=//g')
grep: /etc/my.cnf: No such file or directory
total 36
drwx------ 4 root root 4096 Mar 10 17:45 .
drwxr-xr-x 23 root root 4096 Mar 8 15:31 ..
-rw------- 1 root root 4675 Mar 17 21:57 .bash_history
-rw-r--r-- 1 root root 3106 Apr 19 2012 .bashrc
drwx------ 3 root root 4096 Mar 11 18:19 .cache
-rw-r--r-- 1 root root 140 Apr 19 2012 .profile
drwx------ 2 root root 4096 Mar 14 06:17 .pulse
-rw------- 1 root root 256 Mar 8 14:48 .pulse-cookie
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

Is your my.cnf installed to a non standard location? Ndo reads this file for socket location and potentially port, etc among other things.
How was mysql installed? (repo, source, thrid party)?
What distribution are you running nagios on?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

I searched for my.cnf in /usr and in /etc. I did not find such a file. sql was installed when i typed in apted-get install ndoutils. It asked for a username and a password for the database and that's it. My distribution is mentioned in the first post.
What to do next?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

i found my.cnf in /etc/mysql

here is the content:

Code: Select all

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer		= 16M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit	= 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size         = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

[mysql]
#no-auto-rehash	# faster start of mysql but no tab completition

[isamchk]
key_buffer		= 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
Locked