Tuesday, October 21, 2008

Nagios NDO Module - Remote mysqld

I'm installing ndo2db module on my nagios server, and I have to separate the mysql server due to heavy load on the server itself. Below are the config.

Portion of nagios.cfg

#nagios.cfg
#portion for ndo broker module config
# Controls what (if any) data gets sent to the event broker.
event_broker_options=-1
#event_broker_options=0
# This directive is used to specify an event broker module that should
#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
broker_module=/usr/bin/ndomod.o config_file=/etc/nagios/ndomod.cfg


ndo2db.cfg


#ndo2db.cfg
ndo2db_user=nagios
ndo2db_group=nagios
socket_type=tcp
socket_name=/var/log/nagios/ndo.sock
tcp_port=5668
db_servertype=mysql
db_host=10.254.1.47
db_port=3306
db_name=nagios
db_prefix=nagios_
db_user=nagiosuser
db_pass=nagiospass
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
debug_level=2
debug_verbosity=2
debug_file=/var/log/nagios/ndo2db.debug
max_debug_file_size=1000000


and ndomod.cfg


instance_name=default
output_type=tcpsocket
output=127.0.0.1
tcp_port=5668
output_buffer_items=5000
buffer_file=/var/log/nagios/ndomod.tmp
file_rotation_interval=14400
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
data_processing_options=-1
config_output_options=2


Other details:

Note: need to run the installdb script inside db folder of the extracted ndo2db source.
db = nagios
db_user=nagiosuser
db_pass=nagiospass
db host=10.254.1.47
#

Then login to mysql as privilege user

mysql -u root -p


create database nagios;
--------- creating nagios db at 10.10.1.47
grant all privileges on nagios.* to 'nagiosuser'@'10.254.1.15' identified by 'nagiospass'; -- this gives access to database
#

./installdb -u nagios -p nagiospass -h 10.254.1.47 -d nagios -- install tables at nagiosdb

Installing now tables entries at db from 10.254.1.15 to 10.254.1.47