Coder Social home page Coder Social logo

chef-icinga2's Introduction

icinga2 Cookbook

Cookbook Build Status Build Status

Icinga Logo

This is a Chef cookbook to manage Icinga2 using Chef LWRP.

For Production environment, always prefer the most recent release.

Repository

https://github.com/Icinga/chef-icinga2

Chef Supermarket

https://supermarket.chef.io/cookbooks/icinga2

Issue Tracking

For issue reporting or any discussion regarding this cookbook, open an issue.

Supported Platform

  • CentOS
  • Amazon
  • Debian
  • Ubuntu
  • Windows 10, Server 2012 R2

Chef Version

  • 12
  • 13

Contributing

See CONTRIBUTING.md

Major Changes

v4.0.0

  • Split icinga2 cookbook into different cookbooks
    • created cookbook icinga2repo for icinga2 yum/apt repository setup
    • created cookbook icingaweb2 for icingaweb2 setup
    • created cookbook icinga2client for icinga2 client setup
  • Icinga2 cookbook now only manage Icinga2 Server. Other components like packages repository, client, and icingaweb2 has been moved to different github repositories.
  • Icinga2 Classic UI is no longer under development (since Icinga2 v2.8.0).
  • Icinga Web2 setup is managed by cookbook icingaweb2.
  • Icinga2 Client setup is managed by cookbook icinga2client.
  • Icinga2 Repository setup is managed by cookbook icinga2repo. All Icinga2 cookbooks now uses icinga2repo for packages repository setup.
  • Created a separate file LWRP.md for LWRP Resources.

v2.9.1

  • Icinga2 ClassicUI is disabled by default, you can enable it by setting default['icinga2']['classic_ui']['enable'] value to true
  • Icingaweb2 installation is done by package instead of git source, you can change it via attribute default['icinga2']['web2']['install_method'] values package, source

v2.8.0

  • LWRP environment now generates endpoint/zone for every node to allow remote_execution.
  • LWRP environment now generates pki tickets in a data bag
  • Add example recipes to configure a client/remote_api server which allow external command execution
  • Allow to set command_endpoint as var and not only as string

v2.7.1

  • LWRP environment now generates conf file with resource name suffix to allow same environment multiple resources.

Existing host_ENVIRONMENT.conf configuration files needs to be purged manually to allow new file name configuration files.

New File Format:
With Zone: "host_#{environment}_#{zone}_#{resource_name}.conf"
Without Zone: "host_#{environment}_#{resource_name}.conf"

Old File Format:
With Zone: "host_#{environment}_#{zone}.conf"
Without Zone: "host_#{environment}.conf"

v2.6.9

  • Attribute default['icinga2']['user_defined_objects_d'] is deprecated. For User defined configuration directories, use Array attribute default['icinga2']['user_defined_objects_dir'] instead.

v2.0.1

  • icinga web2 uri updated to /icingaweb2

  • epel repository is by default enabled for rhel platform family except amazon platform

v0.10.1

  • Deprecated node features attribute and recipe icinga2::server_features in favour of LWRP feature

v0.7.0

  • LWRP environment now generates different conf file with zone name if resource attribute zone is defined

file name:

file name without zone: `host_#{environment}_#{resource_name}.conf`

file name with zone: `host_#{environment}_#{zone}_#{resource_name}.conf`

Note: Cookbook version prior to v0.7.0 users must delete configuration file host_#{environment}.conf manually if zone attribute is defined.

Note: Cookbook version prior to v2.7.1 users must delete configuration files host_#{environment}.conf / host_#{environment}_#{zone}.conf manually.

Cookbook Dependencies

  • ulimit
  • yum-epel
  • chocolatey
  • icinga2repo

Recipes

  • icinga2::default - run_list recipe

  • icinga2::install - install icinga2 package

  • icinga2::config - configure icinga2

  • icinga2::objects - manages icinga2 default objects/templates objects if node['icinga2']['disable_conf_d'] is set in which case conf.d objects config is not included in icinga2.conf and objects are created using LWRP

  • icinga2::service - configure icinga2 service

Icinga2 Default Configuration Directory

If you are using this cookbook to manage icinga2 configuration, set default['icinga2']['disable_conf_d'] to true.

Cookbook generated configuration files using LWRP are created under directory default['icinga2']['objects_dir'].

default['icinga2']['disable_conf_d'] default value is set to true.

Icinga2 Cookbooks and Recipes

How to Install and Configure Icinga2 Server?

Add recipe icinga2::default to run_list.

How to Setup Icinga2 YUM/APT Repository?

Cookbook icinga2repo::default is used to setup icinga2 yum/apt repository. For more information, see cookbook icinga2repo.

How to Install and Configure Icinga2 Client?

