Page 1 of 1

WMI config error

Posted: Thu Feb 12, 2015 3:31 pm
by paulj
Hi I haven't been able to add a WMI host from my Hyper-V test domain.

Here is the error and the contents of the referenced config file.


Reading configuration data...
Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/192.168.102.30.cfg', starting on line 16)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previos
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.




Config File /usr/local/nagios/etc/services/192.168.102.30 contents.............

define service {
host_name 192.168.102.30
service_description LDAP
use xiwizard_tcp_service
check_command check_xi_service_tcp!-p 389
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}

define service {
host_name 192.168.102.30
service_description NetBIOS
use xiwizard_tcp_service
check_command check_xi_service_tcp!-p 139
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}

define service {
host_name 192.168.102.30
service_description Ping
use xiwizard_genericnetdevice_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}

define service {
host_name 192.168.102.30
service_description RDP
use xiwizard_tcp_service
check_command check_xi_service_tcp!-p 3389
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7


As you can see services and host are included in the config file so not sure how to resolve this. I have been through the steps of setting up the windows machine and the nagios host server.
Cheers pj

Re: WMI config error

Posted: Thu Feb 12, 2015 5:09 pm
by lmiltchev
When apply configuration fails, nagios reverts back to the last known good configuration. Looking at flat files may not give you the information you need.
Have you checked the configs of all services on 192.168.102.30 in the CCM? Do you see any snapshots, colored in red under the "Monitoring Configuration Snapshots" page? Have examined the one with config errors?

Re: WMI config error

Posted: Thu Feb 12, 2015 5:11 pm
by Box293
What version of XI do you have?

Go into CCM
Tools > Write Config Files
Click the Delete button
It will say "Successfully deleted all Host / Service Config Files"
NOTE: if you don't see a delete button, these two commands do the same as the delete button:

Code: Select all

rm -f /usr/local/nagios/etc/hosts/*.*
rm -f /usr/local/nagios/etc/services/*.*
Click the Write Button
It will show an output of all the files it creates
Click the Verify button
The output should end with "Total Errors: 0"

Do you get 0 errors?

If you don't please go and resolve the highlighted problem and then perform the steps above again.

If you don't have any errors what happens when you Apply Config?
Quick Tools > Apply Configuration
Click the Apply Configuration button

Re: WMI config error

Posted: Wed Feb 18, 2015 5:55 pm
by paulj
I resolved it by following these instructions

Go to Configure -> Core Config Manager -> Services (on the left side) and search for "192.168.103.30" to find the services for that host. Spot-check some of the services to make sure they have a service description and have at least one attached host under "Manage Hosts". If either is missing, please fill in appropriate values.

Save any offending services and click "Apply Config". If it fails, please open a ticket and include the error message.


Cheers for your responses.

Re: WMI config error

Posted: Thu Feb 19, 2015 12:10 pm
by cmerchant
Glad you resolved your config errors. We'll go ahead and close the thread. Thanks.