Problem Hostgroups in Nagiosxi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
roccoss
Posts: 25
Joined: Tue Sep 02, 2014 11:47 am

Re: Problem Hostgroups in Nagiosxi

Post by roccoss »

Hi @lmiltchev

Remembering, we have not configured nagios xi with ssl.
I send PM with attach

Thank you
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Problem Hostgroups in Nagiosxi

Post by lmiltchev »

Change the "https" in the "Program URL" filed under "System Settings" to "http", and click on "Update Settings".

Open the /usr/local/nagios/etc/ndo2db.cfg file in a text editor, and enable debugging by setting:

Code: Select all

debug_level=-1
debug_verbosity=1
Save, exit, and restart nagios and ndo2db.

Code: Select all

service nagios stop
service ndo2db restart
service nagios start
Post the /usr/local/nagios/var/ndo2db.debug file on the forum. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem Hostgroups in Nagiosxi

Post by tgriep »

In addition to what @lmiltchev wants you to do, can you run these commands as root and post the output here?

Code: Select all

echo 'select * from nagios_hostgroups;' |mysql -u root -pnagiosxi nagios
echo 'select * from nagios_hostgroup_members;' |mysql -u root -pnagiosxi nagios
Thanks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
roccoss
Posts: 25
Joined: Tue Sep 02, 2014 11:47 am

Re: Problem Hostgroups in Nagiosxi

Post by roccoss »

Hi @tgriep @lmiltchev

I change the https to http, and activate debug.
Run the commands, but there is not information in the tables.
Send files PM.

Thanks you
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem Hostgroups in Nagiosxi

Post by tgriep »

Received the files and shared them with the other Techs.

Those tables being empty are the issue so we need to find out why they are not getting populated.
Run this as root and post the output to show the structures of the tables.

Code: Select all

echo 'desc nagios_hostgroups;' |mysql -t -u root -pnagiosxi nagios
echo 'desc nagios_hostgroup_members;' |mysql -t -u root -pnagiosxi nagios
Then, lets see if repairing the MYSQL database will fix the issue. Run the following as root to repair the databases.

Code: Select all

service nagios stop
service ndo2db stop
mysqlcheck -f -r -u root -pnagiosxi --all-databases --use_frm
service ndo2db start
service nagios start
Let us know how it works out.
Be sure to check out our Knowledgebase for helpful articles and solutions!
roccoss
Posts: 25
Joined: Tue Sep 02, 2014 11:47 am

Re: Problem Hostgroups in Nagiosxi

Post by roccoss »

Hi @tgriep

Attach result