Add recipe icinga2client::default to run_list. For more information, see cookbook icinga2client.

How to Install and Configure Icingaweb2?

Add recipe icingaweb2::default to run_list. For more information, see cookbook icingaweb2.

Icinga2 Cluster Deployment

Icinga2 Distributed / HA cluster setup examples will be added soon.

Icinga2 Monitor a Chef Environment Nodes

This cookbook does not only provide management of Icinga2 server & objects, it also provides automation around Chef environment.

Using LWRP environment a whole environment nodes can be added to Host objects with environment wide Host object parameters.

There are certain functionalities added to LWRP environment, like:

  • define icinga2 Host parameters for an entire environment

  • auto create HostGroup object for an entire chef environment

  • auto create HostGroup object for node's application attribute to group nodes for an entire chef environment application type

  • auto create HostGroup object for node's cluster attribute to group nodes for a chef environment cluster

  • auto add chef node Cloud attributes as Host custom vars, currently only AWS EC2 attributes are supported, but is easy to extend the support to other cloud providers

  • auto create HostGroup list for a chef environment node

  • limit a chef environment spreaded across multiple regions to icinga2 server region, e.g. in multi region ec2 production environment, one would want to setup an icinga2 server in region us-east-1 just to monitor us-east-1 nodes, but not the production nodes of other regions, like ap-southeast-1

  • allow chef node to determine host.address from node['fqdn'] DNS resolution instead of node['ipaddress'] and either ignore chef node if failed to resolve DNS or fallback to use node['ipaddress'] as host.address

  • exclude a node by run_list role, not yet tested

  • exclude a node by run_list role, not yet tested

  • filter chef node if match certain node attributes

  • override an environment and use an entire different search_pattern, this feature extends LWRP environment functionality to select nodes by a user given search pattern

  • Host object attribute display_name is set to chef node hostname

  • can exclude chef nodes from icinga2 monitoring if attribute node['monitoring_off'] is set

Simply create a LWRP resource for a chef environment, to start monitoring all nodes in that environment. More details can be found in examples.

Icinga2 Monitor an User Defined Chef Environment Nodes/HostGroups

Last section explains the benefits of using LWRP environment using in built library search function to determine chef_environment nodes / icinga2 Host and auto create icinga2 HostGroup.

This section explains how a user can provide a custom inventory list of nodes, host groups etc.

To find all the valid chef nodes for a chef environment, this cookbook uses default library icinga2::search. There are lots of custom & cloud specific attributes embedded in it which may or may not work for every scenarios.

To overcome and make it less enforcing, LWRP environment has a Hash attribute env_resources which can be used by an user from a wrapper cookbook recipe to pass chef environment nodes & hostgroups & endpoints & zones. If this attribute is set, cookbook will not use default library to search chef_environment nodes and will create Host objects for user defined values.

env_resources Hash attributes has below valid key names:

  • nodes - Hash of {:Hostfqdn => {icinga2 Host attributes}, :Hostfqdn => {icinga2 Host attributes}, …}
  • clusters - Array of cluster HostGroups […] if any
  • applications - Array of application HostGroups […] if any
  • roles - Array of roles HostGroups […] if any

e.g.

icinga2_environment 'UserDefinedEnvironment' do
  import node['icinga2']['object']['host']['import']
  environment 'production'
  check_interval '1m'
  retry_interval '10s'
  max_check_attempts 3
  action_url '/pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_'
  env_resources :nodes => {:fqdn => {attrs}, :fqdn => {attrs}}
end

For more details about nodes attributes, check LWRP environment object template.

Like env_resources, user can also define custom template for LWRP environment using attribute cookbook and template.

Icinga2 Global Host Custom Vars

environment LWRP Host Vars

LWRP environment resources sets Host custom vars for each node via node Hash attribute - node['icinga2']['client']['custom_vars']. All defined vars will be added to Host object.

host LWRP Host Vars

When using icinga2_host LWRP, node custom vars will not be added automatically. There will be no search performed as the Host object could be different than a chef Node.

To add Host custom vars, use Hash attribute custom_vars.

A resource attribute will be added to icinga2_host LWRP to perform a search to fetch custom vars defined for a node, so that manual addition is not required.

Icinga2 Node Attributes as Host Custom Vars

environment resource attribute add_node_vars can add a node attribute to Host custom vars.

e.g. to add a custom var hardware with value of node attribute node['dmi']['system']['manufacturer']

icinga2_environment 'environment' do
  add_node_vars 'hardware' => %w(dmi system manufacturer)
end

It will add a custom var vars.hardware to environment Host objects.

Icinga2 User Defined Objects / Configuration

Attribute node['icinga2']['user_defined_objects_dir'] manages user defined configuration directories location.

Directories will be created under /etc/icinga2/ and also included in icinga2.conf.

