Page 2 of 3

Re: servicegroup member status not shown

Posted: Thu Jun 01, 2017 1:33 am
by elinagios
There are no blank entries in the service group.
1) Can i check this from the database side and possibly delete something from there?
2) Can i export the servicegroup to a text file, rename the servicegroup and try to import it back in via import config files? Would that work? As there are no blank entries and links to previous deleted services it should recreate the servicegroup correctly.

Re: servicegroup member status not shown

Posted: Thu Jun 01, 2017 8:58 am
by tgriep
1.
First you would have to dump the service group names to get the id number associated with the name by running the following.

Code: Select all

echo 'select * from tbl_servicegroup;' |mysql -u root -pnagiosxi nagiosql -t
Example of the output

Code: Select all

+----+----------------------+----------------------+---------+----------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
| id | servicegroup_name    | alias                | members | servicegroup_members | notes | notes_url | action_url | active | last_modified       | access_rights | config_id |
+----+----------------------+----------------------+---------+----------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
|  2 | SNMPTraps            | SNMPTraps            |       1 |                    0 |       |           |            | 1      | 2016-05-23 16:00:46 | NULL          |         1 |
|  3 | WindowsServiceGroup  | WindowsServiceGroup  |       1 |                    0 |       |           |            | 1      | 2015-09-22 17:52:08 | NULL          |         1 |
Next you would have to dump the services table to get the same info

Code: Select all

echo 'select * from tbl_service;' |mysql -u root -pnagiosxi nagiosql -t
Example of the output

Code: Select all

| id   | config_name                          | host_name | host_name_tploptions | hostgroup_name | hostgroup_name_tploptions | service_description                                        | display_name                                                                                                                                 | servicegroups | servicegroups_tploptions | use_template | use_template_tploptions | check_command                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | is_volatile | initial_state | max_check_attempts | check_interval | retry_interval | active_checks_enabled | passive_checks_enabled | check_period | parallelize_check | obsess_over_service | check_freshness | freshness_threshold | event_handler | event_handler_enabled | low_flap_threshold | high_flap_threshold | flap_detection_enabled | flap_detection_options | process_perf_data | retain_status_information | retain_nonstatus_information | notification_interval | first_notification_delay | notification_period | notification_options | notifications_enabled | contacts | contacts_tploptions | contact_groups | contact_groups_tploptions | stalking_options | notes       | notes_url                                  | action_url       | icon_image     | icon_image_alt | use_variables | name | active | last_modified       | access_rights | config_id |
+------+--------------------------------------+-----------+----------------------+----------------+---------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------------------------+--------------+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+--------------------+----------------+----------------+-----------------------+------------------------+--------------+-------------------+---------------------+-----------------+---------------------+---------------+-----------------------+--------------------+---------------------+------------------------+------------------------+-------------------+---------------------------+------------------------------+-----------------------+--------------------------+---------------------+----------------------+-----------------------+----------+---------------------+----------------+---------------------------+------------------+-------------+--------------------------------------------+------------------+----------------+----------------+---------------+------+--------+---------------------+---------------+-----------+
|    1 | localhost                            |         1 |                    2 |              0 |                         2 | PING Downtime Test                                         |                                                                                                                                              |             0 |                        2 |            1 |                       2 | 17!100.0,20%!500.0,60%!!!!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |           2 |               |               NULL |           NULL |           NULL |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     2 |        1 |                   2 |              0 |                         2 |                  |             |                                            |                  |                |                |             0 |      | 1      | 2016-02-23 09:59:39 | NULL          |         1 |
|    2 | localhost                            |         1 |                    2 |              0 |                         2 | Root Partition                                             |                                                                                                                                              |             0 |                        2 |            1 |                       2 | 191!7%!3%!!!!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |           2 |               |                  1 |              1 |              1 |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     1 |        1 |                   2 |              0 |                         2 |                  |             |                                            |                  |                |                |             0 |      | 1      | 2017-03-10 09:02:03 | NULL          |         1 |
|    3 | localhost                            |         1 |                    2 |              0 |                         2 | Current Users                                              |                                                                                                                                              |             0 |                        2 |            1 |                       2 | 8!20!50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |           2 |               |               NULL |           NULL |           NULL |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     2 |        1 |                   2 |              0 |                         2 |                  |             |                                            |                  |                |                |             0 |      | 1      | 2016-05-13 12:20:53 | NULL          |         1 |
|    4 | localhost                            |         1 |                    2 |              0 |                         2 | Total Processes                                            |                                                                                                                                              |             0 |                        2 |            1 |                       2 | 7!250!400!RSZDT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |           2 |               |               NULL |           NULL |           NULL |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     2 |        1 |                   2 |              0 |                         2 |                  |             |                                            |                  |                |                |             0 |      | 1      | 2016-02-12 09:10:11 | NULL          |         1 |
|    5 | localhost                            |         1 |                    2 |              0 |                         2 | Current Load                                               | Alias                                                                                                                                        |             0 |                        2 |            1 |                       2 | 6!5.0,4.0,3.0!10.0,6.0,4.0!!!!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |           2 |               |               NULL |           NULL |           NULL |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     2 |        1 |                   2 |              0 |                         2 |                  |             |                                            |                  |                |                |             0 |      | 1      | 2016-02-12 09:10:11 | NULL          |         1 |
|    6 | localhost                            |         1 |                    2 |              0 |                         2 | Swap Usage                                                 |                                                                                                                                              |             0 |                        2 |            1 |                       2 | 9!20!10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |           2 |               |               NULL |           NULL |           NULL |                     2 |                      2 |            0 |                 2 |                   2 |               2 |                NULL |             0 |                     2 |               NULL |                NULL |                      2 |                        |                 2 |                         2 |                            2 |                  NULL |                     NULL |                   0 |                      |                     2 |        1 |                   2 |              0 |                         2 |                  |             |    


