Renamed service shows up both as original and new

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Renamed service shows up both as original and new

Post by Tx243 »

On one of the servers I relabeled a piece of storage from E to D, went into core configuration manager and altered the service to check the correct drive. Tested the command it ran successfully, saved and applied the configuration and now both checks are showing up in under the host and views. Went into the CCM again and verified the old E drive check is gone, rebooted nagios and it is still there.

Went as far as deleting the D drive check to see if they were both tied to it but instead it just removed the updated D drive check still leaving the E drive check.

went into CCM and searched all hosts for Disk Usage on E:/ and that server isn't listed as having the check there neither.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Renamed service shows up both as original and new

Post by pbroste »

Hello @Tx243

Thanks for reaching out; it appears that the config update did not get captured due to ghost service, and want to start by going through the database repair and then a reindex on the Core Config's. [*]Reindex the Core Configuration Manager (CCM) configs[/*]
  • rm -rf /usr/local/nagios/etc/import/*
  • 1: Terminal command list all running /bin/nagios -> ps -aux | grep -E '/bin/nagios'
  • 2: Terminal command -> killall -9 nagios (or pkill nagios)
  • 3: Terminal command check to see if /bin/nagios processes are stopped
  • 4: Restart nagios.service by terminal command: systemctl restart nagios
  • 5: Head over to the Nagios XI web console ==> Core Configuration Manager (CCM) ==> Config File Management ==> [Delete Files] ==> [Write Files] ==> [Verify Files]
  • 6: Core Configuration Manager (CCM) ==> Under Quick Tools ==> "Apply Configuration"
  • 7: Restart nagios.service by terminal command: systemctl restart nagios
  • [list]
  • Code: Select all

    systemctl restart nagios
[/list]

[*]verify that the host and services look good and verify that there are no errors in core by:[/*]

  • Code: Select all

    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[/list]

Please PM your updated system profile for us to review.

To send us your system profile.
  • Login to the Nagios XI GUI using a web browser.
  • Click the "Admin" > "System Profile" Menu
  • Click the "Download Profile" button
  • Save the profile.zip file and send via Private Message
Thanks,
Perry
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Re: Renamed service shows up both as original and new

Post by Tx243 »

Some additional information, I went searching for the host's service details in the configuration files:

in /usr/local/nagios/etc/services The file for that server in there ONLY references the C and D drives that were accurate.

But in /usr/local/nagios/etc/services/cfgprep The file for that server references the E drive as well as the renamed network connections that were renamed. It is also missing the renamed D drive disk check.

It seems that when we make changes in core configuration manager the server file in services gets updated but the one in services/cfgprep does not.
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Re: Renamed service shows up both as original and new

Post by Tx243 »

Some additional information, we had an inactive user in the users list so I deleted him in the web gui, went into core configuration manager to edit the notification time on an unrelated event and when I went apply the changes it is looking for that user and fails on commit.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Renamed service shows up both as original and new

Post by pbroste »

Hello @Tx243

Thanks for following up with the details, the 'cfgprep' directory is only used for bulk config imports. After completing the config imports the contents from the 'cfgprep' directory are no longer referenced and can be removed.

Update or import the Core Configuration to reflect the correct check that you are looking for then [Save] and [Apply Configuration], then delete the contents within the '/usr/local/nagios/etc/services/cfgprep' and '/usr/local/nagios/etc/import/*' directories. Run through the Core Configuration reindex:
Core Configuration Manager (CCM) ==> Config File Management ==> [Delete Files] ==> [Write Files] ==> [Verify Files]
*: Core Configuration Manager (CCM) ==> Under Quick Tools ==> "Apply Configuration"
*: Restart nagios.service by terminal command: systemctl restart nagios

systemctl restart nagios
verify that the host and services look good and verify that there are no errors in core by:
/usr/local/nagios/bin/nagios -vvv /usr/local/nagios/etc/nagios.cfg
Thanks,
Perry
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Re: Renamed service shows up both as original and new

Post by Tx243 »

When trying to apply the core configuration we are still getting the error with the contact/user we deleted and that the core configuration is rolling back to last known good checkpoint

Error that the contact username is no defined anywhere
Error could no add the contact username to host

I checked the contacts file via ssh and the deleted user is not listed in the file.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Renamed service shows up both as original and new

Post by pbroste »

Hello @tx243

Wanted to go ahead and reset the 'nagios' User Account expiration date to "never". We see ndo module issues associated with the database connector.

Code: Select all

chage -I -1 -m 0 -M 99999 -E -1 nagios
Please let us know how things look after restarting services.
Perry
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Re: Renamed service shows up both as original and new

Post by Tx243 »

OK, due to some unrelated issues we restored the Nagios DB to a previous version before we started making changes. I ran through all of the instructions above and am still getting the error when I try to delete a user who is no longer here through CCM.

Error: Contact <username> is not defind anywhere
Could no add contact <username> to host (config file '/usr/local/nagios/etc/hosts/B1F1EngX44012.cfg', starting on line 16)
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Renamed service shows up both as original and new

Post by pbroste »

Hello @Tx243

Want to make sure that there are no '.cfg's' in import directories that are possibly bringing over configs that are not expected. Please review:
  • .../nagios/etc/import/
  • .../nagios/etc/cfgprep/...
Thanks,
Perry
Tx243
Posts: 36
Joined: Wed Oct 16, 2013 11:33 am

Re: Renamed service shows up both as original and new

Post by Tx243 »

pbroste wrote:Hello @Tx243

Want to make sure that there are no '.cfg's' in import directories that are possibly bringing over configs that are not expected. Please review:
  • .../nagios/etc/import/
  • .../nagios/etc/cfgprep/...
Thanks,
Perry
Correct, both folders are empty of any cfg files.
Locked