Removal of Service Check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Kxfrancois
Posts: 48
Joined: Mon Nov 19, 2018 9:38 am

Removal of Service Check

Post 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,
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Removal of Service Check

Post 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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Kxfrancois
Posts: 48
Joined: Mon Nov 19, 2018 9:38 am

Re: Removal of Service Check

Post by Kxfrancois »

I made sure that all required feels have been filled and the error persists. Waiting on next steps.

Thanks,
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Removal of Service Check

Post 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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Kxfrancois
Posts: 48
Joined: Mon Nov 19, 2018 9:38 am

Re: Removal of Service Check

Post 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
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Removal of Service Check

Post 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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Kxfrancois
Posts: 48
Joined: Mon Nov 19, 2018 9:38 am

Re: Removal of Service Check

Post by Kxfrancois »

That fixed it!

Thank you so much!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Removal of Service Check

Post by scottwilkerson »

Kxfrancois wrote:That fixed it!

Thank you so much!
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked