Problem with NDOUtils

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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

ok, now I guess we need to see what you have configured in the nagios.cfg for the neb module

Run the following replacing /usr/local/nagios/etc/nagios.cfg with the path to your magios.cfg

Code: Select all

 grep ndomod.cfg /usr/local/nagios/etc/nagios.cfg
Then please attach the ndomod.cfg attached.

We are going to also want to open that file and make sure the ndo.sock is accessible by the ndo2db daemon and matches what is in the ndo2db.cfg you sent earlier
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:ok, now I guess we need to see what you have configured in the nagios.cfg for the neb module

Run the following replacing /usr/local/nagios/etc/nagios.cfg with the path to your magios.cfg

Code: Select all

 grep ndomod.cfg /usr/local/nagios/etc/nagios.cfg
Then please attach the ndomod.cfg attached.

We are going to also want to open that file and make sure the ndo.sock is accessible by the ndo2db daemon and matches what is in the ndo2db.cfg you sent earlier
I am already verified the path was correctly

Code: Select all

grep ndomod.cfg /etc/nagios/nagios.cfg
broker_module=/usr/lib64/nagios/brokers/ndomod.so config_file=/etc/nagios/ndomod.cfg

Code: Select all

[centos@ip-10-0-8-150 ~]$ cat /etc/nagios/ndomod.cfg
#####################################################################
# NDOMOD CONFIG FILE
#
# Last Modified: 09-05-2007
#####################################################################


# INSTANCE NAME
# This option identifies the "name" associated with this particular
# instance of Nagios and is used to seperate data coming from multiple
# instances.  Defaults to 'default' (without quotes).

instance_name=default



# OUTPUT TYPE
# This option determines what type of output sink the NDO NEB module
# should use for data output.  Valid options include:
#   file       = standard text file
#   tcpsocket  = TCP socket
#   unixsocket = UNIX domain socket (default)

#output_type=file
#output_type=tcpsocket
output_type=unixsocket



# OUTPUT
# This option determines the name and path of the file or UNIX domain
# socket to which output will be sent if the output type option specified
# above is "file" or "unixsocket", respectively.  If the output type
# option is "tcpsocket", this option is used to specify the IP address
# of fully qualified domain name of the host that the module should
# connect to for sending output.

#output=/var/run/ndoutils/ndo2db.dat
#output=127.0.0.1
output=/var/run/ndoutils/ndo2db.sock



# TCP PORT
# This option determines what port the module will connect to in
# order to send output.  This option is only valid if the output type
# option specified above is "tcpsocket".

tcp_port=5668



# ENCRYPTION
# This option determines if the module will use 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



# OUTPUT BUFFER
# This option determines the size of the output buffer, which will help
# prevent data from getting lost if there is a temporary disconnect from
# the data sink.  The number of items specified here is the number of
# lines (each of variable size) of output that will be buffered.

output_buffer_items=5000



# BUFFER FILE
# This option is used to specify a file which will be used to store the
# contents of buffered data which could not be sent to the NDO2DB daemon
# before Nagios shuts down.  Prior to shutting down, the NDO NEB module
# will write all buffered data to this file for later processing.  When
# Nagios (re)starts, the NDO NEB module will read the contents of this
# file and send it to the NDO2DB daemon for processing.

buffer_file=/var/cache/ndoutils/ndomod.tmp



# FILE ROTATION INTERVAL
# This option determines how often (in seconds) the output file is
# rotated by Nagios.  File rotation is handled by Nagios by executing
# the command defined by the file_rotation_command option.  This
# option has no effect if the output_type option is a socket.

file_rotation_interval=14400



# FILE ROTATION COMMAND
# This option specified the command (as defined in Nagios) that is
# used to rotate the output file at the interval specified by the
# file_rotation_interval option.  This option has no effect if the
# output_type option is a socket.
#
# See the file 'misccommands.cfg' for an example command definition
# that you can use to rotate the log file.

#file_rotation_command=rotate_ndo_log



# FILE ROTATION TIMEOUT
# This option specified the maximum number of seconds that the file
# rotation command should be allowed to run before being prematurely
# terminated.

file_rotation_timeout=60



# RECONNECT INTERVAL
# This option determines how often (in seconds) that the NDO NEB
# module will attempt to re-connect to the output file or socket if
# a connection to it is lost.

reconnect_interval=15



# RECONNECT WARNING INTERVAL
# This option determines how often (in seconds) a warning message will
# be logged to the Nagios log file if a connection to the output file
# or socket cannot be re-established.

reconnect_warning_interval=15
#reconnect_warning_interval=900