Next you would have to dump the service to service group link table to get the id numbers for the services that are in the group

Code: Select all

echo 'select * from tbl_lnkServicegroupToService;' |mysql -u root -pnagiosxi nagiosql -t  

Code: Select all

+----------+----------+-----------+----------+
| idMaster | idSlaveH | idSlaveHG | idSlaveS |
+----------+----------+-----------+----------+
|        2 |        2 |         0 |      418 |
|        2 |       42 |         0 |      473 |
|        4 |        5 |         0 |       68 |
|        4 |        7 |         0 |       79 |
|        4 |     2064 |         0 |      974 |
|        5 |        1 |         0 |      421 |
|        5 |     4083 |         0 |     1053 |
|        6 |       24 |         0 |      845 |
+----------+----------+-----------+----------+
The idMaster field is the link to the hostgroup
The idSlaveS field is the link to the service you would have to go through to verify if it is valid and remove the invalid links if there are any.

2. Reimporting the servicegroup would probably work as well. You can find the existing group in this file

Code: Select all

/usr/local/nagios/etc/servicegroups.cfg
Copy out the group in to another file, rename the group and import it.

Try it out and if you have any more questions, let us know.

Re: servicegroup member status not shown

Posted: Fri Jun 02, 2017 4:53 am
by elinagios
1) Took servicegroup file, deleted everything else from that, changed name for servicegroup and tried to import that file, it said 1 file imported, but when restarting nagios, nothing was changed, no new servicegroup was created.
2) Found another servicegroup that had the same issue. I could correct it with adding members to the group. After that the servicegroup member count didnt change.
3) Problem remains with the servicegroup that i reallty need and that holds over 1200 services. Beside the fact that the members count changes, i also can not add members to that servicegroup. Open servicegroup, assign membership. If i add members to the group and save, nothing is actually done, nagios doesn't recognize changes and doesnt show me that i have changes and i need to apply configuration. Even if i apply changes, the new services wount be on the servicegroup.

Re: servicegroup member status not shown