LWRP

See LWRP.md for icinga2 resources.

Cookbook Advanced Attributes

  • default['icinga2']['ignore_version'] (default: false): ignore icinga2 package version

  • default['icinga2']['disable_conf_d'] (default: true): disable icinga2 conf.d default configuration directory in icinga2.conf and use LWRP to manage icinga2 objects / templates

  • default['icinga2']['disable_repository_d'] (default: false): disable icinga2 repository.d directory in icinga2.conf

  • default['icinga2']['include_itl'] (default: itl, plugins): icinga2.conf include itl array attribute

  • default['icinga2']['add_cloud_custom_vars'] (default: true): add cloud node attributes, limited cloud provider support is available

  • default['icinga2']['add_inet_custom_vars'] (default: false): add node inet ip addresses custom vars

  • default['icinga2']['features_enabled_dir'] (default: /etc/icinga2/features-enabled): icinga2 enabled features location

  • default['icinga2']['features_available_dir'] (default: /etc/icinga2/features-available): icinga2 available features location

  • default['icinga2']['cluster_attribute'] (default: nil): icinga2 node cluster attribute name to add node cluster attribute and value to node vars

  • default['icinga2']['application_attribute'] (default: nil): icinga2 node application attribute name to add node application attribute and value to node vars

  • default['icinga2']['enable_cluster_hostgroup'] (default: true): creates icinga2 HostGroup Objects for environment clusters

  • default['icinga2']['enable_application_hostgroup'] (default: true): creates icinga2 HostGroup Objects for environment application types

  • default['icinga2']['enable_role_hostgroup'] (default: false): creates icinga2 HostGroup Objects for environment roles

  • default['icinga2']['limit_region'] (default: true): whether to limit monitoring to icinga2 server region, e.g. for ec2 collect nodes belongs to same region

  • default['icinga2']['host_display_name_attr'] (default: hostname): whether to use hostname or fqdn or name (chef node name) for environment resource Host Object attribute display_name, options: hostname fqdn

  • default['icinga2']['use_fqdn_resolv'] (default: false): whether to determine node address from fqdn

  • default['icinga2']['failover_fqdn_address'] (default: true): whether to use ohai attribute node['ipaddress'] if node fqdn does not exists

  • default['icinga2']['ignore_node_error'] (default: false): whether to ignore node errors if node fqdn, hostname and chef_environment is missing while collecting for a chef environment

  • default['icinga2']['ignore_resolv_error'] (default: true): whether to ignore node fqdn resolve errors while collecting for a chef environment

  • default['icinga2']['enable_env_pki'] (default: false): whether to create env endpoints, zones and pki_tickets

  • default['icinga2']['enable_env_custom_pki'] (default: false): LWRP Parameter, should not be a node attribute

Cookbook Core Attributes

  • default['icinga2']['version'] (default: 2.8.0-X, calculated): icinga2 package version

  • default['icinga2']['setup_epel'] (default: true): if set includes cookbook recipe yum-epel::default for rhel and fedora platform_family

  • default['icinga2']['cookbook'] (default: icinga2): icinga2 resources cookbook name

  • default['icinga2']['conf_dir'] (default: /etc/icinga2): icinga2 configuration location

  • default['icinga2']['conf_d_dir'] (default: /etc/icinga2/conf.d): icinga2 conf.d directory location

  • default['icinga2']['pki_dir'] (default: /etc/icinga2/pki): icinga2 pki directory location

  • default['icinga2']['scripts_dir'] (default: /etc/icinga2/scripts): icinga2 script directory location

  • default['icinga2']['zones_dir'] (default: /etc/icinga2/zones.d): icinga2 zones.d directory location

  • default['icinga2']['databag'] (default: icinga2): icinga2 databag name, currently not used

  • default['icinga2']['objects_d'] (default: objects.d): cookbook created icinga2 Object/Templates resources directory name

  • default['icinga2']['objects_dir'] (default: /etc/icinga2/objects.d): cookbook created icinga2 Object/Templates resources directory location

  • default['icinga2client']['var_dir'] (default: calculated): icinga2 run directory

  • default['icinga2']['run_dir'] (default: /var/run/icinga2): icinga2 run directory

  • default['icinga2']['run_cmd_dir'] (default: /var/run/icinga2/cmd): icinga2 location for process icinga2.cmd

  • default['icinga2']['cache_dir'] (default: /var/cache/icinga2): icinga2 cache directory location

  • default['icinga2']['spool_dir'] (default: /var/spool/icinga2): icinga2 spool directory location

  • default['icinga2']['lib_dir'] (default: /var/lib/icinga2): icinga2 lib directory location

  • default['icinga2']['log_dir'] (default: /var/log/icinga2): icinga2 core process log directory location

  • default['icinga2']['cache_dir'] (default: /var/cache/icinga2): icinga2 cache directory location

  • default['icinga2']['perfdata_dir'] (default: /var/spool/icinga2/perfdata): icinga2 perfdata directory location

  • default['icinga2']['service_name'] (default: icinga2): icinga2 process name

  • default['icinga2']['service_config_file'] (default: /etc/default/icinga2): icinga2 * process configuration file

  • default['icinga2']['plugins_dir'] (default: /usr/lib/nagios/plugins): icinga2 plugins directory location

  • default['icinga2']['custom_plugins_dir'] (default: /opt/icinga2_custom_plugins): icinga2 custom plugins directory

  • default['icinga2']['admin_user'] (default: icingaadmin): icinga2 admin user

  • default['icinga2']['user'] (default: icinga): icinga2 user

  • default['icinga2']['group'] (default: icinga): icinga2 user group

  • default['icinga2']['cmdgroup'] (default: icingacmd): icinga2 cmd user group

  • default['icinga2']['user_defined_objects_dir'] (default: ['user_defined_objects']): user defined configuration directories, each directory is included in icinga2.conf file.

  • default['icinga2']['endpoint_port'] (default: 5665): icinga2 endpoint port

  • default['icinga2']['version_suffix'] (default: calculated): icinga2 package suffix

