Page 1 of 1
Removal of Service Check
Posted: Tue Oct 13, 2020 9:07 am
by Kxfrancois
What is the best way to remove a service check that you no longer need. I have already the service check to not active but nagios is still reporting on the service check.
Is it better to make changes to the config files than attempting to change it in the GUI?
I keep getting this error whenever making a change: Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/COMMON-SERVER-SERVICE.cfg', starting on line 48
I checked the file and that line is correct. Any suggestions?
Thanks,
Re: Removal of Service Check
Posted: Tue Oct 13, 2020 2:50 pm
by dchurch
Hi!
Sounds like you have a couple of questions, so I'll address them individually.
Kxfrancois wrote:What is the best way to remove a service check that you no longer need. I have already the service check to not active but nagios is still reporting on the service check.
The easiest way to remove a service check you no longer need is to deactivate it from within XI, but it seems like you're on the ball with that already.
Make sure you apply the configuration by going to
Configuration (top menu) =>
Core Configuration Manager and click
Apply Configuration (left menu), and hit the blue
Apply Configuration button to make it stick. Otherwise, it's still going to run the service check even though it's marked as inactive in XI.
Kxfrancois wrote:Is it better to make changes to the config files than attempting to change it in the GUI?
If you're using Nagios XI, it's better to remove the service through the Nagios XI web GUI rather than attempt to make configuration changes by editing the Core configuration files. By design, the Core config files get deleted by XI when you apply configuration so any changes you make manually to the configuration files will be lost whenever that happens.
Kxfrancois wrote:I keep getting this error whenever making a change: Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/COMMON-SERVER-SERVICE.cfg', starting on line 48
I checked the file and that line is correct. Any suggestions?
The service definition in Nagios XI probably has missing required fields. I won't really know unless I looked at your configuration, but what you can try is going into
Configuration (top menu) =>
Core Configuration Manager then going to
Services (left menu) and finding the service(s) by searching for COMMON-SERVER-SERVICE. Open the service definition page and make sure all the required fields are filled out, and click Save, then apply the configuration changes.
If this doesn't fix your problem, please reply back here for next steps.
Re: Removal of Service Check
Posted: Wed Oct 14, 2020 6:57 am
by Kxfrancois
I made sure that all required feels have been filled and the error persists. Waiting on next steps.
Thanks,
Re: Removal of Service Check
Posted: Wed Oct 14, 2020 12:14 pm
by dchurch
Can you attach a System Profile tarball? You can download it if you go to Admin (top of screen), then click System Config (left menu) => System Profile, then click Download Profile.
In the mean time, you can work around the service by simply disabling it from within Nagios XI.
Re: Removal of Service Check
Posted: Thu Oct 15, 2020 5:20 am
by Kxfrancois
I have uploaded the system profile.
Thanks,
Kerwin
Moderator's Note: The profile has been shared with the support team but has been removed from the public forum
Re: Removal of Service Check
Posted: Thu Oct 15, 2020 12:00 pm
by dchurch
There's a number of issues with your Nagios XI configuration. Not sure how these happened, but I'll let you know how I'm diagnosing them so you can hopefully do it yourself in the future should the need arise.
- Service problem: Server Drive X: Disk Usage: No hosts --> Recommendation: Disable it
- Service problem: Server Drive W: Disk Usage: No hosts --> Recommendation: Disable it
- Service problem: Server Drive L: Disk Usage: No hosts --> Recommendation: Disable it
- Service problem: Service eMarket _Comm App SP_: No hosts --> Recommendation: Disable it
- Service problem: MSSQL Average Wait Time: Service group 'location-oshawa' is inactive --> Recommendation: Either disable the service, remove the service group association, or re-enable the location-oshawa service group
- Service problem: MSSQL Buffer Hit Ratio: Service group 'location-oshawa' is inactive --> Recommendation: Either disable the service, remove the service group association, or re-enable the location-oshawa service group
Further Problem Diagnosis
If you get an error message, you can diagnose the issue and get the problem service name by logging into the Nagios XI server over SSH, and inspecting the contents of the configuration file, fixing the issue with the service in the Nagios XI interface, then applying configuration again.
For instance, if the Apply Configuration pages gives the error:
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/COMMON-SERVER.cfg', starting on line 105)
Log into Nagios XI over SSH and type
vi +105 /usr/local/nagios/etc/services/COMMON-SERVER.cfg, which will show you something like this:
Code: Select all
105 define service {
106 service_description Server Drive X: Disk Usage
107 use xiwizard_windowssnmp_storage,FLP-service-template
108 servicegroups windows-logicaldisks
109 check_command check_xi_service_snmp_win_storage! -C SRVro --v2c -m ^X: -w 90 -c 95 -f!!!!!!!
110 _xiwizard windowssnmp
111 register 1
112 }
This will let you know the name of the service that is failing, in this case
Server Drive X: Disk Usage, which you can find and disable through the Nagios XI interface. Then click Apply Configuration again.
Note: Editing the configuration file on the server isn't recommended, since any changes you make these files will be lost. By design, Nagios XI deletes configuration and re-creates it when you click Apply Configuration.
Let me know if you have any further problems.
Re: Removal of Service Check
Posted: Thu Oct 15, 2020 1:01 pm
by Kxfrancois
That fixed it!
Thank you so much!
Re: Removal of Service Check
Posted: Thu Oct 15, 2020 1:32 pm
by scottwilkerson
Kxfrancois wrote:That fixed it!
Thank you so much!
Great!
Locking thread