Posted: Fri Jun 02, 2017 9:22 am
by tgriep
What version of Nagios XI is the server running?

Can you run the following commands on the Nagios server and post the output so I can verify the settings for the MYSQL tables?

Code: Select all

echo 'desc tbl_servicegroup;' |mysql -u root -pnagiosxi nagiosql -t
echo 'desc tbl_service;' |mysql -u root -pnagiosxi nagiosql -t
echo 'desc tbl_lnkServicegroupToService;' |mysql -u root -pnagiosxi nagiosql -t
echo 'desc tbl_lnkServiceToHost;' |mysql -u root -pnagiosxi nagiosql -t
echo 'select * from tbl_servicegroup;' |mysql -u root -pnagiosxi nagiosql -t
Then run these as well to see if there is a possible time issue on the server.

Code: Select all

grep "date.timezone" /etc/php.ini
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
date
echo "SELECT NOW();" | mysql -u root -pnagiosxi

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 1:32 am
by elinagios
NagiosXI Installed Version: 5.4.4
Date and timezones are correct, output of the commands is following (for the servicegroups, i deleted all but the problematic one)

+----------------------+---------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------------+------+-----+-------------------+-----------------------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| servicegroup_name | varchar(255) | NO | MUL | NULL | |
| alias | varchar(255) | NO | | NULL | |
| members | tinyint(3) unsigned | NO | | 0 | |
| servicegroup_members | tinyint(3) unsigned | NO | | 0 | |
| notes | varchar(255) | YES | | NULL | |
| notes_url | varchar(255) | YES | | NULL | |
| action_url | varchar(255) | YES | | NULL | |
| active | enum('0','1') | NO | | 1 | |
| last_modified | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| access_rights | varchar(8) | YES | | NULL | |
| config_id | tinyint(3) unsigned | NO | | 0 | |
+----------------------+---------------------+------+-----+-------------------+-----------------------------+


+------------------------------+---------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------+---------------------+------+-----+-------------------+-----------------------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| config_name | varchar(255) | NO | | NULL | |
| host_name | tinyint(3) unsigned | NO | | 0 | |
| host_name_tploptions | tinyint(3) unsigned | NO | | 2 | |
| hostgroup_name | tinyint(3) unsigned | NO | | 0 | |
| hostgroup_name_tploptions | tinyint(3) unsigned | NO | | 2 | |
| service_description | varchar(255) | NO | | NULL | |
| display_name | varchar(255) | NO | | NULL | |
| servicegroups | tinyint(3) unsigned | NO | | 0 | |
| servicegroups_tploptions | tinyint(3) unsigned | NO | | 2 | |
| use_template | tinyint(3) unsigned | NO | | 0 | |
| use_template_tploptions | tinyint(3) unsigned | NO | | 2 | |
| check_command | text | NO | | NULL | |
| is_volatile | tinyint(3) unsigned | NO | | 2 | |
| initial_state | varchar(20) | NO | | NULL | |
| max_check_attempts | int(11) | YES | | NULL | |
| check_interval | int(11) | YES | | NULL | |
| retry_interval | int(11) | YES | | NULL | |
| active_checks_enabled | tinyint(3) unsigned | NO | | 2 | |
| passive_checks_enabled | tinyint(3) unsigned | NO | | 2 | |
| check_period | int(11) | NO | | 0 | |
| parallelize_check | tinyint(3) unsigned | NO | | 2 | |
| obsess_over_service | tinyint(3) unsigned | NO | | 2 | |
| check_freshness | tinyint(3) unsigned | NO | | 2 | |
| freshness_threshold | int(11) | YES | | NULL | |
| event_handler | int(11) | NO | | 0 | |
| event_handler_enabled | tinyint(3) unsigned | NO | | 2 | |
| low_flap_threshold | int(11) | YES | | NULL | |
| high_flap_threshold | int(11) | YES | | NULL | |
| flap_detection_enabled | tinyint(3) unsigned | NO | | 2 | |
| flap_detection_options | varchar(20) | NO | | NULL | |
| process_perf_data | tinyint(3) unsigned | NO | | 2 | |
| retain_status_information | tinyint(3) unsigned | NO | | 2 | |
| retain_nonstatus_information | tinyint(3) unsigned | NO | | 2 | |
| notification_interval | int(11) | YES | | NULL | |
| first_notification_delay | int(11) | YES | | NULL | |
| notification_period | int(11) | NO | | 0 | |
| notification_options | varchar(20) | NO | | NULL | |
| notifications_enabled | tinyint(3) unsigned | NO | | 2 | |
| contacts | tinyint(3) unsigned | NO | | 0 | |
| contacts_tploptions | tinyint(3) unsigned | NO | | 2 | |
| contact_groups | tinyint(3) unsigned | NO | | 0 | |
| contact_groups_tploptions | tinyint(3) unsigned | NO | | 2 | |
| stalking_options | varchar(20) | NO | | | |
| notes | varchar(255) | NO | | NULL | |
| notes_url | varchar(255) | NO | | NULL | |
| action_url | varchar(255) | NO | | NULL | |
| icon_image | varchar(255) | NO | | NULL | |
| icon_image_alt | varchar(255) | NO | | NULL | |
| use_variables | tinyint(3) unsigned | NO | | 0 | |
| name | varchar(255) | NO | | | |
| active | enum('0','1') | NO | | 1 | |
| last_modified | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| access_rights | varchar(8) | YES | | NULL | |
| config_id | tinyint(3) unsigned | NO | | 0 | |
+------------------------------+---------------------+------+-----+-------------------+-----------------------------+


