XI New User Defaults

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

XI New User Defaults

Post by asmgiadmin »

As discussed in previous thread, I am not using built in xi_notification_handlers for various reasons, and looking to keep my contact.cfg file as clean as possible.

I've verified that creating contact via CCM and then creating user in XI (admin->users) without checking box to associate with contact works just fine and receiving notification.

The problem is creating a new user requires two steps with this method, rather than going into admin -> users, creating new user and selecting option create core contact.

I've struggled to find where new user defaults are stored in XI.

Unchecking options by
Admin -> Notification Options

and saving to template does not work.

Can someone please advise if it possible to configure XI default user settings to only place the following info in the contact.cfg:

Code: Select all

define contact {
        contact_name                            username
        alias                                   User Name
        email                                   user@domain
        use                                     xi_contact_generic
        }
If admin -> notification options is to be used, will please provide step-by-step instructions?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: XI New User Defaults

Post by lmiltchev »

As discussed in previous thread, I am not using built in xi_notification_handlers for various reasons, and looking to keep my contact.cfg file as clean as possible.
define contact {
contact_name username
alias User Name
email user@domain
use xi_contact_generic
}
The "xi_contact_generic" template uses the "default" xi notification handlers ("xi_host_notification_handler" and "xi_service_notification_handler"). Are you trying to use these handlers, or you are trying to use "notify-host-by-email" and "notify-service-by-email", defined in the "generic-contact" template?
Be sure to check out our Knowledgebase for helpful articles and solutions!
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: XI New User Defaults

Post by asmgiadmin »

XI notification handlers are not being used. I've defined my own and assigned to xi_contact_generic. I'm using xi_contact_generic because it's automatically assigned to new contact when adding via XI. I'd like to keep new user creation as automatic as possible.

The issue I'd like to resolve is when creating new user in XI (admin -> users) and checking box to create corresponding contact, additional parameters are added to contact.cfg that I need to remove.

All of my contacts have host and service notification definitions defined and I cannot figure out how to remove.

Browsing CCM -> Contacts shows settings as skip, but notification definitions remain - thus nullifying my contact templates.

My work around is create a basic contact as described above and then create same user in XI without checking option to create corresponding core contact.

I'm wondering if defaults for new corresponding core contact can be changed to not include notification options and definitions and simply create basic contact.cfg as described above - without any notification options or definitions.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: XI New User Defaults

Post by lmiltchev »

The issue I'd like to resolve is when creating new user in XI (admin -> users) and checking box to create corresponding contact, additional parameters are added to contact.cfg that I need to remove.
These additional parameters are added, because users can modify their notification options (but contacts can't). I believe you can easily solve your issue by going to:

Code: Select all

CCM->Contacts->Add New->Manage Contact Template->xi_contact_generic->Add Selected->Close
Fill in the info in:

Contact Name
Description
Email Address

Active: checked

Save. Apply Configuration.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: XI New User Defaults

Post by asmgiadmin »

lmiltchev wrote:
The issue I'd like to resolve is when creating new user in XI (admin -> users) and checking box to create corresponding contact, additional parameters are added to contact.cfg that I need to remove.
These additional parameters are added, because users can modify their notification options (but contacts can't). I believe you can easily solve your issue by going to:

Code: Select all

CCM->Contacts->Add New->Manage Contact Template->xi_contact_generic->Add Selected->Close
Fill in the info in:

Contact Name
Description
Email Address

Active: checked

Save. Apply Configuration.

Hope this helps.
thanks - mentioned above that I've performed the steps mentioned as a work around.

Will you please answer if defaults can be modified to not include additional parameters?

Also, defining the additional parameters in the contact.cfg created a very large issue for me that I've spent the last week troubleshooting. I spent many hours trying to understand why contacts were still receiving alerts when the contact template had host alerts configured as off.

The contact alert option in CCM was set to skip, but additional parameters were still defined in contact.cfg and overriding contact template.

I only discovered additional parameters after browsing via console on XI server.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: XI New User Defaults

Post by slansing »

Is the contact itself set to skip? Rather than On or Off? If it is set to skip it will inherit the value from the object above it, user, template, etc. By default contacts that are created as a "monitoring contact" from the user creation process are set to skip, and thus inherit their values.. to my knowledge.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: XI New User Defaults

Post by asmgiadmin »

slansing wrote:Is the contact itself set to skip? Rather than On or Off? If it is set to skip it will inherit the value from the object above it, user, template, etc. By default contacts that are created as a "monitoring contact" from the user creation process are set to skip, and thus inherit their values.. to my knowledge.
Correct - except, additional parameters override inheritance.

Please try these steps at your leisure, as I've been attempting to explain my issue for days without resolution:

Create New user in XI (admin -> users)
Check box to create as contact
Modify Contact via CCM
Select Alert settings
Note that host / service notifications are set to skip
blank out host / service time period
uncheck all host / service notification options
set all remaining options to skip.
save
apply config

connect to XI server via SSH
vi /usr/local/nagios/etc/contacts.cfg

Notice that additional parameters are still present, thus overriding any inheritance.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: XI New User Defaults

Post by scottwilkerson »

Actually, when you create an XI user there are also some free variables set to force the notifications to be enabled (as they can be disabled on the user level)

You can remove them from the CCM -> Contacts -> Modify -> Misc Settings Tab -> Manage Variable Definitions
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: XI New User Defaults

Post by asmgiadmin »

Thank you, Scott - this is what I was looking for.

This is exactly my issue - forcing notifications to be enabled.

Is there a way from preventing the free variables from being added for each new XI user?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: XI New User Defaults

Post by slansing »

I believe this something nested pretty deeply in the user creation process though I will ask a developer about it when he comes in. Just food for thought:

Free variables(custom object variables):

NagiosQL supports custom object variables.
There are a few important things that you should note
about custom variables:

Custom variable names must begin with an
underscore (_) to prevent name collision
with standard variables

Custom variable names are case-insensitive

Custom variables are inherited from object
templates like normal variables

Scripts can reference custom variable
values with macros and environment
variables
Locked