Deleted Service still showing up

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Deleted Service still showing up

Post by SavaSC »

Hello,

I need some help troubleshooting an issue I've had ever since upgrading to v.2014R2.3. Whenever I go to apply configuration I get an error that says "Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/ping_Only.cfg', starting on line 31)". The problem is that service has been removed. It is not listed in CCM and when I look for the config file it is not there. I have deleted the Host / Services Configuration files, but it still is happening.

Any suggestions on what I can try?

Thank you!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Deleted Service still showing up

Post by tmcdonald »

Please run the following and show us the last dozen or so lines of output:

Code: Select all

cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
Former Nagios employee
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Re: Deleted Service still showing up

Post by SavaSC »

Here it is:

Code: Select all

Running pre-flight check on configuration data...

Checking objects...
        Checked 2571 services.
        Checked 277 hosts.
        Checked 53 host groups.
        Checked 8 service groups.
        Checked 31 contacts.
        Checked 8 contact groups.
        Checked 131 commands.
        Checked 29 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 277 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 29 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
>>> /etc/sudoers: syntax error near line 97 <<<
>>> /etc/sudoers: syntax error near line 98 <<<
>>> /etc/sudoers: syntax error near line 100 <<<
>>> /etc/sudoers: syntax error near line 102 <<<
sudo: parse error in /etc/sudoers near line 97
sudo: no valid sudoers sources found, quitting
Thank you.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted Service still showing up

Post by lmiltchev »

Make sure you don't have the following line duplicated in "/etc/sudoers" and another file under "/etc/sudoers.d/" directory:

Code: Select all

User_Alias      NAGIOSXI=nagios
If you have duplicate entries, commend out the offending line.
Be sure to check out our Knowledgebase for helpful articles and solutions!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Deleted Service still showing up

Post by tmcdonald »

Just what I thought. In your /etc/sudoers file on the lines mentioned (97,98,100,102) you will likely see the ^M character (^M is technically one character displayed on-screen as two) at the end of the lines. There are a few ways to get rid of it, explained here:

https://www.novell.com/support/kb/doc.php?id=7014821

If you use the second method, make sure to copy the new file back over the old.
Former Nagios employee
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Re: Deleted Service still showing up

Post by SavaSC »

Thanks tmcdonald and Imiltchev for your responses. I looked at the /etc/sudoers file and it didn't have either inconsistency. I did find the problem, however. Here's what I did to fix it:

1) Admin -> Unconfigured Objects - I noticed that many of the "unconfigured" things listed here didn't actually exist any more.
2) Click the "Clear Unconfigured Objects List" link
3) Re-install the v.2014R2.3 update

Now it is working correctly.

Thank you again for taking a look. It wasn't until I started looking up your suggestions that I found this list.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Deleted Service still showing up

Post by tmcdonald »

Interesting. Just out of curiosity, can you run that reconfigure again and show us the output? If it is working now and you did not see anything wrong with the sudoers, I am wondering if re-applying the update fixed it.
Former Nagios employee
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Re: Deleted Service still showing up

Post by SavaSC »

Code: Select all

Running pre-flight check on configuration data...

Checking objects...
        Checked 2572 services.
        Checked 277 hosts.
        Checked 54 host groups.
        Checked 8 service groups.
        Checked 31 contacts.
        Checked 8 contact groups.
        Checked 131 commands.
        Checked 29 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 277 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 29 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
I had re-installed the update several times before but it never fixed the issue. Honestly, I didn't check to see if just clearing the Unconfigured Objects List fixed it without the re-install. I'm not sure why I did the re-install right after I cleared the list without checking.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Deleted Service still showing up

Post by tmcdonald »

Well I'm glad it is working at any rate. I don't have a clue why Unconfigured Objects being cleared would affect the apply config in such a way, but I'll bring this up to our developers and see if they can come up with anything.
Former Nagios employee
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Re: Deleted Service still showing up

Post by SavaSC »

tmcdonald wrote:Well I'm glad it is working at any rate. I don't have a clue why Unconfigured Objects being cleared would affect the apply config in such a way, but I'll bring this up to our developers and see if they can come up with anything.
Thank you!
Locked