Problem with nagios and 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.
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Problem with nagios and ndoutils

Post by eFusion »

Hi all!
Sorry for my english ))
I have a problem.
I have nagios 3.4.1 and ndoutils 2.0.0 from sourceforge. FreeBSD 9.1.
All installed without problems.
There is my configs:

ndo2db:

Code: Select all

lock_file=/usr/local/nagios/var/ndo2db.lock
ndo2db_user=nagios
ndo2db_group=nagios
socket_type=unix
#socket_type=tcp
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
db_servertype=mysql
db_host=localhost
db_port=3306
db_name=ndo_nagios
db_prefix=nagios_
db_user=ndo
db_pass=********
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
max_externalcommands_age=44640
max_notifications_age=44640
max_contactnotifications=44640
max_contactnotificationmethods=44640
max_logentries_age=129600
max_acknowledgements_age=44640
debug_level=2
debug_verbosity=2
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000
ndomod:

Code: Select all

instance_name=default
#output_type=file
#output_type=tcpsocket
output_type=unixsocket
#output=/usr/local/nagios/var/ndo.dat
#output=127.0.0.1
output=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
output_buffer_items=5000
buffer_file=/usr/local/nagios/var/ndomod.tmp
file_rotation_interval=14400
#file_rotation_command=rotate_ndo_log
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
#reconnect_warning_interval=900
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
statechange_data=1
system_command_data=1
timed_event_data=1
config_output_options=2
I start ndo:
/usr/local/bin/ndo2db-3x -c /usr/local/etc/nagios/ndo2db.cfg
then retstart nagios:
/usr/loca/etc/rc.d/nagios restart

Everything alright.
In logs:

nagios.log

Code: Select all

Nagios 3.4.1 starting... (PID=849)
Local time is Thu Feb 26 12:01:50 MSK 2015
LOG VERSION: 2.0
ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
ndomod: Could not open data sink!  I'll keep trying, but some output may get lost...
ndomod registered for process data
ndomod registered for timed event data
ndomod registered for log data'
ndomod registered for system command data'
ndomod registered for event handler data'
ndomod registered for notification data'
ndomod registered for service check data'
ndomod registered for host check data'
ndomod registered for comment data'
ndomod registered for downtime data'
ndomod registered for flapping data'
ndomod registered for program status data'
ndomod registered for host status data'
ndomod registered for service status data'
ndomod registered for adaptive program data'
ndomod registered for adaptive host data'
ndomod registered for adaptive service data'
ndomod registered for external command data'
ndomod registered for aggregated status data'
ndomod registered for retention data'
ndomod registered for contact data'
ndomod registered for contact notification data'
ndomod registered for acknowledgement data'
ndomod registered for contact status data'
ndomod registered for adaptive contact data'
Event broker module '/usr/local/bin/ndomod-3x.o' initialized successfully.
Finished daemonizing... (New PID=861)
ndomod: Still unable to reconnect to data sink.  41336 items lost, 5000 queued items to flush.
ndomod: Successfully reconnected to data sink!  41471 items lost, 5000 queued items to flush.
In debug file many sql queries.

In my nagios 2000 hosts and services but in db after start ndoutils only 7 records instead 2000:

Code: Select all

select * from nagios_hoststatus;
What is my fault?
Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with nagios and ndoutils

Post by scottwilkerson »

lets change the ndomod to

Code: Select all

instance_name=default
#output_type=file
#output_type=tcpsocket
output_type=unixsocket
#output=/usr/local/nagios/var/ndo.dat
#output=127.0.0.1
output=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
output_buffer_items=5000
buffer_file=/usr/local/nagios/var/ndomod.tmp
file_rotation_interval=14400
#file_rotation_command=rotate_ndo_log
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
#reconnect_warning_interval=900
data_processing_options=-1
Then restart nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: Problem with nagios and ndoutils

Post by eFusion »

Thanks for the reply.
I add string data_processing_options=-1 in ndomod.cfg.
After that in mysql became 12 records, is better :D. But should be at least 1800-1900 records.
May have to wait a while?
I have no more ideas :(
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem with nagios and ndoutils

Post by abrist »

Check your system messages for queue errors.

Code: Select all

tail -50 /var/log/messages
Also, do you see any query errors in the ndo2db.debug log?
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.
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: Problem with nagios and ndoutils

Post by eFusion »

No error request in ndo2db.debug.
With nagios in my server turns close cacti.
Among the messages by cacti i dont see errors by ndomod or any.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Problem with nagios and ndoutils

Post by cmerchant »

Did the database get populated with the 1800-1900? I noticed the Could no open data sink in your ndo2db log and found another core user that had same error message. It came to file ownership of /usr/local/nagios/etc/ndomod.cfg being root:root and it should be apache.nagios. Check out this thread:

/usr/local/nagios/etc/ndomod.cfg
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: Problem with nagios and ndoutils

Post by eFusion »

I change right on /usr/local/etc/nagios/ndo2db.cfg and /usr/local/etc/nagios/ndomod.cfg to www:nagios.
Kill ndo, restart nagios and then start ndo.
In nagios.log:

Code: Select all

Nagios 3.4.1 starting... (PID=37254)
Local time is Wed Mar 04 13:10:01 MSK 2015
LOG VERSION: 2.0
ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
ndomod: Could not open data sink!  I'll keep trying, but some output may get lost...
ndomod registered for process data
ndomod registered for timed event data
ndomod registered for log data'
ndomod registered for system command data'
ndomod registered for event handler data'
ndomod registered for notification data'
ndomod registered for service check data'
ndomod registered for host check data'
ndomod registered for comment data'
ndomod registered for downtime data'
ndomod registered for flapping data'
ndomod registered for program status data'
ndomod registered for host status data'
ndomod registered for service status data'
ndomod registered for adaptive program data'
ndomod registered for adaptive host data'
ndomod registered for adaptive service data'
ndomod registered for external command data'
ndomod registered for aggregated status data'
ndomod registered for retention data'
ndomod registered for contact data'
ndomod registered for contact notification data'
ndomod registered for acknowledgement data'
ndomod registered for state change data'
ndomod registered for contact status data'
ndomod registered for adaptive contact data'
Event broker module '/usr/local/bin/ndomod-3x.o' initialized successfully.
Finished daemonizing... (New PID=37902)
ndomod: Successfully connected to data sink.  16579 items lost, 5000 queued items to flush.
ndomod: Error writing to data sink!  Some output may get lost.  4981 queued items to flush.
ndomod: Still unable to reconnect to data sink.  16579 items lost, 4981 queued items to flush.
ndomod: Successfully reconnected to data sink!  2582 items lost, 5000 queued items to flush.
In debug many queries and in messages nothing strange.

After each restart of nagios in db is added 2-3 entries.
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: Problem with nagios and ndoutils

Post by eFusion »

And another bug - when running ndo, nagios does not update statistics of switches and services.
To solve this problem, ndo need to kill and then restart nagios.
It's normally?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with nagios and ndoutils

Post by tgriep »

Could you run this command and post the output?

Code: Select all

ll /usr/local/nagios/var/
Be sure to check out our Knowledgebase for helpful articles and solutions!
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: Problem with nagios and ndoutils

Post by eFusion »

/usr/local/nagios/var#

Code: Select all

ls -lG
total 42
-rw-r--r--  1 nagios  nagios  86537 Mar  4 13:14 ndo2db.debug
Locked