[root@ih88a ~]# service nagios stop
Stopping nagios: done.
[root@ih88a ~]# service ndo2db stop
Stopping ndo2db: head: cannot open `/usr/local/nagios/var/ndo2db.lock' for reading: No such file or directory
done.
[root@ih88a ~]#
[root@ih88a ~]#
[root@ih88a ~]# echo 'desc nagios_hostgroups;' | mysql -u root -pnagiosxi nagios
Field Type Null Key Default Extra
hostgroup_id int(11) NO PRI NULL auto_increment
instance_id smallint(6) NO MUL 0
config_type smallint(6) NO 0
hostgroup_object_id int(11) NO 0
alias varchar(255) NO
[root@ih88a ~]#
[root@ih88a ~]# echo 'desc nagios_hostgroup_members;' | mysql -u root -pnagiosxi nagios
Field Type Null Key Default Extra
hostgroup_member_id int(11) NO PRI NULL auto_increment
instance_id smallint(6) NO 0
hostgroup_id int(11) NO MUL 0
host_object_id int(11) NO 0
[root@ih88a ~]# mysqlcheck -f -r -u root -pnagiosxi --all-databases --use_frm
mysql.columns_priv OK
mysql.db
warning : Number of rows changed from 0 to 4
status : OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category
warning : Number of rows changed from 0 to 40
status : OK
mysql.help_keyword
warning : Number of rows changed from 0 to 453
status : OK
mysql.help_relation
warning : Number of rows changed from 0 to 1009
status : OK
mysql.help_topic
warning : Number of rows changed from 0 to 510
status : OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user
warning : Number of rows changed from 0 to 7
status : OK
nagios.nagios_acknowledgements OK
nagios.nagios_commands OK
nagios.nagios_commenthistory
warning : Number of rows changed from 0 to 275
status : OK
nagios.nagios_comments OK
nagios.nagios_configfiles
warning : Number of rows changed from 0 to 1
status : OK
nagios.nagios_configfilevariables
warning : Number of rows changed from 0 to 131
status : OK
nagios.nagios_conninfo
warning : Number of rows changed from 0 to 74
status : OK
nagios.nagios_contact_addresses OK
nagios.nagios_contact_notificationcommands OK
nagios.nagios_contactgroup_members OK
nagios.nagios_contactgroups OK
nagios.nagios_contactnotificationmethods
warning : Number of rows changed from 0 to 62065
status : OK
nagios.nagios_contactnotifications
warning : Number of rows changed from 0 to 62065
status : OK
nagios.nagios_contacts OK
nagios.nagios_contactstatus OK
nagios.nagios_customvariables OK
nagios.nagios_customvariablestatus OK
nagios.nagios_dbversion
warning : Number of rows changed from 0 to 1
status : OK
nagios.nagios_downtimehistory OK
nagios.nagios_eventhandlers
warning : Number of rows changed from 0 to 155
status : OK
nagios.nagios_externalcommands
warning : Number of rows changed from 0 to 4
status : OK
nagios.nagios_flappinghistory
warning : Number of rows changed from 0 to 526
status : OK
nagios.nagios_host_contactgroups OK
nagios.nagios_host_contacts OK
nagios.nagios_host_parenthosts OK
nagios.nagios_hostchecks OK
nagios.nagios_hostdependencies OK
nagios.nagios_hostescalation_contactgroups OK
nagios.nagios_hostescalation_contacts OK
nagios.nagios_hostescalations OK
nagios.nagios_hostgroup_members OK
nagios.nagios_hostgroups OK
nagios.nagios_hosts OK
nagios.nagios_hoststatus
warning : Number of rows changed from 0 to 36
status : OK
nagios.nagios_instances
warning : Number of rows changed from 0 to 1
status : OK
nagios.nagios_logentries
warning : Number of rows changed from 0 to 1928278
status : OK
nagios.nagios_notifications
warning : Number of rows changed from 0 to 62065
status : OK
nagios.nagios_objects
warning : Number of rows changed from 0 to 2456
status : OK
nagios.nagios_processevents
warning : Number of rows changed from 0 to 212
status : OK
nagios.nagios_programstatus
warning : Number of rows changed from 0 to 1
status : OK
nagios.nagios_runtimevariables
warning : Number of rows changed from 0 to 18
status : OK
nagios.nagios_scheduleddowntime OK
nagios.nagios_service_contactgroups OK
nagios.nagios_service_contacts OK
nagios.nagios_service_parentservices OK
nagios.nagios_servicechecks OK
nagios.nagios_servicedependencies OK
nagios.nagios_serviceescalation_contactgroups OK
nagios.nagios_serviceescalation_contacts OK
nagios.nagios_serviceescalations OK
nagios.nagios_servicegroup_members OK
nagios.nagios_servicegroups OK
nagios.nagios_services OK
nagios.nagios_servicestatus
warning : Number of rows changed from 0 to 2414
status : OK
nagios.nagios_statehistory
warning : Number of rows changed from 0 to 281665
status : OK
nagios.nagios_systemcommands
warning : Number of rows changed from 0 to 60
status : OK
nagios.nagios_timedeventqueue OK
nagios.nagios_timedevents OK
nagios.nagios_timeperiod_timeranges OK
nagios.nagios_timeperiods OK
nagiosql.tbl_command
warning : Number of rows changed from 0 to 356
status : OK
nagiosql.tbl_contact
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_contactgroup
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_contacttemplate
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_domain
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_host
warning : Number of rows changed from 0 to 36
status : OK
nagiosql.tbl_hostdependency OK
nagiosql.tbl_hostescalation OK
nagiosql.tbl_hostextinfo OK
nagiosql.tbl_hostgroup
warning : Number of rows changed from 0 to 21
status : OK
nagiosql.tbl_hosttemplate
warning : Number of rows changed from 0 to 49
status : OK
nagiosql.tbl_info
warning : Number of rows changed from 0 to 218
status : OK
nagiosql.tbl_lnkContactToCommandHost
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkContactToCommandService
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkContactToContactgroup OK
nagiosql.tbl_lnkContactToContacttemplate
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_lnkContactToVariabledefinition OK
nagiosql.tbl_lnkContactgroupToContact
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkContactgroupToContactgroup OK
nagiosql.tbl_lnkContacttemplateToCommandHost
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_lnkContacttemplateToCommandService
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_lnkContacttemplateToContactgroup
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkContacttemplateToContacttemplate OK
nagiosql.tbl_lnkContacttemplateToVariabledefinition OK
nagiosql.tbl_lnkHostToContact OK
nagiosql.tbl_lnkHostToContactgroup OK
nagiosql.tbl_lnkHostToHost OK
nagiosql.tbl_lnkHostToHostgroup
warning : Number of rows changed from 0 to 70
status : OK
nagiosql.tbl_lnkHostToHosttemplate
warning : Number of rows changed from 0 to 36
status : OK
nagiosql.tbl_lnkHostToVariabledefinition OK
nagiosql.tbl_lnkHostdependencyToHost_DH OK
nagiosql.tbl_lnkHostdependencyToHost_H OK
nagiosql.tbl_lnkHostdependencyToHostgroup_DH OK
nagiosql.tbl_lnkHostdependencyToHostgroup_H OK
nagiosql.tbl_lnkHostescalationToContact OK
nagiosql.tbl_lnkHostescalationToContactgroup OK
nagiosql.tbl_lnkHostescalationToHost OK
nagiosql.tbl_lnkHostescalationToHostgroup OK
nagiosql.tbl_lnkHostgroupToHost
warning : Number of rows changed from 0 to 36
status : OK
nagiosql.tbl_lnkHostgroupToHostgroup OK
nagiosql.tbl_lnkHosttemplateToContact
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkHosttemplateToContactgroup
warning : Number of rows changed from 0 to 4
status : OK
nagiosql.tbl_lnkHosttemplateToHost OK
nagiosql.tbl_lnkHosttemplateToHostgroup
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkHosttemplateToHosttemplate
warning : Number of rows changed from 0 to 47
status : OK
nagiosql.tbl_lnkHosttemplateToVariabledefinition OK
nagiosql.tbl_lnkServiceToContact
warning : Number of rows changed from 0 to 590
status : OK
nagiosql.tbl_lnkServiceToContactgroup OK
nagiosql.tbl_lnkServiceToHost
warning : Number of rows changed from 0 to 8
status : OK
nagiosql.tbl_lnkServiceToHostgroup
warning : Number of rows changed from 0 to 1077
status : OK
nagiosql.tbl_lnkServiceToServicegroup
warning : Number of rows changed from 0 to 643
status : OK
nagiosql.tbl_lnkServiceToServicetemplate
warning : Number of rows changed from 0 to 8
status : OK
nagiosql.tbl_lnkServiceToVariabledefinition OK
nagiosql.tbl_lnkServicedependencyToHost_DH OK
nagiosql.tbl_lnkServicedependencyToHost_H OK
nagiosql.tbl_lnkServicedependencyToHostgroup_DH OK
nagiosql.tbl_lnkServicedependencyToHostgroup_H OK
nagiosql.tbl_lnkServicedependencyToService_DS OK
nagiosql.tbl_lnkServicedependencyToService_S OK
nagiosql.tbl_lnkServiceescalationToContact OK
nagiosql.tbl_lnkServiceescalationToContactgroup OK
nagiosql.tbl_lnkServiceescalationToHost OK
nagiosql.tbl_lnkServiceescalationToHostgroup OK
nagiosql.tbl_lnkServiceescalationToService OK
nagiosql.tbl_lnkServicegroupToService OK
nagiosql.tbl_lnkServicegroupToServicegroup OK
nagiosql.tbl_lnkServicetemplateToContact OK
nagiosql.tbl_lnkServicetemplateToContactgroup
warning : Number of rows changed from 0 to 1
status : OK
nagiosql.tbl_lnkServicetemplateToHost OK
nagiosql.tbl_lnkServicetemplateToHostgroup OK
nagiosql.tbl_lnkServicetemplateToServicegroup OK
nagiosql.tbl_lnkServicetemplateToServicetemplate
warning : Number of rows changed from 0 to 73
status : OK
nagiosql.tbl_lnkServicetemplateToVariabledefinition OK
nagiosql.tbl_lnkTimeperiodToTimeperiod OK
nagiosql.tbl_logbook OK
nagiosql.tbl_mainmenu
warning : Number of rows changed from 0 to 7
status : OK
nagiosql.tbl_service
warning : Number of rows changed from 0 to 598
status : OK
nagiosql.tbl_servicedependency OK
nagiosql.tbl_serviceescalation OK
nagiosql.tbl_serviceextinfo OK
nagiosql.tbl_servicegroup
warning : Number of rows changed from 0 to 10
status : OK
nagiosql.tbl_servicetemplate
warning : Number of rows changed from 0 to 75
status : OK
nagiosql.tbl_settings
warning : Number of rows changed from 0 to 12
status : OK
nagiosql.tbl_submenu
warning : Number of rows changed from 0 to 29
status : OK
nagiosql.tbl_timedefinition
warning : Number of rows changed from 0 to 46
status : OK
nagiosql.tbl_timeperiod
warning : Number of rows changed from 0 to 8
status : OK
nagiosql.tbl_user
warning : Number of rows changed from 0 to 2
status : OK
nagiosql.tbl_variabledefinition OK
[root@ih88a ~]#
[root@ih88a ~]# service ndo2db start
Starting ndo2db: done.
[root@ih88a ~]# service nagios start
Starting nagios: done.
[root@ih88a ~]# echo 'select * from nagios_hostgroup_members;' | mysql -u root -pnagiosxi nagios
[root@ih88a ~]# echo 'select * from nagios_hostgroups;' | mysql -u root -pnagiosxi nagios
[root@ih88a ~]#

Thank you
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem Hostgroups in Nagiosxi

Post by tgriep »

When you ran this to stop the ndo2db process

Code: Select all

service ndo2db stop
It generated this message which means that ndo2db was not running and without that running, it will not update the database which may be why the hostgroups are missing.
Stopping ndo2db: head: cannot open `/usr/local/nagios/var/ndo2db.lock' for reading: No such file or directory done.

