Page 1 of 2
XI New User Defaults
Posted: Mon Mar 25, 2013 6:52 pm
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?
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 8:36 am
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?
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 9:56 am
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.
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 11:17 am
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.
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 11:31 am
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.
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 12:28 pm
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.
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 12:38 pm
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.
Re: XI New User Defaults
Posted: Tue Mar 26, 2013 4:50 pm
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
Re: XI New User Defaults
Posted: Wed Mar 27, 2013 8:11 am
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?
Re: XI New User Defaults
Posted: Wed Mar 27, 2013 9:12 am
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