NagiosXI applying service checks to localhost
-
philip.ianni
- Posts: 29
- Joined: Tue Dec 29, 2015 12:35 pm
NagiosXI applying service checks to localhost
Hey there,
We're having an issue where our brand new NagiosXI instance (migrated from a very old and broken NagiosXI server) is applying the localhost host to some services. The issue is that, based on looking in the GUI and config files in the server, that the host 'localhost' should not have these service checks at all.
Here's an example
The service 'Linux - Base - Disk Space' only uses the contact group 'Linux'. Inside 'Linux', localhost is not present. However in the GUI, when I search 'localhost', it shows the host having the service check 'Linux - Base - Disk Space'.
Thanks.
We're having an issue where our brand new NagiosXI instance (migrated from a very old and broken NagiosXI server) is applying the localhost host to some services. The issue is that, based on looking in the GUI and config files in the server, that the host 'localhost' should not have these service checks at all.
Here's an example
The service 'Linux - Base - Disk Space' only uses the contact group 'Linux'. Inside 'Linux', localhost is not present. However in the GUI, when I search 'localhost', it shows the host having the service check 'Linux - Base - Disk Space'.
Thanks.
Re: NagiosXI applying service checks to localhost
Can you PM over a profile to myself, and dwhitfield? I'd like to see what's going on exactly in your configurations. (Admin -> System Profile -> Download Profile)
UPDATE: profile received and shared with techs.
UPDATE: profile received and shared with techs.
Former Nagios Employee
-
philip.ianni
- Posts: 29
- Joined: Tue Dec 29, 2015 12:35 pm
Re: NagiosXI applying service checks to localhost
Sent over profile!
Re: NagiosXI applying service checks to localhost
It looks like they are indeed being assigned -
From one of your config files -
Additionally, I couldn't find any checks called 'Linux - Base - Disk space' in your service_description's - can you show us a screenshot of an exact service which shouldn't be under localhost?
Code: Select all
define service {
host_name localhost
service_description HTTP - medlib5/probe/site_medlib.html
check_period xi_timeperiod_24x7
check_command check_website_response!
Code: Select all
define service {
host_name localhost
service_description HTTP - medlib5/probe/site_medlib.html
use Standard Check Settings,Critical to VictorOps [System Administrators - Email]
check_command check_website_response!http://dc01-vip-viewer.prod-cloud.com/medlib5/probe/site_medlib.html!!!!!!!
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
_xiwizard linux-server
register 1
}
define service {
host_name localhost
service_description HTTP - medlib6/901/config.xml
use Standard Check Settings,Critical to VictorOps [System Administrators - Email]
check_command check_website_response!http://dc01-vip-viewer.prod-cloud.com/medlib6/901/config.xml!!!!!!!
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
_xiwizard linux-server
register 1
}
define service {
host_name dc01-web-17
service_description HTTP - MUC - web-17
use Standard Check Settings,Critical to VictorOps [System Administrators - Email]
check_command check_website_response!dc01-web-17.prod-cloud.com/MUC-web/index.html!!!!!!!
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
_xiwizard linux-server
register 1
}
define service {
host_name dc01-web-18
service_description HTTP - MUC - web-18
use Standard Check Settings,Critical to VictorOps [System Administrators - Email]
check_command check_website_response!dc01-web-18.prod-cloud.com/MUC-web/index.html!!!!!!!
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
_xiwizard linux-server
register 1
}
Former Nagios Employee
-
philip.ianni
- Posts: 29
- Joined: Tue Dec 29, 2015 12:35 pm
Re: NagiosXI applying service checks to localhost
Thanks for your reply. Those service checks are intended to be there for localhost.rkennedy wrote:It looks like they are indeed being assigned -From one of your config files -Code: Select all
define service { host_name localhost service_description HTTP - medlib5/probe/site_medlib.html check_period xi_timeperiod_24x7 check_command check_website_response!Additionally, I couldn't find any checks called 'Linux - Base - Disk space' in your service_description's - can you show us a screenshot of an exact service which shouldn't be under localhost?Code: Select all
define service { host_name localhost service_description HTTP - medlib5/probe/site_medlib.html use Standard Check Settings,Critical to VictorOps [System Administrators - Email] check_command check_website_response!http://dc01-vip-viewer.prod-cloud.com/medlib5/probe/site_medlib.html!!!!!!! check_period xi_timeperiod_24x7 notification_period xi_timeperiod_24x7 _xiwizard linux-server register 1 } define service { host_name localhost service_description HTTP - medlib6/901/config.xml use Standard Check Settings,Critical to VictorOps [System Administrators - Email] check_command check_website_response!http://dc01-vip-viewer.prod-cloud.com/medlib6/901/config.xml!!!!!!! check_period xi_timeperiod_24x7 notification_period xi_timeperiod_24x7 _xiwizard linux-server register 1 } define service { host_name dc01-web-17 service_description HTTP - MUC - web-17 use Standard Check Settings,Critical to VictorOps [System Administrators - Email] check_command check_website_response!dc01-web-17.prod-cloud.com/MUC-web/index.html!!!!!!! check_period xi_timeperiod_24x7 notification_period xi_timeperiod_24x7 _xiwizard linux-server register 1 } define service { host_name dc01-web-18 service_description HTTP - MUC - web-18 use Standard Check Settings,Critical to VictorOps [System Administrators - Email] check_command check_website_response!dc01-web-18.prod-cloud.com/MUC-web/index.html!!!!!!! check_period xi_timeperiod_24x7 notification_period xi_timeperiod_24x7 _xiwizard linux-server register 1 }
An example of a service that is included localhost when we do not want in included would be:
ServiceName: "Linux - Base" Description: "Disk Space"
The corresponding file on the server is /usr/local/nagios/etc/services/"Linux - Base.cfg"
Thanks.
Re: NagiosXI applying service checks to localhost
Looking through your configurations I found the two services -
I assume neither of these should be there. I then noticed that one of your templates has a default host_name of localhost, with the same _VO_###### variable passed through to both of them.
If you had a random service that did not have a host assigned, then through the process of templates a service would be assigned to the localhost. I'm wondering if this could be affecting you. Could you try removing the host_name from the template and seeing if that fixes it?
Code: Select all
define service {
host_name localhost
service_description Disk Space
check_period 24x7
check_command check_diskSpace!-a '85 91 90 95'!!!!!!!
contact_groups VictorOps-SysAdmins-Email
notification_period 24x7
initial_state o
importance 0
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 3
is_volatile 0
parallelize_check 1
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options c
freshness_threshold 0
check_freshness 0
notification_options r,c
notifications_enabled 1
notification_interval 60.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
_VO_MONITOR_NAME Production x
_VO_ORGANIZATION_ID x
_VO_ORGANIZATION_KEY x
}
define service {
host_name localhost
service_description Drive C Disk Usage
check_period 24x7
check_command check_xi_service_nsclient!x!USEDDISKSPACE!-l C -w 70 -c 90!!!!!
contact_groups VictorOps-SysAdmins-Email
notification_period 24x7
initial_state o
importance 0
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 3
is_volatile 0
parallelize_check 1
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options c
freshness_threshold 0
check_freshness 0
notification_options r,c
notifications_enabled 1
notification_interval 60.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
_VO_MONITOR_NAME Production x
_VO_ORGANIZATION_ID x
_VO_ORGANIZATION_KEY x
}
Code: Select all
define service {
name VictorOps_Service_Settings
host_name localhost
process_perf_data 1
_VO_MONITOR_NAME x
_VO_ORGANIZATION_ID x
_VO_ORGANIZATION_KEY x
register 0
}
Former Nagios Employee
-
philip.ianni
- Posts: 29
- Joined: Tue Dec 29, 2015 12:35 pm
Re: NagiosXI applying service checks to localhost
Where are you seeing the _V_ entries like " _VO_ORGANIZATION_KEY x"? When I grep for on the server I only see it in the service template.
When I remove the host_name from the template it errors.
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/victorops-Leonardo.cfg', starting on line 136)
When I remove the host_name from the template it errors.
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/victorops-Leonardo.cfg', starting on line 136)
Re: NagiosXI applying service checks to localhost
Those were from your objects.cache file, which is compiled from all of your templates / configs.
Let's look at the services defind in your /usr/local/nagios/etc/services/Nagios.cfg -
(no host assigned)
which brings us to the template assigned -
which then leads to the template, where you have localhost assigned -
The other option is perhaps deleting the disk space check from this file in the CCM. (if it's not needed for anything else)
This would indicate that these services are depending on the template to get their host. If you manually assign localhost to the services mentioned in this file, does it persist to create the other checks? I don't think it will. Here's what I found after further looking -Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/victorops-Leonardo.cfg', starting on line 136)
Let's look at the services defind in your /usr/local/nagios/etc/services/Nagios.cfg -
Code: Select all
define service {
service_description Disk Space
use Standard Check Settings,Critical to VictorOps [System Administrators - Email]
check_command nagios_check_diskSpace!85 90 !!!!!!!
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
_xiwizard linux-server
register 1
}
which brings us to the template assigned -
Code: Select all
define service {
name Critical to VictorOps [System Administrators - Email]
use VictorOps_Service_Settings
notification_interval 60
first_notification_delay 0
notification_period 24x7
notification_options c,r,
notifications_enabled 1
contact_groups VictorOps-SysAdmins-Email
register 0
}
Code: Select all
define service {
name VictorOps_Service_Settings
host_name localhost
process_perf_data 1
_VO_MONITOR_NAME Production Nagios
_VO_ORGANIZATION_ID leonardo
_VO_ORGANIZATION_KEY cd94ae7e-5336-4755-b7a0-4cfbf6237db4
register 0
}
Former Nagios Employee
-
philip.ianni
- Posts: 29
- Joined: Tue Dec 29, 2015 12:35 pm
Re: NagiosXI applying service checks to localhost
Thanks for your help. I was able to figure out the issue. I didn't want to remove the host_name from the template because functionally I needed it there, but I was able to explicitly exclude localhost on each of the service checks so it doesn't skip over and configure localhost to run on that service.
Thanks again,
Phil
Thanks again,
Phil
Re: NagiosXI applying service checks to localhost
No problem - nice work around for it and use of templates
!
Going to close this thread up - feel free to create a new one if you have questions in the future!
Going to close this thread up - feel free to create a new one if you have questions in the future!
Former Nagios Employee