Environments within nagios


#1

I’ve created (2) roles:

development.rb

name "development"
description "Nodes in the development environment."
default_attributes(
“app_environment” => “development”

production.rb

name "production"
description "Nodes in the production environment."
default_attributes(
“app_environment” => “production”
)

When I deployed a development nagios server, it added all the required hosts
while giving it the “development” role. However, when i deployed a production
nagios server, it ALSO added the “development” role servers. In theory, this
should be empty since I have never rolled out a client server with a
"production" role. What am I doing wrong here?

I did notice that when i did knife node edit, it shows the default environment:

{
“name”: “localhost.localdomain”,
“chef_environment”: “_default”,
“normal”: {
“tags”: [

]

},
“run_list”: [
“role[monitoring]”,
“role[production]”,
“role[localhost]”,
“role[base_linux]”
]
}


#2

The nagios cookbook does per environment monitoring using Chef environments. Instead of creating a development and production role, create a development and production environment. Stick the nodes in the appropriate environment and then you should see isolated nagios servers that only monitor nodes in their own environment.

Tim Smith - Systems Engineer
m: +1 707.738.8132

On Sep 3, 2013, at 12:00 PM, nshah@theorchard.com wrote:

I’ve created (2) roles:

development.rb

name "development"
description "Nodes in the development environment."
default_attributes(
“app_environment” => “development”

production.rb

name "production"
description "Nodes in the production environment."
default_attributes(
“app_environment” => “production”
)

When I deployed a development nagios server, it added all the required hosts
while giving it the “development” role. However, when i deployed a production
nagios server, it ALSO added the “development” role servers. In theory, this
should be empty since I have never rolled out a client server with a
"production" role. What am I doing wrong here?

I did notice that when i did knife node edit, it shows the default environment:

{
“name”: “localhost.localdomain”,
“chef_environment”: “_default”,
“normal”: {
“tags”: [

]
},
“run_list”: [
“role[monitoring]”,
“role[production]”,
“role[localhost]”,
“role[base_linux]”
]
}


#3

Thanks Tim,

I think I drew a blank earlier. I ended up creating the actual environment and passing ‘-E production’ during my knife bootstrap process OR just doing knife node edit and updating the environment.
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.

On Sep 3, 2013, at 6:38 PM, Tim Smith tsmith@llnw.com wrote:

The nagios cookbook does per environment monitoring using Chef environments. Instead of creating a development and production role, create a development and production environment. Stick the nodes in the appropriate environment and then you should see isolated nagios servers that only monitor nodes in their own environment.

Tim Smith - Systems Engineer
m: +1 707.738.8132

On Sep 3, 2013, at 12:00 PM, nshah@theorchard.com wrote:

I’ve created (2) roles:

development.rb

name "development"
description "Nodes in the development environment."
default_attributes(
“app_environment” => “development”

production.rb

name "production"
description "Nodes in the production environment."
default_attributes(
“app_environment” => “production”
)

When I deployed a development nagios server, it added all the required hosts
while giving it the “development” role. However, when i deployed a production
nagios server, it ALSO added the “development” role servers. In theory, this
should be empty since I have never rolled out a client server with a
"production" role. What am I doing wrong here?

I did notice that when i did knife node edit, it shows the default environment:

{
“name”: “localhost.localdomain”,
“chef_environment”: “_default”,
“normal”: {
“tags”: [

]
},
“run_list”: [
“role[monitoring]”,
“role[production]”,
“role[localhost]”,
“role[base_linux]”
]
}