Cookbook Icinga2 Constants Attributes

  • default['icinga2']['constants']['NodeName'] (default: node['fqdn']): icinga2 NodeName constant

  • default['icinga2']['constants']['PluginDir'] (default: node['icinga2']['plugins_dir']): icinga2 plugins directory location

  • default['icinga2']['constants']['ManubulonPluginDir'] (default: node['icinga2']['plugins_dir']): icinga2 plugins directory location

  • default['icinga2']['constants']['TicketSalt'] (default: ed25aed394c4bf7d236b347bb67df466): icinga2 default TicketSalt key

Cookbook Icinga2 Host Object default Attributes

  • default['icinga2']['object']['global-templates'] (default: false)

  • default['icinga2']['object']['host']['import'] (default: 'generic-host)

  • default['icinga2']['object']['host']['max_check_attempts'] (default: 3)

  • default['icinga2']['object']['host']['check_period'] (default: nil)

  • default['icinga2']['object']['host']['notification_period'] (default: nil)

  • default['icinga2']['object']['host']['check_interval'] (default: 1800)

  • default['icinga2']['object']['host']['retry_interval'] (default: 60)

  • default['icinga2']['object']['host']['enable_notifications'] (default: true)

  • default['icinga2']['object']['host']['enable_active_checks'] (default: true)

  • default['icinga2']['object']['host']['enable_passive_checks'] (default: false)

  • default['icinga2']['object']['host']['enable_event_handler'] (default: true)

  • default['icinga2']['object']['host']['enable_flapping'] (default: true)

  • default['icinga2']['object']['host']['enable_perfdata'] (default: true)

  • default['icinga2']['object']['host']['event_command'] (default: nil)

  • default['icinga2']['object']['host']['flapping_threshold'] (default: nil)

  • default['icinga2']['object']['host']['volatile'] (default: nil)

  • default['icinga2']['object']['host']['check_command'] (default: hostalive)

  • default['icinga2']['object']['host']['zone'] (default: nil)

  • default['icinga2']['object']['host']['command_endpoint'] (default: nil)

Cookbook Ulimit Attributes

  • default['icinga2']['limits']['memlock'] (default: unlimited): Icinga2 service user memory limit

  • default['icinga2']['limits']['nofile'] (default: 48000): Icinga2 service user file limit

  • default['icinga2']['limits']['nproc'] (default: unlimited): Icinga2 service user process limit

Copyright & License

Authors:: Check AUTHORS file

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

chef-icinga2's People

Contributors

bobapple avatar cah-jeremykuhn avatar csandwith avatar cyberflow avatar farvour avatar gsreynolds avatar hfinucane avatar jannikzed avatar jeroenj avatar joerg avatar melonsmasher avatar petergphillips avatar rusia-rak avatar siebertm avatar stibi avatar techcadia avatar techiscool avatar vills avatar vkhatri avatar vncntvandriessche avatar zhann avatar zhmurko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-icinga2's Issues

[dev.icinga.com #8469] mod_python deprecated for centos7/rhel7

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8469

Created by JannikZed on 2015-02-18 14:44:08 +00:00

Assignee: vkhatri
Status: Resolved (closed on 2015-02-20 14:04:41 +00:00)
Target Version: (none)
Last Update: 2015-02-20 14:04:41 +00:00 (in Redmine)


The httpd module "mod_python" is no longer provided via official package-repositories (this time I checked epel, too :D). After short research on that topic, I noticed, that this package is now superseded by mod_wgsi.
How do we want to handle that topic?

[dev.icinga.com #8470] iptables Port 80 for icingaweb2

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8470

Created by JannikZed on 2015-02-18 14:47:29 +00:00

Assignee: vkhatri
Status: Rejected (closed on 2015-02-20 14:01:30 +00:00)
Target Version: (none)
Last Update: 2015-02-20 14:01:30 +00:00 (in Redmine)


Do you want me to include in the icingaweb2 cookbook the command for iptables to open port 80 or is that out of scope for this cookbook?

[dev.icinga.com #9066] checkcommand lwrp accepts only String key value for attribute args

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9066

Created by vkhatri on 2015-04-15 12:59:57 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-15 13:01:37 +00:00)
Target Version: (none)
Last Update: 2015-04-15 13:01:37 +00:00 (in Redmine)


Error executing action `create` on resource 'template[/etc/icinga2/objects.d/checkcommand.conf]'

Chef::Mixin::Template::TemplateError

undefined method `each' for 85:Fixnum

Resource Declaration:

  1. In /var/chef/cache/cookbooks/icinga2/providers/checkcommand.rb

58: ot = template ::File.join(node['icinga2']['objects_dir'], "#{::File.basename(FILE, '.rb')}.conf") do
59: source "object.#{::File.basename(FILE, '.rb')}.conf.erb"
60: cookbook 'icinga2'
61: owner node['icinga2']['user']
62: group node['icinga2']['group']
63: mode 0640
64: variables(:objects => icinga2_objects)
65: notifies :reload, 'service[icinga2]', :delayed
66: end
67: ot.updated?

[dev.icinga.com #8346] Additional database-creation

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8346

Created by JannikZed on 2015-02-03 12:41:52 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-02-06 17:15:53 +00:00)
Target Version: (none)
Last Update: 2015-02-06 17:15:53 +00:00 (in Redmine)


The current state of the cookbook assumes that there exists an pre-configured database-server. I forked the icinga2 repository and added a new cookbook and dependencies to automatically install and configure postgres-/mysql-server. I depends on the official postgres and mysql cookbooks from the chef supermarket.
I can add a new pull request in github, if you are interested in that feature.

[dev.icinga.com #9019] icinga2_environment disks gets Error: critical/config: Error: Array iterator requires value to be an array.

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9019

Created by nexeck on 2015-04-08 19:20:45 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-10 15:00:15 +00:00)
Target Version: (none)
Last Update: 2015-04-10 15:00:15 +00:00 (in Redmine)


Versions:

  • Chef: 12.2.1
  • Centos: 7.1.1503
  • Icinga2: 2.3.3-1.el7.centos
  • chef-icinga2: 2.1.8

chef recipe

icinga2_environment 'Production' do
  import node['icinga2']['server']['object']['host']['import']
  environment 'production'
  check_interval '1m'
  retry_interval '10s'
  max_check_attempts 3
end

Error

[2015-04-08 20:59:31 +0200] critical/config: Error: Array iterator requires value to be an array.
Location:
/etc/icinga2/conf.d/services.conf(64): }
/etc/icinga2/conf.d/services.conf(65):
/etc/icinga2/conf.d/services.conf(66): apply Service for (disk => config in host.vars.disks) {
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/etc/icinga2/conf.d/services.conf(67):   import "generic-service"
/etc/icinga2/conf.d/services.conf(68):

Part of services.conf

apply Service for (disk => config in host.vars.disks) {
  import "generic-service"

  check_command = "disk"

  vars += config
}

Part of Generated host_.conf

object Host "XXXX" {
  import "generic-host"
  display_name = "chef"
  address = "XXXX"
  address6 = "XXXX"
  groups = ["production"]
  max_check_attempts = 3
  check_interval = 1m
  retry_interval = 10s
  vars.cpu = 2
  vars.disks = ["/dev/mapper/vg_chef-lv_root", "/dev/sda1"]
  vars.environment = "production"
  vars.hostgroups = ["production"]
  vars.memory = "1877MB"
  vars.platform = "centos"
  vars.platform_version = "6.6"
  vars.remote_client = "XXXX"
  vars.run_list = "role[default], role[rhel]"
  vars.tags = []
}

[dev.icinga.com #9129] classic ui unable to access icinga2 objects.cache on ubuntu platform

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9129

Created by vkhatri on 2015-04-20 17:44:08 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-21 04:12:52 +00:00)
Target Version: (none)
Last Update: 2015-04-21 04:12:52 +00:00 (in Redmine)


[1429550334] Error: Cannot open config file '/var/cache/icinga2/objects.cache' for reading: Permission denied

possible quick fix is to add apache2 user [www-data] to icinga service group [nagios]

[dev.icinga.com #8635] server recipe reorg in favor of client recipe

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8635

Created by vkhatri on 2015-03-08 14:46:12 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-03-08 15:31:52 +00:00)
Target Version: (none)
Last Update: 2015-03-08 15:31:52 +00:00 (in Redmine)


  • split core configs to new recipe - core_config
  • update server_core recipe only for mail notification scripts
  • split icinga2 service to new recipe - service
  • add client recipe with basic icinga2 packages and configuration files

[dev.icinga.com #8841] Is it possible to add certs and ticket via chef

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8841

Created by saurabh_hirani on 2015-03-23 06:35:14 +00:00

Assignee: vkhatri
Status: Assigned
Target Version: (none)
Last Update: 2015-11-19 06:52:32 +00:00 (in Redmine)


icinga2 is a great tool and I am doing a setup via chef. For a setup of 2 nodes in a master zone and 2 nodes in a checker zone (with their parent master), I am unable to find out the chef resources to do the initial cert generation and checker zone setup. When I did the setup manually without chef the wizard was very useful and I had to do a "icinga2 pki ticket -cn client" and I could setup the checker zone nodes. Is there a similar way to do so via chef? If not then do we follow the steps mentioned in http://serverfault.com/questions/647805/how-to-set-up-icinga2-remote-client-without-using-cli-wizard to get this working the wizard is interactive and if we are automating that we have to do it in a non-interactive way.

[dev.icinga.com #9174] make Host Object atttribute display_name configurable for LWRP environment

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9174

Created by vkhatri on 2015-04-25 10:38:33 +00:00

Assignee: vkhatri
Status: Resolved (closed on 2015-04-25 16:26:12 +00:00)
Target Version: (none)
Last Update: 2015-04-25 16:26:12 +00:00 (in Redmine)


add resource attribute `host_display_name_attr` to LWRP environment. this attribute can be configured for two values - hostname fqdn

default to node attribute `node['icinga2']['host_display_name_attr']`

[dev.icinga.com #8863] object_name removed but documentation and examples still use it

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8863

Created by saurabh_hirani on 2015-03-25 12:49:29 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-03-25 18:26:14 +00:00)
Target Version: (none)
Last Update: 2015-03-31 05:23:31 +00:00 (in Redmine)


The changelog has an entry - removed object_name LWRP applyservice resource attribute but the documentation at https://github.com/Icinga/chef-icinga2/blob/master/README.md still uses object_name without any reference to it and the example recipe also uses it heavily.

[dev.icinga.com #8840] icinga2 agent setup using environment resource

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8840

Created by vkhatri on 2015-03-23 02:21:22 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-09-27 17:14:24 +00:00)
Target Version: (none)
Last Update: 2015-09-27 17:14:24 +00:00 (in Redmine)


creating master issue to track sub tasks for icinga2 agent setup.

few of the sub tasks i can think of are:

  • add envendpoint for environment resource (create endpoint object for each chef node)
  • add envzone for environment resource (create zone object for each chef node)
  • ..

[dev.icinga.com #8631] add default endpoint port

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8631

Created by vkhatri on 2015-03-08 10:26:39 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-03-08 15:33:07 +00:00)
Target Version: (none)
Last Update: 2015-03-08 15:33:07 +00:00 (in Redmine)


add attribute default['icinga2']['endpoint_port'] = 5665 to be used across lwrp for endpoint port.

[dev.icinga.com #8476] disable user_defined_objects_dir

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8476

Created by ascopenco on 2015-02-19 10:58:35 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-02-20 13:54:34 +00:00)
Target Version: (none)
Last Update: 2015-02-24 09:53:38 +00:00 (in Redmine)


I think is good practice to include used only directories to icinga2.conf and disable/remove unused optional directories. I have created PR #21 that allow to disable user_defined_objects_dir, because it's optional directory for icinga2.

[dev.icinga.com #9173] update LWRP environment & README for monitoring_off

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9173

Created by vkhatri on 2015-04-25 10:03:25 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-25 10:49:49 +00:00)
Target Version: (none)
Last Update: 2015-04-25 10:49:49 +00:00 (in Redmine)


chef node search library should ignore the node if attribute `node['monitoring_off']` is set without any further check.

README needs to be updated with this info.

[dev.icinga.com #8377] rhel-package php-pecl-imagick impossible to install via yum

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8377

Created by JannikZed on 2015-02-06 09:25:03 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-02-13 17:02:16 +00:00)
Target Version: (none)
Last Update: 2015-02-13 17:02:16 +00:00 (in Redmine)


The package php-pecl-imagick is one package to be installed via yum:
when 'rhel'
os_packages = %w(gcc gcc-c** glibc glibc-common mailx php php-devel gd gd-devel libjpeg libjpeg-devel libpng libpng-devel php-gd php-fpm php-cli php-pear php-xmlrpc php-xsl php-pdo php-soap php-ldap php-mysql php-pgsql php-pecl-imagick php-intl git)
end

This command fails, because the package is not a yum package. I don't know where it is used, but either you remove it from the list or you chef needs to compile it via gcc:
$ yum install ImageMagick ImageMagick-devel
$ pecl install imagick
$ echo "extension=imagick.so" > /etc/php.d/imagick.ini

>[2015-02-06T08:57:55+00:00] ERROR: yum_package[php-pecl-imagick] (icinga2::server_os_packages line 32) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for php-pecl-imagick

[dev.icinga.com #9038] RPM Package Name > centos Suffix with EL7

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9038

Created by nexeck on 2015-04-09 18:42:18 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-10 14:57:06 +00:00)
Target Version: (none)
Last Update: 2015-04-10 14:57:06 +00:00 (in Redmine)


The Icinga packages for EL7 have a suffix @ http://packages.icinga.org/epel/7/release/x86\_64/

EL6 does not have this suffix: http://packages.icinga.org/epel/6/release/x86\_64/

    Chef::Exceptions::Package
    -------------------------
    Version 2.3.3-1.el7 of icinga2 not found. Did you specify both version and release? (version-release, e.g. 1.84-10.fc6)

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/icinga2/recipes/core_install.rb

     46: package 'icinga2' do
     47:   version node['icinga2']['version'] + node['icinga2']['icinga2_version_suffix'] unless node['icinga2']['ignore_version']
     48:   notifies :restart, 'service[icinga2]', :delayed
     49: end

[dev.icinga.com #8468] SELinux context for "/etc/icingaweb2" for icingaweb2

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8468

Created by JannikZed on 2015-02-18 14:36:01 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-09-29 11:53:05 +00:00)
Target Version: (none)
Last Update: 2015-09-29 11:53:05 +00:00 (in Redmine)


The default config-file path for icingaweb2 is located in /etc/icingaweb2. Httpd/apache web-server is not allowed to write there because of SElinux restrictions. Should we enable that in the icingaweb2 cookbook or should we change the default config-file directory?

[dev.icinga.com #8991] icinga2 reload causes crashes intermittently

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8991

Created by saurabh_hirani on 2015-04-04 08:51:50 +00:00

Assignee: vkhatri
Status: Rejected (closed on 2015-04-09 14:28:21 +00:00)
Target Version: (none)
Last Update: 2015-04-10 05:14:08 +00:00 (in Redmine)


I am migrating nagios checks to icinga2 using the cheffed icinga2 cookbook. Cheffing the node creates files in /etc/icinga2/objects.d/ - sometimes when I clear all the files in this directory and run a chef to see the new files created, the files are created fine but sometimes post that operation when icinga2 reload is called via the recipe icinga2 crashes intermittently with the following file created in /var/log/icinga2/

Caught unhandled exception.
Current time: 2015-04-02 18:42:17 +0530

Application information:
Application version: r2.3.2-1
Installation root: /usr
Sysconf directory: /etc
Run directory: /run
Local state directory: /var
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
Application type: icinga/IcingaApplication

Error: Function call 'rename' for file '/var/cache/icinga2/icinga2.debug.tmp' failed with error code 2, 'No such file or directory'

*****

  • This would indicate a runtime problem or configuration error. If you believe this is a bug in Icinga 2
  • please submit a bug report at https://dev.icinga.org/ and include this stack trace as well as any other
  • information that might be useful in order to reproduce this problem.
    *****
    Could not attach to process. If your uid matches the uid of the target
    process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
    again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
    ptrace: Operation not permitted.
    The program is not being run.

And till now it has always failed with the same error - Error: Function call 'rename' for file '/var/cache/icinga2/icinga2.debug.tmp' failed with error code 2, 'No such file or directory'

[dev.icinga.com #9001] add attribute to ignore default icinga2 package version

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9001

Created by vkhatri on 2015-04-07 10:01:15 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-07 10:07:29 +00:00)
Target Version: (none)
Last Update: 2015-04-07 10:07:29 +00:00 (in Redmine)


this will allow users to install latest available icinga2 version if cookbook defined version is not available in repo.

default['icinga2']['ignore_version']

[dev.icinga.com #8788] classic_ui cgi resource_file nil string

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8788

Created by thoth on 2015-03-18 02:47:19 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-05-05 02:50:56 +00:00)
Target Version: (none)
Last Update: 2015-05-05 02:50:56 +00:00 (in Redmine)


I'm getting build failures at this point in a chef-solo install:

104>> default['icinga2']['classic_ui']['cgi']['resource_file'] = ::File.join(node['icinga2']['classic_ui']['conf_dir'], 'resource.cfg')

It's all in a docker container like so::
https://github.com/joshuacox/debmon-docker

[2015-03-18T02:25:59+00:00] INFO: Run List expands to [apt, apache2, icinga2::default, icinga2::repo, icinga2::server, icinga2::server_constants, icinga2::server_objects, icinga2::server_pnp, icinga2::server_ido, icinga2::server_web2]
[2015-03-18T02:25:59+00:00] INFO: Starting Chef Run for da7ab459b163
[2015-03-18T02:25:59+00:00] INFO: Running start handlers
[2015-03-18T02:25:59+00:00] INFO: Start handlers complete.

================================================================================
Recipe Compile Error in /var/chef/cookbooks/icinga2/attributes/server_classic_ui.rb
================================================================================

TypeError
---------
no implicit conversion of nil into String

Cookbook Trace:
---------------
  /var/chef/cookbooks/icinga2/attributes/server_classic_ui.rb:104:in `join'
  /var/chef/cookbooks/icinga2/attributes/server_classic_ui.rb:104:in `from_file'

Relevant File Content:
----------------------
/var/chef/cookbooks/icinga2/attributes/server_classic_ui.rb:

 97:  default['icinga2']['classic_ui']['cgi']['tab_friendly_titles'] = 1
 98:  ######################################
 99:  #    STANDALONE (ICINGA 2) OPTIONS'
100:  #    requires standalone_installation
101:  ######################################
102:  default['icinga2']['classic_ui']['cgi']['object_cache_file'] = ::File.join(node['icinga2']['cache_dir'], 'objects.cache') # '/var/cache/icinga2/objects.cache'
103:  default['icinga2']['classic_ui']['cgi']['status_file'] = ::File.join(node['icinga2']['cache_dir'], 'status.dat')
104>> default['icinga2']['classic_ui']['cgi']['resource_file'] = ::File.join(node['icinga2']['classic_ui']['conf_dir'], 'resource.cfg')
105:  default['icinga2']['classic_ui']['cgi']['command_file'] = ::File.join(node['icinga2']['run_dir'], 'cmd', 'icinga2.cmd')
106:  default['icinga2']['classic_ui']['cgi']['check_external_commands'] = 1
107:  default['icinga2']['classic_ui']['cgi']['interval_length'] = 60
108:  default['icinga2']['classic_ui']['cgi']['status_update_interval'] = 10
109:  default['icinga2']['classic_ui']['cgi']['log_file'] = ::File.join(node['icinga2']['log_dir'], 'compat', 'icinga.log')
110:  default['icinga2']['classic_ui']['cgi']['log_rotation_method'] = 'h'
111:  default['icinga2']['classic_ui']['cgi']['log_archive_path'] = ::File.join(node['icinga2']['log_dir'], 'compat', 'archives')
112:  default['icinga2']['classic_ui']['cgi']['date_format'] = 'us'
113:  default['icinga2']['classic_ui']['cgi']['url_cgi_path'] = value_for_platform(

[2015-03-18T02:25:59+00:00] ERROR: Running exception handlers
[2015-03-18T02:25:59+00:00] ERROR: Exception handlers complete
[2015-03-18T02:25:59+00:00] FATAL: Stacktrace dumped to /var/chef/chef-stacktrace.out
[2015-03-18T02:25:59+00:00] ERROR: no implicit conversion of nil into String
[2015-03-18T02:25:59+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
INFO[0052] The command [/bin/sh -c chef-solo -c /var/chef/solo.rb -j /var/chef/solo.json] returned a non-zero code: 1 

[dev.icinga.com #9039] Icingaweb2 with web_uri = '/'

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9039

Created by nexeck on 2015-04-09 19:54:12 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-04-11 07:33:50 +00:00)
Target Version: (none)
Last Update: 2015-04-11 07:33:50 +00:00 (in Redmine)


I would like to use Icingaweb2 without a web_uri suffix

Maybe

default['icinga2']['web2']['web_uri'] = '/'

Example config for: http://<server_name>

/etc/httpd/conf-available/icinga2-web2.conf

Change:

Alias /icingaweb2 "/usr/share/icingaweb2/public"

RewriteBase /icingaweb2/ 

to

DocumentRoot "/usr/share/icingaweb2/public"

RewriteBase /

[dev.icinga.com #8630] add default host variable `host.vars.remote_client = node['fqdn']` for environment lwrp

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8630

Created by vkhatri on 2015-03-08 09:14:55 +00:00

Assignee: vkhatri
Status: Closed (closed on 2015-03-08 10:25:08 +00:00)
Target Version: (none)
Last Update: 2015-03-08 10:25:08 +00:00 (in Redmine)


prepping cookbook for master/satellite/agent cluster setup. adding de facto host vars remote_client for each chef node for environment lwrp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.