Make sure ndo2db is running on the server and see if the hostgroups are there.
If they are not there, edit a hostgroup. Just add a new host to it. Save it and Apply the Config. Do you see it in the XI GUI now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
roccoss
Posts: 25
Joined: Tue Sep 02, 2014 11:47 am

Re: Problem Hostgroups in Nagiosxi

Post by roccoss »

Hi @tgriep

The ndo2db process stop when stop nagios.
How you see down, the process ndo2db is running, but don't show the hostgroups

[root@ih88a ~]# ls -ltr /usr/local/nagios/var/ndo2db.lock
-rw-r----- 1 nagios nagios 5 Jan 28 15:40 /usr/local/nagios/var/ndo2db.lock
[root@ih88a ~]# ps -ef | grep ndo2db
nagios 8336 1 0 Jan28 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios 26112 8336 0 Jan28 ? 00:00:54 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios 26113 26112 0 Jan28 ? 00:05:56 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
root 26131 24909 0 17:03 pts/0 00:00:00 grep ndo2db
[root@ih88a ~]#
[root@ih88a ~]# /etc/init.d/ndo2db status
ndo2db (pid 8336) is running...
[root@ih88a ~]#
[root@ih88a ~]# echo 'select * from nagios_hostgroup_members;' | mysql -u root -pnagiosxi nagios
[root@ih88a ~]# echo 'select * from nagios_hostgroups;' | mysql -u root -pnagiosxi nagios
[root@ih88a ~]#

Thank you
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem Hostgroups in Nagiosxi

Post by tgriep »

Do you see any errors in the /var/log/messages file when ndo is writing to the database?
Be sure to check out our Knowledgebase for helpful articles and solutions!
roccoss
Posts: 25
Joined: Tue Sep 02, 2014 11:47 am

Re: Problem Hostgroups in Nagiosxi

Post by roccoss »

Hi @tgriep

No errors in the log. I send log in PM

Thanks you
Locked