Host and services still showing but don't exist in CCM - av6

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Host and services still showing but don't exist in CCM

Post by Box293 »

Can you also run these two commands and report back:

Code: Select all

grep -R 'Brisbane CORE Router' /usr/local/nagios/etc/
echo "select * from tbl_host where host_name like 'Brisbane CORE Router' \G;" | mysql -pnagiosxi nagiosql
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
av6233
Posts: 6
Joined: Tue May 26, 2015 11:26 am

Re: Host and services still showing but don't exist in CCM

Post by av6233 »

Box293 wrote:Lets look in the database. Using this command I can find the host with the alias win2008r2-01, can you run it for your host name and see if it appears. Make sure the cAsE is correct. You may need to use display_name instead of alias.

Code: Select all

[nagios@nagios ~]$ echo "select * from nagios_hosts where alias like 'edge-2-sw.xxxxx.xxxxxxx.com' \G;" | mysql -pnagiosxi nagios

*************************** 1. row ***************************
                          host_id: 106177
                      instance_id: 1
                      config_type: 1
                   host_object_id: 6645
                            alias: edge-2-sw.xxxxx.xxxxxxx.com
                     display_name: edge-2-sw.xxxxx.xxxxxxx.com
                          address: 192.168.x.x
          check_command_object_id: 57
               check_command_args: 3000.0!80%!5000.0!100%!!!!
   eventhandler_command_object_id: 0
        eventhandler_command_args:
notification_timeperiod_object_id: 120
       check_timeperiod_object_id: 120
       failure_prediction_options:
                   check_interval: 5
                   retry_interval: 1
               max_check_attempts: 5
         first_notification_delay: 15
            notification_interval: 60
                   notify_on_down: 1
            notify_on_unreachable: 0
               notify_on_recovery: 1
               notify_on_flapping: 1
               notify_on_downtime: 0
                      stalk_on_up: 0
                    stalk_on_down: 0
             stalk_on_unreachable: 0
           flap_detection_enabled: 1
             flap_detection_on_up: 1
           flap_detection_on_down: 1
    flap_detection_on_unreachable: 1
               low_flap_threshold: 0
              high_flap_threshold: 0
         process_performance_data: 1
         freshness_checks_enabled: 0
              freshness_threshold: 0
           passive_checks_enabled: 1
            event_handler_enabled: 1
            active_checks_enabled: 1
        retain_status_information: 1
     retain_nonstatus_information: 1
            notifications_enabled: 0
                 obsess_over_host: 1
       failure_prediction_enabled: 0
                            notes:
                        notes_url:
                       action_url:
                       icon_image: switch.png
                   icon_image_alt:
                       vrml_image:
                  statusmap_image: switch.png
                   have_2d_coords: 0
                             x_2d: -1
                             y_2d: 0
                   have_3d_coords: 0
                             x_3d: 0
                             y_3d: 0
                             z_3d: 0
                       importance: 0
[nagios@nagios ~]$
Ok... So, even though it no longer appears in CCM or gets written out to the flat files, it does still exist in the nagios_hosts table.
User avatar
Louis
Posts: 11
Joined: Wed Jan 15, 2014 7:23 pm
Location: Perth, Australia
Contact:

Re: Host and services still showing but don't exist in CCM

Post by Louis »

Box293 wrote:Can you also run these two commands and report back:

Code: Select all

grep -R 'Brisbane CORE Router' /usr/local/nagios/etc/
echo "select * from tbl_host where host_name like 'Brisbane CORE Router' \G;" | mysql -pnagiosxi nagiosql
[root@nagios ~]# grep -R 'Brisbane CORE Router' /usr/local/nagios/etc/
/usr/local/nagios/etc/hosts/Brisbane CORE Router.cfg: host_name Brisbane CORE Router
/usr/local/nagios/etc/services/Brisbane CORE Router.cfg: host_name Brisbane CORE Router
/usr/local/nagios/etc/services/Brisbane CORE Router.cfg: host_name Brisbane CORE Router
/usr/local/nagios/etc/services/Brisbane CORE Router.cfg: host_name Brisbane CORE Router
[root@nagios ~]# echo "select * from tbl_host where host_name like 'Brisbane CORE Router' \G;" | mysql -pnagiosxi nagiosql
[root@nagios ~]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host and services still showing but don't exist in CCM

Post by tmcdonald »

At this point I would like to ask again that we stick to one thread per user. We have this thread which was split from the original here: https://support.nagios.com/forum/viewto ... 373#158001

@Louis please use this original thread: https://support.nagios.com/forum/viewto ... 373#158001

and @av6233 please use the one we are currently in.

It gets tricky trying to remember in a single thread who has run what steps. I have modified the post titles to reflect ownership.
Former Nagios employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Host and services still showing but don't exist in CCM -

Post by Box293 »

Please run these commands:

Code: Select all

mv '/usr/local/nagios/etc/hosts/Brisbane CORE Router.cfg' /tmp/
mv '/usr/local/nagios/etc/services/Brisbane CORE Router.cfg' /tmp/
service nagios restart


Now they should not appear in the GUI.

If this is the case, what happens now after apply config?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
av6233
Posts: 6
Joined: Tue May 26, 2015 11:26 am

Re: Host and services still showing but don't exist in CCM -

Post by av6233 »

Requesting closure. I restored from a database backup and manually entered/recreated data. This was the action I was trying to avoid however, the length of time my XI installation was impaired became a greater concern than the data lost.
Locked