Cisco UCSM Plugin Discovery

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
CFT6Server
Posts: 506
Joined: Wed Apr 15, 2015 4:21 pm

Cisco UCSM Plugin Discovery

Post by CFT6Server »

I've install the UCS plugin and addon. Trying to run the Auto discovery which places cfg files in /usr/local/nagios/etc/cisco/ucsObjs/. However once it does that, I can no longer verify the configurations. It is complaining about a contactgroup that it cannot find. I created the contactgroup and made sure it was there. Any idea what is happening here? I ran some tests with an earlier version of Nagios XI before with this plugin and didn't run into this problem. I however at the time did have to manually import the host/servers cfg and the service groups, which I get why. But I can no longer get the configuration working and I suspect it has something to do with the plugin directly placing files in the Nagios configuration folders?

Right after I run the discovery, I get errors when I click on Verify Configuration in the Write Config Files section.

Error Message:

Code: Select all

Error: Contactgroup '"UCS admins"' is not defined anywhere 
Error: Could not add contactgroup '"UCS admins"' to host (config file '/usr/local/nagios/etc/cisco/ucsObjs/kdcbchucs03/kdcbchucs03_fi_A.cfg', starting on line 1) 

Nagios Core 4.0.8 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-12-2014 
License: GPL 

Website: http://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
WARNING: Extinfo objects are deprecated and will be removed in future versions 
WARNING: Extinfo objects are deprecated and will be removed in future versions 
WARNING: Extinfo objects are deprecated and will be removed in future versions 
WARNING: Extinfo objects are deprecated and will be removed in future versions 
WARNING: Extinfo objects are deprecated and will be removed in future versions 
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/cisco/ucsObjs/cisco_ucs_host.cfg', starting at line 1) 
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/cisco/ucsObjs/cisco_ucs_service.cfg', starting at line 1) 
Error: Contactgroup '"UCS admins"' is not defined anywhere 
Error: Could not add contactgroup '"UCS admins"' to host (config file '/usr/local/nagios/etc/cisco/ucsObjs/ucs03/ucs03_fi_A.cfg', starting on line 1) 
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 previous 
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. 
My contact groups:
contact groups.JPG
Any suggestions? Perhaps I have to move all the configuration files from the Nagios folder and import everything?
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

Please post a sanitized copy of /usr/local/nagios/etc/cisco/ucsObjs/ucs03/ucs03_fi_A.cfg
CFT6Server
Posts: 506
Joined: Wed Apr 15, 2015 4:21 pm

Re: Cisco UCSM Plugin Discovery

Post by CFT6Server »

Here is the cfg.

Code: Select all

define host {
             use                     cisco-ucs-host
            host_name               <IP>_fi_A
            alias                   ucs03_fi_A
            parents                 ucs03
            address                 ucs03
            hostgroups             ucs03
            }
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

That didn't show it but what I'm seeing is that contact group it's actually looking for is called "UCS admins" (with the quotes).

After you run the autodiscovery post that file, don't try to apply/verify/or anything in between. Just do a autodiscovery so it writes the configs, then paste the contents of the file. I will look through the plugin while you do that.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

Actually, try to find where it's defined and post that so we can see if it's including the double-quotes in the definition:

Code: Select all

grep -R "UCS Admins" /usr/local/nagios/etc/cisco/ucsObjs
CFT6Server
Posts: 506
Joined: Wed Apr 15, 2015 4:21 pm

Re: Cisco UCSM Plugin Discovery

Post by CFT6Server »

Looks like the following:

Code: Select all

ucsObjs/cisco_ucs_host.cfg:contact_groups    "UCS admins"
ucsObjs/cisco_ucs_service.cfg:contact_groups    "UCS admins"

Code: Select all

# cat cisco_ucs_host.cfg
define host{
        name                           cisco-ucs-host    ; The name of this host template
        notifications_enabled           1       ; Host notifications are enabled
        event_handler_enabled           1       ; Host event handler is enabled
        flap_detection_enabled          1       ; Flap detection is enabled
        failure_prediction_enabled      1       ; Failure prediction is enabled
        process_perf_data               1       ; Process performance data
        retain_status_information       1       ; Retain status information across program restarts
        retain_nonstatus_information    1       ; Retain non-status information across program restarts
                check_command                   check-host-alive
                max_check_attempts              10
                notification_interval           0
                notification_period             24x7
                notification_options            d,u,r
contact_groups     "UCS admins"
        register                        0       ;
        }
These are all generated from the autodiscovery plugin.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

Yeah, there should not be any quotes on those, they are an illegal character in Nagios.

Try changing all occurences of:

Code: Select all

"UCS admins"
To:

Code: Select all

UCS admins
Then try to verify

I'm still digging through the plugin to figure out where those quotes get added for a fix.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

Also, what version of the plugin are you using?
CFT6Server
Posts: 506
Joined: Wed Apr 15, 2015 4:21 pm

Re: Cisco UCSM Plugin Discovery

Post by CFT6Server »

We are using version 0.9.3.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cisco UCSM Plugin Discovery

Post by ssax »

Did it verify properly once you changed them?
Locked