Override


#1

Does anyone of if its possible to have an override attribute for data bags? This is geared towards nagios, I’ve got templates checks that i’ve setup via data bags; however, for this individual host…I am trying to add a individual to this one check to get alerts.

I wanted to change just the contact_groups for this one items:

{
“id”: “windows_load”,
“hostgroup_name”: “windows”,
“command_line”: “USER1/check_nt -H HOSTADDRESS -p 12489 -v CPULOAD -l 5,80,90”,
“servicegroups”: “windows”,
“contact_groups”: “it”
}

Perhaps do something like:

override_attributes(
“nagios_services” =>
“windows_load” => { “contact_groups” => “developers” }
)

FYI - The nagios_services is the actual data bag; whereas the windows_load is the json file. Obviously, this is a json file and not sure mach a attribute.

Nikhil Shah / System Administrator
nshah@theorchard.com

The Orchard® / www.theorchard.com

t (+1) 212.308.5648 / f (+1) 212.201.9203
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / www.dailyrindblog.com
Facebook / @orchtweets

Privileged And Confidential Communication.
This electronic transmission, and any documents attached hereto, (a) are protected by the Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain confidential and/or legally privileged information, and © are for the sole use of the intended recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of the information received in error is strictly prohibited.


#2

You can use a service template to override the defaults for a specific service:

{
“id”: “windows_load”,
“hostgroup_name”: “windows”,
“command_line”: “USER1/check_nt -H HOSTADDRESS -p 12489 -v
CPULOAD -l 5,80,90”,
“servicegroups”: “windows”,
“service_template”: “it_contacts”
}

In data bag nagios_templates/it_contacts.json :

{
“id”: “it_contacts”,
“contact_groups”: “it”
}

Cheers

James

On Wed, Sep 18, 2013 at 8:12 PM, Nikhil Shah nshah@theorchard.com wrote:

Does anyone of if its possible to have an override attribute for data bags?
This is geared towards nagios, I’ve got templates checks that i’ve setup via
data bags; however, for this individual host…I am trying to add a individual
to this one check to get alerts.

I wanted to change just the contact_groups for this one items:

{
“id”: “windows_load”,
“hostgroup_name”: “windows”,
“command_line”: “USER1/check_nt -H HOSTADDRESS -p 12489 -v CPULOAD -l
5,80,90”,
“servicegroups”: “windows”,
“contact_groups”: “it”
}

Perhaps do something like:

override_attributes(
“nagios_services” =>
“windows_load” => { “contact_groups” => “developers” }
)

FYI - The nagios_services is the actual data bag; whereas the windows_load
is the json file. Obviously, this is a json file and not sure mach a
attribute.

Nikhil Shah / System Administrator
nshah@theorchard.com

The Orchard® / www.theorchard.com

t (+1) 212.308.5648 / f (+1) 212.201.9203
23 E. 4th St., 3rd Fl / New York, NY 10003

The Daily Rind™ / www.dailyrindblog.com
Facebook / @orchtweets

Privileged And Confidential Communication.
This electronic transmission, and any documents attached hereto, (a) are
protected by the Electronic Communications Privacy Act (18 USC §§
2510-2521), (b) may contain confidential and/or legally privileged
information, and © are for the sole use of the intended recipient named
above. If you have received this electronic message in error, please notify
the sender and delete the electronic message. Any disclosure, copying,
distribution, or use of the contents of the information received in error is
strictly prohibited.