+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| idMaster | int(11) | NO | PRI | NULL | |
| idSlaveH | int(11) | NO | PRI | NULL | |
| idSlaveHG | int(11) | NO | PRI | NULL | |
| idSlaveS | int(11) | NO | PRI | NULL | |
+-----------+---------+------+-----+---------+-------+

+----------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| idMaster | int(11) | NO | PRI | NULL | |
| idSlave | int(11) | NO | PRI | NULL | |
| exclude | tinyint(1) | NO | | NULL | |
+----------+------------+------+-----+---------+-------+

+----+-----------------------------+------------------------------------+---------+----------------------+------------------------------------+-------------------------------------------------------+-------------------------------------------------------+--------+---------------------+---------------+-----------+
| id | servicegroup_name | alias | members | servicegroup_members | notes | notes_url | action_url | active | last_modified | access_rights | config_id |
+----+-----------------------------+------------------------------------+---------+----------------------+------------------------------------+-------------------------------------------------------+-------------------------------------------------------+--------+---------------------+---------------+-----------+
| 46 | Critical_services | Critical services | 1 | 0 | NULL | NULL | NULL | 1 | 2017-04-07 14:32:30 | NULL | 1 |
+----+-----------------------------+------------------------------------+---------+----------------------+------------------------------------+-------------------------------------------------------+-------------------------------------------------------+--------+---------------------+---------------+-----------+

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 11:05 am
by avandemore
Please use code tags to wrap long output.

Please provide the output for the following 2 commands:

Code: Select all

# mysql -uroot -pnagiosxi nagios -e "SELECT * from nagios_instances;"
# top -bcn1

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 12:20 pm
by elinagios

Code: Select all

+-------------+---------------+----------------------+
| instance_id | instance_name | instance_description |
+-------------+---------------+----------------------+
|           1 | localhost     |                      |
+-------------+---------------+----------------------+
Top output is added in attachment.

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 1:21 pm
by avandemore
XI > Admin > System Profile > Download Profile

Please include the zip file in your response. You can PM it to myself or other support personnel.

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 1:39 pm
by elinagios
Profile was sent to [email protected], subject: servicegroup­ member status not shown.

Re: servicegroup member status not shown

Posted: Mon Jun 05, 2017 1:51 pm
by avandemore
That will open a ticket for this issue. Do you want to pursue this via ticket or the current thread?