GithubHelp home page GithubHelp logo

zabbix's Introduction

Build Status

DESCRIPTION

![Gitter](https://badges.gitter.im/Join Chat.svg)

This cookbook install zabbix-agent and zabbix-server.

By defaut the cookbook installs zabbix-agent, check the attribute for enable/disable zabbix_server / web or disable zabbix_agent installation.

Default login password for zabbix frontend is admin / zabbix CHANGE IT !

USAGE

Be careful when you update your server version, you need to run the sql patch in /opt/zabbix-$VERSION.

If you do not specify source_url attributes for agent or server they will be set to download the specified branch and version from the official Zabbix source repository. If you want to upgrade later, you need to either nil out the source_url attributes or set them to the url you wish to download from.

node['zabbix']['agent']['source_url'] = nil
node['zabbix']['server']['source_url'] = nil

Please include the default recipe before using any other recipe.

Installing the Agent :

"recipe[zabbix]"

Installing the Server :

"recipe[zabbix]",  
"recipe[zabbix::server]"

Installing the Database :

"recipe[mysql::server]",
"recipe[zabbix]",
"recipe[zabbix::database]"

Installing all 3 - Database MUST come before Server

"recipe[database::mysql]",
"recipe[mysql::server]",
"recipe[zabbix]",
"recipe[zabbix::database]",
"recipe[zabbix::server]"

NOTE:

If you are running on Redhat, Centos, Scientific or Amazon, you will need packages from EPEL. Include "recipe[yum::epel]" in your runlist or satisfy these requirements some other way.

"recipe[yum::epel]"

ATTRIBUTES

Don't forget to set :

node.set['zabbix']['agent']['servers'] = ["Your_zabbix_server.com","secondaryserver.com"]
node.set['zabbix']['web']['fqdn'] or you will not have the zabbix web interface

Note :

A Zabbix agent running on the Zabbix server will need to :

  • use a different account than the on the server uses or it will be able to spy on private data.
  • specify the local Zabbix server using the localhost (127.0.0.1, ::1) address.

example :

Server

  node.set['zabbix']['server']['branch'] = "ZABBIX%20Latest%20Stable"
  node.set['zabbix']['server']['version'] = "2.0.0"
  node.set['zabbix']['server']['source_url'] = nil
  ndoe.set['zabbix']['server']['install_method'] = "source"

Agent

  node.set['zabbix']['agent']['branch'] = "ZABBIX%20Latest%20Stable"
  node.set['zabbix']['agent']['version'] = "2.0.0"
  node.set['zabbix']['agent']['source_url'] = nil
  node.set['zabbix']['agent']['install_method'] = "prebuild"

Database

node.set['zabbix']['database']['install_method'] = 'mysql'
node.set['zabbix']['database']['dbname'] = "zabbix"
node.set['zabbix']['database']['dbuser'] = "zabbix"
node.set['zabbix']['database']['dbhost'] = "localhost"
node.set['zabbix']['database']['dbpassword'] = 'password'
node.set['zabbix']['database']['dbport'] = "3306"

If you are using AWS RDS

node.set['zabbix']['database']['install_method'] = 'rds_mysql'
node.set['zabbix']['database']['rds_master_user'] = 'username'
node.set['zabbix']['database']['rds_master_password'] = 'password'

RECIPES

default

The default recipe creates the Zabbix user and directories used by all Zabbix components.

Optionally, it installs the Zabbix agent.

You can control the agent install with the following attributes:

node['zabbix']['agent']['install'] = true
node['zabbix']['agent']['install_method'] = 'source'

agent_prebuild

Downloads and installs the Zabbix agent from a pre built package

If you are on a machine in the RHEL family of platforms, then you must have your package manager setup to allow installation of:

package "redhat-lsb"

You can control the agent version with:

node['zabbix']['agent']['version']

agent_source

Downloads and installs the Zabbix agent from source

If you are on a machine in the RHEL family of platforms, then you will need to install packages from the EPEL repository. The easiest way to do this is to add the following recipe to your runlist before zabbix::agent_source

recipe "yum::epel"

You can control the agent install with:

node['zabbix']['agent']['branch']
node['zabbix']['agent']['version']
node['zabbix']['agent']['configure_options']

database

WARNING: This recipe persists your database credentials back to the Chef server as plaintext node attributes. To prevent this, consume the zabbix_database LWRP in your own wrapper cookbook.

Creates and initializes the Zabbix database

Currenly only supports MySql and RDS MySql databases

If they are not already set, this recipe will generate the following attributes:

node['zabbix']['database']['dbpassword']
node['mysql']['server_root_password'] # Not generated if you are using RDS

You can control the database version with:

node['zabbix']['server']['branch']
node['zabbix']['server']['version']

The database setup uses the following attributes:

node['zabbix']['database']['dbhost']
node['zabbix']['database']['dbname']
node['zabbix']['database']['dbuser']
node['zabbix']['database']['dbpassword']

node['zabbix']['database']['install_method']

If install_method is 'mysql' you also need:

node['mysql']['server_root_password']

If install_method is 'rds_mysql' you also need:

node['zabbix']['database']['rds_master_username']
node['zabbix']['database']['rds_master_password']

firewall

Opens firewall rules to allow Zabbix nodes to communicate with each other.

server

Delegates to other recipes to install the Zabbix server and Web components.

You can control the server and web installs with the following attributes:

node['zabbix']['server']['install'] = true
node['zabbix']['server']['install_method'] = 'source'
node['zabbix']['web']['install'] = true

If you are using a MySql or RDS MySql database make sure your runlist includes:

"recipe[database::mysql]",
"recipe[mysql::client]"

If you are user a Postgres database make sure your runlist includes:

"recipe[database::postgresql]",
"recipe[postgresql::client]",

server_source

Downloads and installs the Zabbix Server component from source

If you are on a machine in the RHEL family of platforms, then you will need to install packages from the EPEL repository. The easiest way to do this is to add the following recipe to your runlist before zabbix::server_source

recipe "yum::epel"

You can control the server install with:

node['zabbix']['server']['branch']
node['zabbix']['server']['version']
node['zabbix']['server']['configure_options']

The server also needs to know about:

node['zabbix']['database']['dbhost']
node['zabbix']['database']['dbname']
node['zabbix']['database']['dbuser']
node['zabbix']['database']['dbpassword']
node['zabbix']['database']['dbport']

web

Creates an Apache site for the Zabbix Web component

LWRPs

database

resources/database

Installs the Zabbix Database

The default provider is Chef::Provider::ZabbixDatabaseMySql in "providers/database_my_sql". If you want a different provider, make sure you set the following in your resource call.

provider Chef::Provider::SomeProviderClass

Actions

  • create (Default Action) - Creates the Zabbix Database

Attributes

  • dbname (Name Attribute) - Name of the Zabbix databse to create
  • host - Host to create the database on
  • port - Port to connext to the database over
  • username - Name of the Zabbix database user
  • password - Password for the Zabbix database user
  • root_username - Name of the root user for the database server
  • root_password - Password for the database root user
  • allowed_user_hosts (Default: '') - Where users can connect to the database from
  • server_branch - Which branch of server code you are using
  • server_version - Which version of server code you are using
  • source_dir - Where Zabbix source code should be stored on the host
  • install_dir - Where Zabbix should be installed to

providers/database_my_sql

Installs a MySql or RDS MySql Zabbix Database

This is the default provider for resources/database

If you are using MySQL make sure you set

root_username "root"
root_password "your root password"

If you are using RDS MySql make sure you set

root_username "your rds master username"
root_password "your rds master password"

providers/database_postgres

Installs a Postgres Zabbix Database

Call the zabbix_database resource with

provider Chef::Provider::ZabbixDatabasePostgres

Make sure you set

root_username 'postgres'
root_pasword  'your postgres admin password'

The allowed_user_hosts attribute is ignored

resources/source

Fetchs the Zabbix source tar and does something with it

Actions

  • extract_only (Default Action) - Just fetch and extract the tar
  • install_server - Fetch the tar then compile the source as a Server
  • install_agent - Fetch the tar then compile the source as an Agent

Attributes

  • name (Name Attribute) - An arbitrary name for the resource
  • branch - The branch of Zabbix to grab code for
  • version - The version of Zabbix to grab code for
  • code_dir - Where Zabbix source code should be stored on the host
  • target_dir - A sub directory under code_dir where you want the source extracted
  • install_dir (Optional) - Where Zabbix should be installed to
  • configure_options (Optional) - Flags to use when compiling Zabbix

providers/source:

Default implementation of how to Fetch and handle the Zabbix source code.

TODO

  • Support more platform on agent side windows ?
  • LWRP Magic ?

CHANGELOG

0.8.0

  • This version is a big change with a lot of bugfix and change. Please be careful if you are updated from previous version

0.0.42

  • Adds Berkshelf/Vagrant 1.1 compatibility (andrewGarson)
    • Moves recipe[yum::epel] to a documented runlist dependency instead of forcing you to use it via include_recipe

0.0.41

  • Format metadata and add support for Oracle linux (Thanks to tas50 and his love for oracle Linux)
  • Fix about redhat LSB in agent-prebuild recipe (Thanks nutznboltz)
  • Fix Add missing shabang for init file. (Thanks justinabrahms)
    • Fix FC045 foodcritic
    • new dependencies version on database and mysql cookbook
  • Add support for custom config file location to zabbix_agentd.init-rh.erb (Thanks charlesjohnson)

0.0.40

  • Refactoring for passing foodcritic with help from dkarpenko
  • Added new attribute for server service : log_level
  • Added new attribute for server service : max_housekeeper_delete & housekeeping_frequency
  • Modified firewall recipe to accept connection to localhost zabbix_server

0.0.39

  • Added zabbix bin patch in init script (deprecate change made in 0.0.38)
    • Changed default zabbix version to 2.0.3

0.0.38

  • Added zabbix_agent bin dir into PATH for Debian/Ubuntu (Some script need zabbix_sender)

0.0.37

  • Having run dir in /tmp is not so good (Guilhem Lettron)

0.0.36

  • added restart option to zabbix_agentd service definitions (Paul Rossman Patch)

0.0.35

  • Fix from Amiando about server_alias how should be a Array.
  • Fix from Guilhem about default run_dir be /tmp,it can be a big problem.

0.0.34

  • remove the protocol filter on firewall.

0.0.33

  • Added ServerActive configuration option for Zabbix agents (Paul Rossman Patch)

0.0.32

  • Fix a issue about order in the declaration of service and the template for recipes agent_*

0.0.31

  • Readme typo

0.0.30

  • Thanks to Paul Rossman for this release
  • Zabbix default install version is now 2.0.0
  • Option to install Zabbix database on RDS node (default remains localhost MySQL)
    • MySQL client now installed with Zabbix server
    • Added missing node['zabbix']['server']['dbport'] to templates/default/zabbix_web.conf.php.erb
    • Fixed recipe name typo in recipes/web.rb

0.0.29

  • Thanks to Steffen Gebert for this release
  • WARNING! this can break stuff : typo error on attribute file default['zabbix']['agent']['server'] -> default['zabbix']['agent']['servers']
  • Evaluate node.zabbix.agent.install as boolean, not as string
  • Respect src_dir in mysql_setup

0.0.28

  • Thanks to Steffen Gebert for this release
  • Use generic sourceforge download URLs
  • Fix warning string literal in condition
  • Deploy zabbix.conf.php file for web frontend
  • Add "status" option to zabbix_server init script
  • Make MySQL populate scripts compatible with zabbix 2.0
  • Add example for Chef Solo usage to Vagrantfile

0.0.27

  • Configuration error about include_dir in zabbix_agentd.conf.erb

0.0.26

  • zabbix agent and zabbix server don't want the same include_dir, be careful if you use include_dir
  • noob error on zabbix::server

0.0.25

  • Don't try to use String as Interger !

0.0.24

  • Markdown Format for Readme.md

0.0.23

  • Some Foodcritic

0.0.22

  • Bug in metadata dependencies
  • Firewall does not fix the protocol anymore

0.0.21

  • Added Patch from Harlan Barnes [email protected] his patch include centos/redhat zabbix_server support.
  • Added Patch from Harlan Barnes [email protected] his patch include directory has attribute.
  • Force a minimum version for apache2 cookbook

0.0.20

  • Added Patch from Harlan Barnes [email protected] his patch include centos/redhat zabbix_agent support.

0.0.19

  • Fix README

0.0.18

  • Fix sysconfdir to point to /etc/zabbix on recipe server_source
  • Fix right for folder frontends/php on recipe web
  • Hardcode the PATH of conf file in initscript
  • Agent source need to build on a other folder
  • Add --prefix option to default attributes when using *-source recipe

0.0.17

  • Don't mess with te PID, PID are now in /tmp

0.0.16

  • Add depencies for recipe agent_source
  • Add AlertScriptsPath folder and option for server.

0.0.15

  • Add firewall magic for communication between client and server

0.0.14

  • Correction on documentation

0.0.13

  • Fix some issue on web receipe.

0.0.12

  • Change default value of zabbix.server.dbpassword to nil

0.0.11

  • Remove mikoomo
  • Still refactoring

0.0.10

  • Preparation for multiple type installation and some refactoring
  • Support the installation of a beta version when using the install_method == source and changing the attribute branch

0.0.9

  • Tune of mikoomi for running on agent side.

0.0.8

  • Fix some major issu

0.0.7

  • Add some love to php value
  • Now recipe mysql_setup populate the database
  • Minor fix

0.0.6

  • Change the name of the web_app to fit the fqdn

zabbix's People

Contributors

amiando avatar andrewgarson avatar bjoernalbers avatar dkarpenko avatar dragolabs avatar ftclausen avatar gitter-badger avatar guilhem avatar iandelahorne avatar jeroenvds avatar junjihashimoto avatar justinabrahms avatar justizin avatar laradji avatar nightw avatar nshemonsky avatar orthographic-pedant avatar scouratier avatar stephenking avatar swalberg avatar tas50 avatar workflow avatar yusukegoto 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

zabbix's Issues

zabbix::database weird behavior

I've managed to debug this down to a simple repro:

sudo chef-client -o "recipe[ubuntu::default]" -W ---> first Recipe: apt::default (expected)

sudo chef-client -o "recipe[ubuntu::default],recipe[zabbix::database]" -W ---> first Recipe: build-essential::debian

Somehow the inclusion of zabbix::database in my run list, causes itself to go to the top of the run list. This always fails because I need to run apt-get update before installing packages.

I can't find anything in the recipe that could cause this but maybe you guys have some insight.

Question: Use Ubuntu packages instead?

We're running LTS 12.04, which appears to have appropriate packages for 1.8. Is there any reason to not offer an agent_deb.rb recipe? Wanted to ask before I go making one and issuing a PR.

Howto Agent Registration?

Hello.
I have few ENVs (like dev, test, production) and one called generic.
Generic env is used for global services not related to certain environment.
Zabbix is used to monitor all infrastructure from dev to production, nexus repos, gitlab, etc.

Your search string is:

zabbix_server = search(:node, "recipes:zabbix\\:\\:server").first

There is no way to search through environment. Also I have wrapper-cookbook, so no zabbix::server recipe can be found in recipes. Search always returns nil.
Probably cookbook need some refactoring.
May be adding default['zabbix']['server']['search_query'] will solve the issue.

Thanks

Call to undefined function pg_connect()

There's a FastCGI error in nginx/error.log when you don't have the php5-pgsql package installed and you're using postgresql as the database.

I couldn't find anything in the recipes that installs php5-pgsql when you define postgresql as the database for zabbix.

Installing agent from source failed

I can't install zabbix-agent from source with the following configuration:

"zabbix": {
  "agent": {
    "servers": [ "zabbix.example.com" ],
    "version": "2.0.6",
    "install_method": "source"
  }
}

Here is error message.

   STDERR: mv: cannot stat `/tmp/zabbix-2.0.3': No such file or directory
   ---- End output of "bash"  "/tmp/chef-script20131213-2383-4blt9o" ----
   Ran "bash"  "/tmp/chef-script20131213-2383-4blt9o" returned 1


   Resource Declaration:
   ---------------------
   # In /tmp/kitchen/cookbooks/zabbix/providers/source.rb

    20:     script "extract Zabbix to #{extract_to}" do
    21:       interpreter "bash"
    22:       user "root"
    23:       code <<-EOH
    24:         rm -rf #{tmp_dir}
    25:         tar xvfz #{tar_path} -C /tmp
    26:         mv #{tmp_dir} #{extract_to}
    27:       EOH
    28: 
    29:       not_if { ::File.exists?(extract_to) }
    30:     end
    31:     new_resource.updated_by_last_action(true)



   Compiled Resource:
   ------------------
   # Declared in /tmp/kitchen/cookbooks/zabbix/providers/source.rb:20:in `block in class_from_file'

   script("extract Zabbix to /opt/zabbix-2.0.6-agent") do
     action "run"
     retries 0
     retry_delay 2
     command "\"bash\"  \"/tmp/chef-script20131213-2383-4blt9o\""
     backup 5
     returns 0
     user "root"
     code "        rm -rf /tmp/zabbix-2.0.3\n        tar xvfz /opt/zabbix-ZABBIX-Latest-Stable-2.0.3.tar.gz -C /tmp\n        mv /tmp/zabbix-2.0.3 /opt/zabbix-2.0.6-agent\n"
     interpreter "bash"
     cookbook_name :zabbix
     not_if { #code block }
   end

The error comes from recipes/agent_source.rb that uses node['zabbix']['server']['branch'] and node['zabbix']['server']['version']. Is it a bug or spec?

zabbix_source "install_zabbix_agent" do
branch node['zabbix']['server']['branch']
version node['zabbix']['server']['version']
source_url node['zabbix']['agent']['source_url']
code_dir node['zabbix']['src_dir']
target_dir "zabbix-#{node['zabbix']['agent']['version']}-agent"
install_dir node['zabbix']['install_dir']
configure_options configure_options.join(" ")

action :install_agent
end

Recipe Compile Error on "Installing all 3"

As of 'database >= v4.0.2', recipe 'database::mysql' has been removed from the cookbook.
Which causes errors when installing database according to instructions from readme

Installing all 3 - Database MUST come before Server

"recipe[database::mysql]",
"recipe[mysql::server]",
"recipe[zabbix]",
"recipe[zabbix::database]",
"recipe[zabbix::server]"

Result of installation

==> monitoring_server: ================================================================================
==> monitoring_server: Recipe Compile Error
==> monitoring_server: ================================================================================
==> monitoring_server:
==> monitoring_server: Chef::Exceptions::RecipeNotFound
==> monitoring_server:
==> monitoring_server: --------------------------------
==> monitoring_server: could not find recipe mysql for cookbook database

Thanks

Recipe compile error

Recipe compile error occurs.

Chef Client, version 11.4.0

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/zabbix/recipes/server.rb
================================================================================


Chef::Exceptions::ImmutableAttributeModification
------------------------------------------------
Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'


Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/zabbix/recipes/server_source.rb:41:in `from_file'
  /var/chef/cache/cookbooks/zabbix/recipes/server.rb:11:in `from_file'


Relevant File Content:
----------------------
/var/chef/cache/cookbooks/zabbix/recipes/server_source.rb:

 34:          action :install
 35:        end
 36:      end
 37:    init_template = 'zabbix_server.init-rh.erb'
 38:  end
 39:
 40:  # --prefix is controlled by install_dir
 41>> node['zabbix']['agent']['configure_options'].delete_if do |option|
 42:    option.match(/\s*--prefix(\s|=).+/)
 43:  end
 44:
 45:  # installation of zabbix bin
 46:  script "install_zabbix_server" do
 47:    interpreter "bash"
 48:    user "root"
 49:    cwd node['zabbix']['src_dir']
 50:    action :nothing

How is the PG gem included?

I've been searching through the code but I can't see how the PG gem makes it into the cookbook.

There is a line requiring it in providers/database_postgres.rb but that's the only reference I can find.

Thanks,
James.

agent_registration - Search all recipes on a node for zabbix::server

If a role containing recipe[zabbix::server] is in the run_list of a node, the
node won't be found by searching for recipe:zabbix::server. Instead, search
for recipes:zabbix::server.

Ideally this would be a role (configurable in attributes) we search for instead
of just looking for the recipe.

Attached a diff since my master is out of sync.

diff --git a/recipes/agent_registration.rb b/recipes/agent_registration.rb
index 260d55e..ab3c36f 100644
--- a/recipes/agent_registration.rb
+++ b/recipes/agent_registration.rb
@@ -6,7 +6,7 @@
 #

 unless Chef::Config[:solo]
-  zabbix_server = search(:node, "recipe:zabbix\\:\\:server").first
+  zabbix_server = search(:node, "recipes:zabbix\\:\\:server").first
 else
   if node['zabbix']['web']['fqdn']
     zabbix_server = node

/opt/zabbix is 0700 without the ability to override

/recipes/_agent_common_user.rb creates the zabbix user and sets supports :manage_home => true. This (by default) creates the /opt/zabbix home directory with 0700 permissions.

There is /recipes/_agent_common_directories.rb which sets all directories under the zabbix home, but other users cannot enter the 0700 zabbix home.

This is mainly a problem using zabbix_sender for trapper items. Other users/applications may require access to /opt/zabbix/bin/zabbix_sender.

Don't use /usr/bin/mysql to popuplate

Populate database with shell query don't seem the smart way to go.

Perhaps we should use the sql_server_database.query provider from database cookbook instead.

Example

mysql_database "zabbix_populate_schema" do
connection mysql_connection_info
sql "source #{node['zabbix']['src_dir']}/zabbix-#{node['zabbix']['server' ]['version']}/create/schema/mysql.sql"
action :query
end

mysqld server is not started in time

Database server is not installed let alone started.

2012-12-13T08:52:02-05:00] INFO: Processing mysql_database[zabbix] action create (zabbix::mysql_setup line 21)

================================================================================
Error executing action `create` on resource 'mysql_database[zabbix]'
================================================================================

Mysql::Error
------------
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

zabbix nginx missing variables

Hi!

In the web_nginx.rb recipe at line 64 (zabbix.conf.php template generation) missing the variables block:
variables({
:database => node['zabbix']['database'],
:server => node['zabbix']['server']
})

host resource and host providers are out-of-sync

The resources/host.rb file contains attributes for groups, templates and interfaces, but those are currently ignored in the providers/host.rb, since that file is only using the parameters[:groupNames], parameteres[:templates] and parameteres[:interfaces] attribute respectively for registering a host to the Zabbix server.

I've created a pull request: #174 fixing this issue while I tried to keep the backward compatibility to not brake the agent_registration recipe and other people's application cookbooks using this resource the old way. Could you please review it?

Dependency overload

Would it be worth while to break this cookbook up into 4 different cookbooks? Installing the agent seems to pull in a lot of unneeded attributes and cookbooks.

I'm thinking:

zabbix-agent - with agent and depend agent specific dependencies
zabbix-server - with server and depend on server specific dependencies
zabbix-web - with front-end and depend on web specific dependencies

Or is there a trick I don't know to help manage this?

Hardcoded paths in recipes

There are a few hardcoded paths in some of the recipes, most notably agent_prebuild. This prevents us from installing to alternate locations without making code changes.

how to install and configure zabbix server

Sorry for the newby connection but after the cookbook installation i cannot seem to see the webinterface of zabbix, In the read me there is something i am missing.
Where do i configure to install the server and web interface?
And how can i update trhrough cookbok to the latest stable version which is 2.2.0
And again i am sorry for the newbie question.

Nick

Installing from RPM

Is it possible to install from RPM getting them from the zabbix site?
If yes using which settings?
Thanks
Luca

yum::epel no longer exists

The yum cookbook has been refactored, and yum::epel no longer exists. This causes chef runs to fail when using yum 3.0.0.

Wrong permissions on directories

/var/log/zabbix sometime gets wrong permissions: root/root instead zabbix/zabbix.
Service fails to start. On next chef-run permissions are fixed, but service doesn't start (no changes - no triggers).

Cause: directories have been created before user/group have been created.

Host update does not work

When changing the attributes for a host to update the host group or templates, the update library does not update the host's configuration.

The error:

Error executing action `create_or_update` on resource 'zabbix_host[zabbix-server.example.org]'

NoMethodError
-------------
undefined method `values' for #<Array:0x00000003d264e8>

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/zabbix/providers/host.rb:166:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/zabbix/libraries/zabbix_connection.rb:19:in `call'
/var/chef/cache/cookbooks/zabbix/libraries/zabbix_connection.rb:19:in `with_connection'
/var/chef/cache/cookbooks/zabbix/providers/host.rb:115:in `block in class_from_file'
/var/chef/cache/cookbooks/zabbix/providers/host.rb:18:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/zabbix/libraries/zabbix_connection.rb:19:in `call'
/var/chef/cache/cookbooks/zabbix/libraries/zabbix_connection.rb:19:in `with_connection'
/var/chef/cache/cookbooks/zabbix/providers/host.rb:2:in `block in class_from_file'


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/zabbix/recipes/agent_registration.rb

 64: zabbix_host node['zabbix']['agent']['hostname'] do
 65:   create_missing_groups true
 66:   server_connection connection_info
 67:   parameters ({
 68:     :host => node['hostname'],
 69:     :groupNames => node['zabbix']['agent']['groups'],
 70:     :templates => node['zabbix']['agent']['templates'],
 71:     :interfaces => interface_data
 72:   })
 73:   action :nothing
 74: end
 75:



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/zabbix/recipes/agent_registration.rb:64:in `from_file'

zabbix_host("zabbix-server.example.org") do
  action [:nothing]
  retries 0
  retry_delay 2
  cookbook_name "zabbix"
  recipe_name "agent_registration"
  create_missing_groups true
  server_connection {:url=>"http://zabbix-server.example.org/api_jsonrpc.php", :user=>"admin", :password=>"mysecretpassword"}
  parameters {:host=>"zabbix-server", :groupNames=>["chef-agent", "Zabbix Servers"], :templates=>[], :interfaces=>[{:type=>1, :main=>1, :useip=>1, :ip=>"10.12.12.8", :dns=>"zabbix-server.example.org", :port=>"10050"}]}
  hostname "zabbix-server.example.org"
end

If I delete the host from zabbix, then re-run chef-client it works as expected.

mysql_chef_gem error

I tried the cookbook (which in past i have installed successfully) but this time i got
Error executing action install on resource 'mysql_chef_gem[default]'.

My Run List is

0 database::mysql
1 mysql::server
2 zabbix::database

3 zabbix::server

and the stacktraceout

Generated at 2014-09-19 14:55:55 +0300
Gem::Installer::ExtensionBuildError: mysql_chef_gem[default](mysql-chef_gem::default line 20) had an error: Gem::Installer::ExtensionBuildError: chef_gem[mysql](/var/chef/cache/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb line 20) had an error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /opt/chef/embedded/bin/ruby extconf.rb

checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/chef/embedded/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib

Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mysql-2.9.1 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:556:in rescue in block in build_extensions' /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:534:inblock in build_extensions'
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:509:in each' /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:509:inbuild_extensions'
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in install' /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:297:inblock in install'
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in each' /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:ineach_with_index'
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in install' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:201:inblock (2 levels) in install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:224:in with_correct_verbosity' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:200:inblock in install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:110:in with_gem_sources' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:199:ininstall'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package/rubygems.rb:511:in install_package' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package.rb:82:inblock in action_install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/mixin/why_run.rb:52:in call' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/mixin/why_run.rb:52:inadd_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider.rb:149:in converge_by' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider/package.rb:80:inaction_install'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider.rb:114:in run_action' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource.rb:625:inrun_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource/chef_gem.rb:47:in block in after_created' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource/chef_gem.rb:46:ineach'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource/chef_gem.rb:46:in after_created' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/dsl/recipe.rb:74:inmethod_missing'
/var/chef/cache/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb:20:in block in action_install' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/mixin/why_run.rb:52:incall'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/mixin/why_run.rb:52:in add_action' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider.rb:149:inconverge_by'
/var/chef/cache/cookbooks/mysql-chef_gem/libraries/provider_mysql_chef_gem.rb:11:in action_install' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/provider.rb:114:inrun_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource.rb:625:in run_action' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/runner.rb:49:inrun_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/runner.rb:81:in block (2 levels) in converge' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/runner.rb:81:ineach'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/runner.rb:81:in block in converge' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection.rb:98:inblock in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection/stepable_iterator.rb:116:in call' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection/stepable_iterator.rb:85:in step' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection/stepable_iterator.rb:104:initerate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/resource_collection.rb:96:inexecute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/runner.rb:80:in converge' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:433:inconverge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:500:in do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:199:inblock in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:193:in fork' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:193:inrun'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application.rb:208:in run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:312:inblock in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:304:in loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:304:inrun_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application.rb:66:in run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/bin/chef-client:26:in<top (required)>'
/usr/bin/chef-client:23:in `load'

Any clues?

Zabbix 2.2.0 and zabbix sql user privileges

Hi,

With zabbix 2.2.0 zabbix daemon update the database schema by himself.
For that purpose the zabbix sql user must have the ALTER,INDEX privileges on the zabbix database.

Missing libapache2-mod-php5

Upon trying to start Apache on Ubuntu 12.04 it says "Invalid command 'php_admin_value'". This can be corrected by installing libapache2-mod-php5.

InsufficientPermissions error on windows

Windows is throwing an error when trying to create the Zabbix folder which already exists because it was created by chocolatey.

Recipe: zabbix::common
  * directory[C:/Program Files/Zabbix Agent] action create[2015-02-18T18:04:17+00:00] INFO: Processing directory[C:/Prog
ram Files/Zabbix Agent] action create (zabbix::common line 19)

    * Cannot create directory[C:/Program Files/Zabbix Agent] at C:/Program Files/Zabbix Agent due to insufficient permis
sions
    ================================================================================
    Error executing action `create` on resource 'directory[C:/Program Files/Zabbix Agent]'
    ================================================================================

    Chef::Exceptions::InsufficientPermissions
    -----------------------------------------
    Cannot create directory[C:/Program Files/Zabbix Agent] at C:/Program Files/Zabbix Agent due to insufficient permissi
ons

    Resource Declaration:
    ---------------------
    # In c:/chef/cache/cookbooks/zabbix/recipes/common.rb

     19:     directory dir do
     20:       owner 'Administrator'
     21:       rights :read, 'Everyone', :applies_to_children => true
     22:       recursive true
     23:     end
     24:   end

    Compiled Resource:
    ------------------
    # Declared in c:/chef/cache/cookbooks/zabbix/recipes/common.rb:19:in `block in from_file'

    directory("C:/Program Files/Zabbix Agent") do
      action :create
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      path "C:/Program Files/Zabbix Agent"
      recursive true
      declared_type :directory
      cookbook_name "zabbix"
      recipe_name "common"
      owner "Administrator"
      rights [{:permissions=>:read, :principals=>"Everyone", :applies_to_children=>true}]
    end

[2015-02-18T18:04:17+00:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-02-18T18:04:17+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-02-18T18:04:17+00:00] ERROR: Exception handlers complete
[2015-02-18T18:04:17+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
Chef Client failed. 3 resources updated in 86.560313 seconds
[2015-02-18T18:04:17+00:00] INFO: Sending resource update report (run-id: 897903f6-e4c0-42cb-9576-5d7a025faabf)
[2015-02-18T18:04:17+00:00] FATAL: Chef::Exceptions::InsufficientPermissions: directory[C:/Program Files/Zabbix Agent] (
zabbix::common line 19) had an error: Chef::Exceptions::InsufficientPermissions: Cannot create directory[C:/Program File
s/Zabbix Agent] at C:/Program Files/Zabbix Agent due to insufficient permissions

undefined method `create_missing_groups' for Chef::Resource::ZabbixHost

/srv/chef/file_store/cookbooks/zabbix/recipes/agent_registration.rb:

 20:  connection_info = {
 21:    :url => "http://#{zabbix_server['zabbix']['web']['fqdn']}/api_jsonrpc.php",
 22:    :user => zabbix_server['zabbix']['web']['login'],
 23:    :password => zabbix_server['zabbix']['web']['password']
 24:  }
 25:  
 26:  zabbix_host node['zabbix']['agent']['hostname'] do
 27>>   create_missing_groups true
 28:    server_connection     connection_info
 29:    parameters            ({
 30:                          :host => node['hostname'],
 31:                          :groupNames => node['zabbix']['agent']['groups'],
 32:                          :interfaces => [{
 33:                                         :type => 1,
 34:                                         :main => 1,
 35:                                         :useip => 1,
 36:                                         :ip => node['ipaddress'],

undefined method create_missing_groups' for Chef::Resource::ZabbixHost`
Quick searching through code - nothing found about.

sirex@machine:~/proj/zabbix(master)$ grep -rn create_missing_groups .
./recipes/agent_registration.rb:27:  create_missing_groups true
sirex@machone:~/proj/zabbix(master)$ 

Agent registration fails a bit on 2.2

In 2.2 (haven't checked on earlier versions), host["interfaces"] is an array
of hashes. Array#values doesn't exist, so map on array entries in a rescue
block.

Attached a diff since my branches are out of sync in my fork.

---
 providers/host.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/providers/host.rb b/providers/host.rb
index fa1c446..56b11a3 100644
--- a/providers/host.rb
+++ b/providers/host.rb
@@ -163,7 +163,11 @@ action :update do
       acc << template
     end

-    existing_interfaces = host["interfaces"].values.map { |interface| Chef::Zabbix::API::HostInterface.from_api_response(interface).to_hash }
+    begin
+      existing_interfaces = host["interfaces"].values.map { |interface| Chef::Zabbix::API::HostInterface.from_api_response(interface).to_hash }
+    rescue
+      existing_interfaces = host["interfaces"].map { |interface| Chef::Zabbix::API::HostInterface.from_api_response(interface).to_hash }
+    end
     new_host_interfaces = determine_new_host_interfaces(existing_interfaces, params_incoming[:interfaces].map(&:to_hash))

     host_update_request = {
--

Web app fixed timezone problem

It seems the cookbook has web app timezone fixed to 'Europe/Paris' as the default.

(Config file in templates/default/web_app.conf.erb)

It gave me a hard time finding this origin because it was 1 hour off with UTC. XD

Anyways, shouldn't it be set by an attribute value?

automatic chef-client runs fails with "NoMethodError: undefined method `full_name' for nil:NilClass"

Using this cookbook to install the agent only.

Manual chef-client triggered on the node completes just fine. But the ones initiated by the chef daemon fails. Below is the error:

[2015-03-25T19:53:39+00:00] INFO: Processing package[redhat-lsb] action install (123ZX_tomcat::zabbix line 1)
[2015-03-25T19:53:39+00:00] INFO: Processing directory[/opt/mount1/zabbix] action create (123ZX_tomcat::zabbix line 5)
[2015-03-25T19:53:39+00:00] INFO: Processing group[zabbix] action create (zabbix::_agent_common_user line 4)
[2015-03-25T19:53:39+00:00] INFO: Processing user[zabbix] action create (zabbix::_agent_common_user line 10)
[2015-03-25T19:53:39+00:00] INFO: Processing directory[/opt/mount1/zabbix/etc] action create (zabbix::common line 27)
[2015-03-25T19:53:39+00:00] INFO: Processing directory[/opt/mount1/zabbix/var/log/zabbix] action create (zabbix::common line 44)
[2015-03-25T19:53:39+00:00] INFO: Processing directory[/var/run/zabbix] action create (zabbix::common line 44)
[2015-03-25T19:53:39+00:00] INFO: Processing directory[/opt/mount1/zabbix/agent_include] action create (zabbix::_agent_common_directories line 7)
[2015-03-25T19:53:39+00:00] INFO: Processing template[/etc/init.d/zabbix_agentd] action create (zabbix::_agent_common_service line 4)
[2015-03-25T19:53:39+00:00] INFO: Processing service[zabbix_agentd] action nothing (zabbix::_agent_common_service line 12)
[2015-03-25T19:53:39+00:00] INFO: Processing package[fping] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[curl-devel] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[iksemel-devel] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[iksemel-utils] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[net-snmp-libs] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[net-snmp-devel] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[openssl-devel] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing package[redhat-lsb] action install (zabbix::agent_source line 23)
[2015-03-25T19:53:39+00:00] INFO: Processing zabbix_source[install_zabbix_agent] action install_agent (zabbix::agent_source line 36)
[2015-03-25T19:53:39+00:00] INFO: Processing chef_gem[zabbixapi] action install (zabbix::_providers_common line 1)
[2015-03-25T19:54:43+00:00] INFO: Running queued delayed notifications before re-raising exception
[2015-03-25T19:54:43+00:00] ERROR: Running exception handlers
[2015-03-25T19:54:43+00:00] ERROR: Exception handlers complete
[2015-03-25T19:54:43+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-03-25T19:54:43+00:00] INFO: Sending resource update report (run-id: 620fafe3-c3dc-4761-b1aa-0b784c75f31c)
[2015-03-25T19:54:43+00:00] ERROR: zabbix_source[install_zabbix_agent](zabbix::agent_source line 36) had an error: NoMethodError: chef_gem[zabbixapi](zabbix::_providers_common line 1) had an error: NoMethodError: undefined method `full_name' for nil:NilClass
[2015-03-25T19:54:43+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

zabbix_agentd.conf template Server and ServerActive value population

The zabbix_agentd.conf template populates the 'Server' and 'ServerActive' values by joining the list of attribute values found in node['zabbix'].['agent'].['servers'] and node['zabbix'].['agent'].['servers_active'] respectively. Currently these values are not set anywhere unless the deployer has set them manually.

I think a great addition to the agent recipe would be to search for the Zabbix servers using the zabbix::server recipe (or an attribute, as is the more recent trend) in order to automatically populate these attributes if they haven't been assigned any other way.

In the special case of the agent being deployed on the Zabbix server, this should be detected and the additional address of 127.0.0.1 should be included in the list.

Chef::Exceptions::CookbookNotFound: Cookbook zabbix not found. If you're loading zabbix from another cookbook, make sure you configure the dependency in your metadata

I am trying to install the cookbook in ubuntu 12.10 and i get
root@cyclops:~# chef-client
[Mon, 16 Dec 2013 12:36:38 +0200] INFO: *** Chef 10.12.0 ***
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Run List is [recipe[zabbix-master]]
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Run List expands to [zabbix-master]
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Starting Chef Run for cyclops.gt.central
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Running start handlers
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Start handlers complete.
[Mon, 16 Dec 2013 12:36:39 +0200] INFO: Loading cookbooks [apache2, apt, ark, aws, bluepill, build-essential, chef_handler, chocolatey, database, firewall, mysql, nginx, ohai, openssl, php-fpm, postgresql, powershell, rsyslog, runit, ufw, windows, xfs, yum, zabbix-master]
[Mon, 16 Dec 2013 12:36:41 +0200] INFO: Powershell light-weight provider already initialized -- overriding!
[Mon, 16 Dec 2013 12:36:41 +0200] INFO: Powershell light-weight resource already initialized -- overriding!
[Mon, 16 Dec 2013 12:36:42 +0200] ERROR: Running exception handlers
[Mon, 16 Dec 2013 12:36:42 +0200] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[Mon, 16 Dec 2013 12:36:42 +0200] ERROR: Exception handlers complete
[Mon, 16 Dec 2013 12:36:42 +0200] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Mon, 16 Dec 2013 12:36:42 +0200] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook zabbix not found. If you're loading zabbix from another cookbook, make sure you configure the dependency in your metadata

in the chef-stacktrace.out i get
Chef::Exceptions::CookbookNotFound: Cookbook zabbix not found. If you're loading zabbix from another cookbook, make sure you configure the dependency in your metadata
and lot more.

Can anyone help?

Thanks
Nick

externalscripts path not matching between server and default attributes

The Zabbix Server common recipe creates node['zabbix']['external_dir'], but the server's configuration template sets the external scripts path as ['zabbix']['server']['externalscriptspath'].

Either the server common recipe should use the server attribute, or the template should use the common attribute and the server attribute should be removed. I think option two is best, personally.

Required mysql gem is not installed

I don't know if this is an issue with the mysql cookbook or the zabbix cookbook yet.

[2012-12-13T08:27:59-05:00] FATAL: LoadError: mysql_database[zabbix] (zabbix::mysql_setup line 21) had an error: LoadError: no such file to load -- mysql

Add LWRP to upload template to server

It would appear the the Template LWRP can only create a template. It doesn't allow the uploading of an xml template file.

Ideally it'd be great if this could be done, with a sample recipe to show how to use it.

Zabbix cookbook does not work with the newest version of Chef

Node attributes are read-only when you do not specify which precedence level to set.

blah.net Chef::Exceptions::ImmutableAttributeModification
blah.net ------------------------------------------------
blah.net Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
blah.net
blah.net
blah.net Cookbook Trace:
blah.net ---------------
blah.net   /var/chef/cache/cookbooks/zabbix/recipes/agent_source.rb:54:in `from_file'
blah.net   /var/chef/cache/cookbooks/zabbix/recipes/default.rb:74:in `from_file'
blah.net
blah.net
blah.net Relevant File Content:
blah.net ----------------------
blah.net /var/chef/cache/cookbooks/zabbix/recipes/agent_source.rb:
blah.net
blah.net  47:  # Define zabbix_agentd service
blah.net  48:  service "zabbix_agentd" do
blah.net  49:    supports :status => true, :start => true, :stop => true, :restart => true
blah.net  50:    action [ :enable ]
blah.net  51:  end
blah.net  52:
blah.net  53:  # --prefix is controlled by install_dir
blah.net  54>> node['zabbix']['agent']['configure_options'].delete_if do |option|
blah.net  55:    option.match(/\s*--prefix(\s|=).+/)
blah.net  56:  end
blah.net  57:
blah.net  58:  # installation of zabbix bin
blah.net  59:  script "install_zabbix_agent" do
blah.net  60:    interpreter "bash"
blah.net  61:    user "root"
blah.net  62:    cwd node['zabbix']['src_dir']
blah.net  63:    action :nothing

NoMethodError: Undefined node attribute or method 'join' on 'node'

blah.net NoMethodError
blah.net -------------
blah.net Undefined node attribute or method `join' on `node'
blah.net
blah.net
blah.net
blah.net Cookbook Trace:
blah.net ---------------
blah.net   /var/chef/cache/cookbooks/zabbix/recipes/agent_source.rb:72:in `from_file'
blah.net   /var/chef/cache/cookbooks/zabbix/recipes/agent_source.rb:62:in `from_file'
blah.net   /var/chef/cache/cookbooks/zabbix/recipes/default.rb:74:in `from_file'
blah.net
blah.net
blah.net
blah.net Relevant File Content:
blah.net ----------------------
blah.net /var/chef/cache/cookbooks/zabbix/recipes/agent_source.rb:
blah.net
blah.net  65:    cwd node['zabbix']['src_dir']
blah.net  66:    action :nothing
blah.net  67:    notifies :restart, "service[zabbix_agentd]"
blah.net  68:    code <<-EOH
blah.net  69:    rm -rf /tmp/zabbix-#{node['zabbix']['agent']['version']}
blah.net  70:    tar xvfz zabbix-#{node['zabbix']['agent']['version']}-agent.tar.gz -C /tmp
blah.net  71:    mv /tmp/zabbix-#{node['zabbix']['agent']['version']} zabbix-#{node['zabbix']['agent']['version']}-agent
blah.net  72>>   (cd zabbix-#{node['zabbix']['agent']['version']}-agent && ./configure --enable-agent --prefix=#{node['zabbix']['install_dir']} #{node['zabbix']['agent']['configure_options'].join(" ")})
blah.net  73:    (cd zabbix-#{node['zabbix']['agent']['version']}-agent && make install)
blah.net  74:    EOH
blah.net  75:  end
blah.net  76:
blah.net  77:  # Download zabbix source code
blah.net  78:  remote_file "#{node['zabbix']['src_dir']}/zabbix-#{node['zabbix']['agent']['version']}-agent.tar.gz" do
blah.net  79:    source "http://downloads.sourceforge.net/project/zabbix/#{node['zabbix']['agent']['branch']}/#{node['zabbix']['agent']['version']}/zabbix-#{node['zabbix']['agent']['version']}.tar.gz"
blah.net  80:    mode "0644"
blah.net  81:    action :create_if_missing

agent_registration uses 'recipe' instead of 'recipes' in search

I've used a role to assign the zabbix::server, zabbix::web, zabbix and zabbix::agent_registration recipes to a server. The agent registration doesn't work because it uses 'recipe' instead of 'recipes' in the search. This means that it'll never work unless the recipe is directly assigned to the server, which is not ideal.

Add Zabbix Proxy recipe

It'd be highly useful to also have a recipe to deploy a Zabbix proxy. The recipe should support being in an environment which either includes a server or does not.

In the case where the environment includes a Zabbix server, the proxy should automatically find its server.
In the case where the environment does not include a Zabbix server, the server's details should be provided through attributes.

Client Agents should be able to find either the server or the proxy. The preference should be set through an agent recipe attribute.

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.