# DATA PROCESSING OPTIONS
# These options determine what data the NDO NEB Module will process
#
acknowledgement_data=1
adaptive_contact_data=1
adaptive_host_data=1
adaptive_program_data=1
adaptive_service_data=1
aggregated_status_data=1
comment_data=1
contact_status_data=1
downtime_data=1
event_handler_data=1
external_command_data=1
flapping_data=1
host_check_data=1
host_status_data=1
log_data=1
main_config_data=1
notification_data=1
object_config_data=1
process_data=1
program_status_data=1
retention_data=1
service_check_data=1
service_status_data=1
state_change_data=1
system_command_data=1
timed_event_data=1


# CONFIG OUTPUT OPTION
# This option determines what types of configuration data the NDO
# NEB module will dump from Nagios.  Values can be OR'ed together.
# Values:
#         0 = Don't dump any configuration information
#         1 = Dump only original config (from config files)
#         2 = Dump config only after retained information has been restored
#         3 = Dump both original and retained configuration

config_output_options=2
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

Do you know what version of Core and ndoutils you are running?

How were they installed?

This line makes me think it is quite old

Code: Select all

Last Modified: 09-05-2007
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:Do you know what version of Core and ndoutils you are running?

How were they installed?

This line makes me think it is quite old

Code: Select all

Last Modified: 09-05-2007

Code: Select all

NDO2DB 2.1.2n
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 2005-2008 Ethan Galstad
Last Modified: 11-14-2016
License: GPL v2

Stores Nagios event and configuration data to a database for later retrieval
and processing.  Clients that are capable of sending data to the NDO2DB daemon
include the LOG2NDO utility and NDOMOD event broker module.

Code: Select all

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Problem with NDOUtils

Post by dwhitfield »

What's the output of:

Code: Select all

sestatus
cat /etc/*-release
?

Can you post your /etc/sudoers?
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

dwhitfield wrote:What's the output of:

Code: Select all

sestatus
cat /etc/*-release
?

Can you post your /etc/sudoers?

Code: Select all

[centos@ip-10-0-8-150 ~]$ sestatus
SELinux status:                 disabled

Code: Select all

[centos@ip-10-0-8-150 ~]$ cat /etc/*-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)

Code: Select all

[root@ip-10-0-8-150 centos]# cat /etc/sudoers
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias     FILESERVERS = fs1, fs2
# Host_Alias     MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem


## Command Aliases
## These are groups of related commands...

## Networking
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable

## Updating the locate database
# Cmnd_Alias LOCATE = /usr/bin/updatedb

## Storage
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
# Cmnd_Alias DRIVERS = /sbin/modprobe

# Defaults specification

#
# Refuse to run if unable to disable echo on the tty.
#
Defaults   !visiblepw

#
# Preserving HOME has security implications since many programs
# use it when searching for configuration files. Note that HOME
# is already set when the the env_reset option is enabled, so
# this option is only effective for configurations where either
# env_reset is disabled or HOME is present in the env_keep list.
#
Defaults    always_set_home

Defaults    env_reset
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"

#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
#
# Defaults   env_keep += "HOME"

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin

## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
##      user    MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Problem with NDOUtils

Post by dwhitfield »

Are you able to upgrade to the latest version? It doesn't look like this is directly related to the 2.1.3 fixes, but if this is a bug, it would be great to see if this exists in the latest version. Please see https://github.com/NagiosEnterprises/nd ... /UPGRADING

I am wondering if this might be related to the following, although it isn't exactly what you are seeing:
In three places, ndomod was freeing a buffer before it was done using it causing nagios to crash under certain circumstances
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

dwhitfield wrote:Are you able to upgrade to the latest version? It doesn't look like this is directly related to the 2.1.3 fixes, but if this is a bug, it would be great to see if this exists in the latest version. Please see https://github.com/NagiosEnterprises/nd ... /UPGRADING

I am wondering if this might be related to the following, although it isn't exactly what you are seeing:
In three places, ndomod was freeing a buffer before it was done using it causing nagios to crash under certain circumstances
Im executing the script but it failed

Code: Select all

[root@ip-10-0-8-150 db]# ./upgradedb -u xxxx -p xxxxxx -h localhost -d xxxxx
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
 at ./upgradedb line 41.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

We need to install the package

Code: Select all

yum install perl-DBD-MySQL -y
Then try to perform the command again
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:We need to install the package

Code: Select all

yum install perl-DBD-MySQL -y
Then try to perform the command again
I installed the package required but I have another problem.

Code: Select all

[root@ip-10-0-8-150 db]# ./upgradedb -u xxxx -p xxxxx -h localhost -d xxxx
Current database version: 1.4b2
** DB upgrade required for 1.4b3
     Using mysql-upgrade-1.4b3.sql for upgrade...
ERROR 1064 (42000) at line 63: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TYPE = innodb' at line 1
Upgrade from mysql-upgrade-1.4b3.sql failed at ./upgradedb line 106.
Locked