voxpupuli / puppet-zabbix Goto Github PK
View Code? Open in Web Editor NEWPuppet module for creating and maintaining zabbix components with puppet.
Home Page: https://forge.puppet.com/puppet/zabbix
License: Apache License 2.0
Puppet module for creating and maintaining zabbix components with puppet.
Home Page: https://forge.puppet.com/puppet/zabbix
License: Apache License 2.0
I'm having a problem with exported resources. I've configured the following class on a server
class { '::zabbix::agent':
agent_use_ip => false,
zabbix_version => '2.4',
server => 'host.test.com',
manage_resources => true,
manage_repo => true,
manage_firewall => true,
zbx_group => 'Linux servers',
zbx_templates => ['C_Linux_base'],
logfilesize => '10',
monitored_by_proxy => '',
}
But when running puppet on the zabbix server I get the following error:
Wrapped exception:
Server answer API error:
{
"data": "Incorrect arguments passed to function.",
"code": -32602,
"message": "Invalid params."
}
on request:
{
"params": [
{
"available": 1,
"interfaces": [
{
"dns": "host.test.com",
"main": 1,
"type": 1,
"useip": 0,
"port": "10050",
"ip": null
}
],
"status": 0,
"proxy_hostid": null,
"host": "host.test.com",
"templates": [
10056
],
"groups": [
{
"groupid": 6
}
]
}
],
"jsonrpc": "2.0",
"method": "host.create",
"auth": "341c3fbe85ke0ed60a1c15a560ab27ec",
"id": 10965
}
Looking at the Zabbix API docs it does look like the template array should be in the format "templateid": "20045"
, is this the problem?
Any help would be much appreciated.
"database_port" is not properly set when web node is split from master node.
Puppet code:
# Zabbix Web Node
node 'MASTER' {
file { '/etc/yum.conf':
source => 'puppet:///modules/yum/yum.conf',
owner => root,
group => root,
}
class { 'apache':
mpm_module => 'prefork',
}
class { 'apache::mod::php': }
class { 'zabbix::web':
zabbix_url => '',
zabbix_server => 'MASTER',
database_host => 'MASTER',
zabbix_api_user => 'whatever',
zabbix_api_pass => 'crazysecurepassword',
database_type => 'mysql',
}
}
Output:
/etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'c2t06545.itcs.hp.com';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix_server';
$DB['USER'] = 'zabbix_server';
$DB['PASSWORD'] = 'zabbix_server';
// SCHEMA is relevant only for IBM_DB2 database
$DB['SCHEMA'] = '';
$ZBX_SERVER = 'c2t06545.itcs.hp.com';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'c2t06545.itcs.hp.com';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>
Documentation reports that "manage_resources" should be available to the following
zabbix::server, zabbix::proxy & zabbix::agent
Using manage_resources on zabbix::server returns an error
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter manage_resources on Class[Zabbix::Server] at /etc/puppetlabs/puppet/environments/production/manifests/zabbix.pp:41 on node HOSTNAME
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Puppet code used
class { 'zabbix::server':
database_host => 'HOSTNAME',
database_type => 'mysql',
manage_resources => true,
}
==> prov: Error: validate_re(): "FBABD5FB20255ECAB22EE194D13D58E479EA5ED4" does not match ["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z"] at /tmp/vagrant-puppet-2/modules-0/apt/manifests/key.pp:60 on node prov.dev.local
==> prov: Error: validate_re(): "FBABD5FB20255ECAB22EE194D13D58E479EA5ED4" does not match ["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z"] at /tmp/vagrant-puppet-2/modules-0/apt/manifests/key.pp:60 on node prov.dev.local
I suppose there is new validation in apt module which supposes that key must be 8 or 16 syblols long.
If i remember correctly it is possible to add keys by last key in chain.
Hi Werner,
The module fails then future parser is enabled in puppet.conf
Errors:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Left match operand must result in a String value. Got an Object. at /etc/puppet/environments/production/modules/zabbix/manifests/agent.pp:207:7
and
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Left match operand must result in a String value. Got an Object. at /etc/puppet/environments/production/modules/zabbix/manifests/proxy.pp:305:7
The root cause is this check
if ($listenip =~ /^(eth|bond).*/) {
in proxy.pp and agent.pp
more info https://tickets.puppetlabs.com/i#browse/PUP-1782
I don't use listenip so i overcome it with
if ($listenip != undef ) {
Karolis
Hi,
I have now problem with zabbix-proxy and use of hiera.
Indeed, i receive this error Error: Failed to apply catalog: Validation of Exec[ --port='' --owner='' --template=template0 'zabbix-proxy'] failed: ' --port='' --owner='' --template=template0 'zabbix-proxy'' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/modules/postgresql/manifests/server/database.pp:63 Wrapped exception: ' --port='' --owner='' --template=template0 'zabbix-proxy'' is not qualified and no path was specified. Please qualify the command or specify a path.
I use this configuration :
zabbix::proxy::zabbix_server_host: 'xxx.com'
zabbix::proxy::database_type: 'mysql'
zabbix::proxy::zabbix_server_port: '10051'
I have also tried to add this configuration :
zabbix::database::database_type: 'mysql'
zabbix::database::zabbiix_type: 'proxy'
zabbix::database::database_name: 'zabbix-proxy'
zabbix::database::database_user: 'zabbix-proxy'
zabbix::database::database_password: 'test'
But I have got this error Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Zabbix::Database] is already declared; cannot redeclare at /etc/puppet/modules/zabbix/manifests/proxy.pp:408 on node teliboxexpress.local.tec6.net Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
Have you an idea to what I doing wrong ?
Thank you and have a nice day ;)
Hi,
Module fails to install on ubuntu 14.04. The errors:
..........
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/php5.conf]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/php5.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/authn_core.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/status.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/mpm_prefork.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/status.conf]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/mpm_prefork.conf]/ensure: removed
...........
Error: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' returned 1: * Starting web server apache2
*
puppet apache module removes php module because it is not in the ubuntu default module list.
another error:
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install zabbix-frontend-php' returned 100: Reading package lists...
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
Action 'configtest' failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2
puppet apache module disables mpm_event but not the default ubuntu one - mpm_worker
To make the zabbix module to work I added this to my zabbix node's manifest:
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
Karolis
If a node specifies a hostgroup that does not exist the following failure occurs.
Error: Could not set 'present' on ensure: Server answer API error:
{
"code": -32500,
"message": "Application error.",
"data": "No permissions to referred object or it does not exist!"
}
on request:
{
"method": "host.create",
"params": [
{
"host": "cent7test.example.edu",
"interfaces": [
{
"type": 1,
"main": 1,
"ip": "",
"dns": "cent7test.example.edu",
"port": "10050",
"useip": 0
}
],
"status": 0,
"available": 1,
"groups": [
{
"groupid": null
}
],
"proxy_hostid": null,
"templates": [
10001,
10102
]
}
],
"id": 80395,
"jsonrpc": "2.0",
"auth": "ae774e8c6af9b0790929ab1019109332"
} at 37:/etc/puppet/environments/feature_zabbix_agent/modules/zabbix/manifests/resources/agent.pp
Error: Could not set 'present' on ensure: Server answer API error:
{
"code": -32500,
"message": "Application error.",
"data": "No permissions to referred object or it does not exist!"
}
on request:
{
"method": "host.create",
"params": [
{
"host": "cent7test.example.edu",
"interfaces": [
{
"type": 1,
"main": 1,
"ip": "",
"dns": "cent7test.example.edu",
"port": "10050",
"useip": 0
}
],
"status": 0,
"available": 1,
"groups": [
{
"groupid": null
}
],
"proxy_hostid": null,
"templates": [
10001,
10102
]
}
],
"id": 80395,
"jsonrpc": "2.0",
"auth": "ae774e8c6af9b0790929ab1019109332"
} at 37:/etc/puppet/environments/feature_zabbix_agent/modules/zabbix/manifests/resources/agent.pp
Wrapped exception:
Server answer API error:
{
"code": -32500,
"message": "Application error.",
"data": "No permissions to referred object or it does not exist!"
}
on request:
{
"method": "host.create",
"params": [
{
"host": "cent7test.example.edu",
"interfaces": [
{
"type": 1,
"main": 1,
"ip": "",
"dns": "cent7test.example.edu",
"port": "10050",
"useip": 0
}
],
"status": 0,
"available": 1,
"groups": [
{
"groupid": null
}
],
"proxy_hostid": null,
"templates": [
10001,
10102
]
}
],
"id": 80395,
"jsonrpc": "2.0",
"auth": "ae774e8c6af9b0790929ab1019109332"
}
Error: /Stage[main]/Zabbix::Resources::Agent/Zabbix_host[cent7test.example.edu]/ensure: change from absent to present failed: Could not set 'present' on ensure: Server answer API error:
{
"code": -32500,
"message": "Application error.",
"data": "No permissions to referred object or it does not exist!"
}
on request:
{
"method": "host.create",
"params": [
{
"host": "cent7test.example.edu",
"interfaces": [
{
"type": 1,
"main": 1,
"ip": "",
"dns": "cent7test.example.edu",
"port": "10050",
"useip": 0
}
],
"status": 0,
"available": 1,
"groups": [
{
"groupid": null
}
],
"proxy_hostid": null,
"templates": [
10001,
10102
]
}
],
"id": 80395,
"jsonrpc": "2.0",
"auth": "ae774e8c6af9b0790929ab1019109332"
} at 37:/etc/puppet/environments/feature_zabbix_agent/modules/zabbix/manifests/resources/agent.pp
I'm trying out your module in combination with foreman and got a little problem which I can't seem to solve.
I followed the readme but had problems. Had to include postgresql::server and apache together with zabbix::server and set zabbix_url. In the end I got things working but if I now add a class to this kind of server I get the error that apache::mod::php requires apache::mod::prefork. Adding that leads to a duplicate definition :-(
Is there a way to debug this somewhat more then only looking at the messages from puppet?
As far as I can see everything should work but puppetwise it doesn't. The zabbix server does work.
Regards,
Joop
Hi Werner,
You have added to documentation:
class { 'postgresql': }
I get the errors:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: ERRO R: This class has been deprecated and the functionality moved
into mysql::server. If you run mysql::server without correctly calling
mysql:: server with the new override_options hash syntax you will revert
your MySQL to the stock settings. Do not proceed without removing this
class and using mysql::server correctly.
https://github.com/karolisc/puppet-zabbix/commit/50099a3562a6f12c057decfeae1a210d8fd327bd
btw. could you add some comment on db too?
Karolis
As per documentation it says "manage_firewall: Wheter you want to manage the firewall. If true (Which is default), iptables will be configured to allow communications to zabbix ports."
However 'manage_firewall' is set to 'false' in params.pp file. I had to manually set it to 'true' to get it working. Either documentation should be updated or params.pp should be modified so that manage_firewall is default to 'true.
Thanks
Good day.
After updating from 1.0.0 version to 1.3.0 I'm no longer able to install zabbix agent version 2.2.
I've researched and found following commit that changed installation behaviour.
I'm using Foreman with this module. Can you please assist how to force v2.2?
Thanks,
Mikhail.
Hi,
With the new 1.5.0 version I've this error message :
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter group_create on Zabbix_host[zabbix0.lan.xxxx] at /etc/puppet/modules/zabbix/manifests/resources/agent.pp:27 on node zabbix0.lan.xxxx
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
To temporarily avoid this I've to comment /etc/puppet/modules/zabbix/manifests/resources/agent.pp:32.
I've never wrote any puppet type but as far as I can see ./lib/puppet/provider/zabbix_host/ruby.rb and ./lib/puppet/type/zabbix_host.rb seems to be ok with this new feature ...
The database population script for the zabbix-proxy-mysql package is run with the command below:
command => "cd ${schema_path} && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' -D '${database_name}' < schema.sql && touch /etc/zabbix/.schema.done",
Because the schema.sql is gzipped into schema.sql.gz on Ubuntu 14.04 LTS, the command fails.
It should be altered with a small if-loop that checks if the file is gzipped:
command => "cd ${schema_path} && if [ -f schema.sql.gz ]; then gunzip schema.sql.gz ; fi && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' -D '${database_name}' < schema.sql && touch /etc/zabbix/.schema.done",
Hi,
I've got a dedicated node for zabbix-server, postgres and zabbix-web:
class profiles::zabbixweb {
class {'::zabbix::web':
manage_vhost => false,
zabbix_timezone => 'Europe/Berlin',
manage_resources => true,
database_host => '192.168.0.12',
database_name => 'zabbix',
database_user => 'zabbix',
database_password => 'password',
zabbix_server => '192.168.0.9',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'password',
zabbix_package_state => 'latest',
zabbix_version => '2.4',
}
}
class profiles::postgresqlserver {
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '9.4',
}->
class { '::postgresql::server':
listen_addresses => $::ipaddress_eth1,
ipv4acls => ['host zabbix zabbix 192.168.0.9/32 md5'],
}
postgresql::server::db { 'zabbix':
user => 'zabbix',
password => postgresql_password('zabbix', 'password'),
}
}
class profiles::zabbixserver {
class {'::postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => true,
version => '9.4',
}->
class {'::postgresql::client': }
class {'::zabbix::server':
zabbix_version => '2.2',
database_host => '192.168.0.12',
database_name => 'zabbix',
database_user => 'zabbix',
database_password => 'password',
}
}
in addition, the agent is running on every node:
class { '::zabbix::agent':
server => 'myserver',
zabbix_package_state => 'latest',
zabbix_version => '2.4',
manage_resources => true,
}
puppetdb is running fine, storeconfigs is also working. Puppet runs fine on every node except for the zabbix web node (I get the error for every node that runs the agent):
Error: /Stage[main]/Zabbix::Resources::Web/Zabbix_host[my-database]: Could not evaluate: uninitialized constant Puppet::Provider::Zabbix::ZabbixApi
Every machine is running Debian 8 with Puppet 3.8.1. Do you have any ideas?
The Zabbix Server class, as is currently defined in the wdijkerman-zabbix module, could actually be split into the 3 components:
In order to scale zabbix effectively, it's best practice to run each of these components on separate nodes.
(for example, http://blog.zabbix.com/scalable-zabbix-lessons-on-hitting-9400-nvps/2615/)
As it stands, it does not seem possible to use the wdijkerman-zabbix module to install the zabbix server on one node, the WebUI on a second, and the Database on a third.
puppetlabs/postgresql v4.3.0
wdijkerman/zabbix v1.4.0
Creation of a new postgresql instance fail with following message :
Notice: /Stage[main]/Zabbix::Database/Postgresql::Server::Db[zabbix_server]/Postgresql::Server::Database[zabbix_server]/Exec[/usr/lib/postgresql/9.1/bin/createdb --port='5432' --owner='' --template=template0 'zabbix_server']/returns: ^
Error: /Stage[main]/Zabbix::Database/Postgresql::Server::Db[zabbix_server]/Postgresql::Server::Database[zabbix_server]/Exec[/usr/lib/postgresql/9.1/bin/createdb --port='5432' --owner='' --template=template0 'zabbix_server']: Failed to call refresh: /usr/lib/postgresql/9.1/bin/createdb --port='5432' --owner='' --template=template0 'zabbix_server' returned 1 instead of one of [0]
Error: /Stage[main]/Zabbix::Database/Postgresql::Server::Db[zabbix_server]/Postgresql::Server::Database[zabbix_server]/Exec[/usr/lib/postgresql/9.1/bin/createdb --port='5432' --owner='' --template=template0 'zabbix_server']: /usr/lib/postgresql/9.1/bin/createdb --port='5432' --owner='' --template=template0 'zabbix_server' returned 1 instead of one of [0]
This is due to --owner=''.
To avoid this I edit manifests/database.pp:130 to change
postgresql::server::db { $database_name:
user => $database_user,
password => postgresql_password($database_user, $database_password),
require => Class['postgresql::server'],
}
to
postgresql::server::db { $database_name:
user => $database_user,
owner => $database_user,
password => postgresql_password($database_user, $database_password),
require => Class['postgresql::server'],
}
And thanks for your job ;)
Hi Werner,
I started moving userparameters into hiera. Maybe would be nice to control extensions of script files after they being landing to target server:
file { "${script_dir}/${name}"
Now all scripts end up without any extensions. But it might be tricky to realize though
Regards
Sergey
Installing latest version from forge does not work now that jessie has released. I see in repo.pp there is a workaround to map "sid" to wheezy but now that jessie has been released the os version is being reported as 8.0 and I get this error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: This is an unsupported operating system (Debian 8.0) at /etc/puppet/modules/zabbix/manifests/repo.pp:70
In forge.puppetlabs repository
casesize instead of cachesize
check comments we have to use this param in MB not in B
for example, just pust 32 if you want 32M in CacheSize value
In Ubuntu 14.04 we get this error every Puppet run:
Warning: /Apt_key[Add key: 79EA5ED4 from Apt::Source zabbix]: The id should be a full fingerprint (40 characters), see README.
The fingerprint should be:
Key fingerprint = FBAB D5FB 2025 5ECA B22E E194 D13D 58E4 79EA 5ED4
Hi Werner,
After enabling manage_resources zabbixapi gem fails to install.
Error 1:
`require': no such file to load -- mkmf (LoadError)
from extconf.rb:36
Error 2:
Error: Could not update: Execution of '/usr/bin/gem install -v 2.4.0 --no-rdoc --no-ri zabbixapi' returned 1: Building native extensions. This could take a while...
ERROR: Error installing zabbixapi:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
creating Makefile
make
sh: 1: make: not found
The module misses these packages:
sudo apt-get install ruby1.9.1-dev
sudo apt-get install build-essential
Hi,
I want to increase memory_limit for zabbix vhost. I suppose that below default should be overwritten in zabbix::web where apache::vhost type is defined
custom_fragment => "
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone ${zabbix_timezone}",
But I seems stuck, since I need to do it via hiera.
I tried this but no luck
zabbix::web:
zabbix_vhost:
php_values:
memory_limit: 256
How it can be changed?
Thanks
Sergey
Hostname and HostnameItem are both set by default, this leads into this warning:
Shutting down Zabbix agent: [ OK ]
Starting Zabbix agent: zabbix_agentd [3912]: Warning: both Hostname and HostnameItem defined, using [xxx]
HostnameItem should not set by default, and Hostname should be disabled when HostnameItem is set
If zabbix::repo is used outside of zabbix::server, zabbix::params is not inherited, in such case default param values are not well resolved :
class zabbix::repo(
$manage_repo = $zabbix::params::manage_repo,
$zabbix_version = $zabbix::params::zabbix_version,
) {
$manage_repo & $zabbix_version are undefined.
This need occurs when apt configuration is done in a different stage than other job. My case (stage first is done before main)
class {'::zabbix::repo':
stage => 'first',
manage_repo => true,
zabbix_version => '2.4',
}
...
class {'::zabbix':
zabbix_url => 'zabbix.domain.tld',
manage_firewall => true,
manage_repo => false,
database_type => 'postgresql',
}
when i don't specify manage_repo & zabbix_version, ::zabbix::repo does nothing.
So, is it possible that zabbix::repo inherits zabbix::params to enable default values ?
This template contains the following line:
$ZBX_SERVER = '<%= @dbhost %>';
This causes the web interface to look to the database server for the zabbix-server which is not always the case.
This can be fixed by changing the line to:
$ZBX_SERVER = '<%= @fqdn %>';
Sorry i cannot make a pull request for this one.
Love the module, keep up the good work mate.
Hi again,
Is it possible to change the hostname in the zabbix-proxy configuration file?
I don't found how to do that.
Something like that zabbix::proxy::hostname: 'My_Custom_Name'
Regards.
When I declare the proxy hostname by class, for example:
class { 'zabbix::proxy':
zabbix_package_state => 'latest',
hostname => 'proxy.domain.com',
database_host => 'localhost',
database_type => 'mysql',
manage_database => false,
database_name => 'zabbix_proxy',
database_user => 'zabbix',
database_password => 'zabbix',
zabbix_server_host => 'server.domain.com',
database_socket => '/var/lib/mysql/mysql.sock',
database_port => '3306',
offlinebuffer => '8',
logfile => '/var/log/zabbix/zabbix_proxy.log',
logfilesize => '0',
zabbix_server_port => '10051',
pidfile => '/var/run/zabbix/zabbix_proxy.pid',
}
the hostname is not set in zabbix_proxy.conf file, but the server FQDN.
That would work correct?
I'm using:
Centos 6.6
Zabbix Agent 2.4
Zabbix Proxy 2.4
Puppet 3.7.4
Thank you
Hi Werner,
fping and fping6 in params.pp points to /usr/sbin/fping on Ubuntu it is:
locate fping
/usr/bin/fping
/usr/bin/fping6
Karolis
Found a typo, probably relating to atleast agent.pp listenip.
The following code block has its comparison backwards:
if $listenip == undefined {
if ($listenip =~ /^(eth|bond|lxc).*/) {
$listen_ip = inline_template('<%= scope.lookupvar(int_name) %>')
} elsif is_ip_address($listenip) {
$listen_ip = $listenip
} else {
}
} else {
}
It should be:
if $listenip != undefined {
if ($listenip =~ /^(eth|bond|lxc).*/) {
$listen_ip = inline_template('<%= scope.lookupvar(int_name) %>')
} elsif is_ip_address($listenip) {
$listen_ip = $listenip
} else {
}
} else {
}
If I enable manage_resources in zabbix::server on a machine running ruby 1.8.7, I get the following error:
err: Could not run Puppet configuration client: no such file to load -- zabbixapi
(I'm using debian, and puppet seems to have a hardcoded dependency on ruby 1.8, despite ruby 1.9.3 also being installed on the system.)
Do you intend this module to work with ruby 1.8.7, or only newer versions?
Debian 7
puppetlabs/postgresql v4.3.0
wdijkerman/zabbix v1.4.0
Creation of a new web instance fail with following message :
Info: /Stage[main]/Zabbix::Server/Service[zabbix-server]: Unscheduling refresh on Service[zabbix-server]
Error: Could not set 'present' on ensure: No such file or directory - /etc/zabbix/web/zabbix.conf.php20150525-14233-2ute18.lock at 216:/etc/puppet/modules/zabbix/manifests/web.pp
Error: Could not set 'present' on ensure: No such file or directory - /etc/zabbix/web/zabbix.conf.php20150525-14233-2ute18.lock at 216:/etc/puppet/modules/zabbix/manifests/web.pp
Wrapped exception:
No such file or directory - /etc/zabbix/web/zabbix.conf.php20150525-14233-2ute18.lock
Error: /Stage[main]/Zabbix::Web/File[/etc/zabbix/web/zabbix.conf.php]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory - /etc/zabbix/web/zabbix.conf.php20150525-14233-2ute18.lock at 216:/etc/puppet/modules/zabbix/manifests/web.pp
This fail because /etc/zabbix does not contain any "web" directory.
On params.pp:
$zabbix_version = '2.4'
On my manifest
class { '::zabbix::agent':
zabbix_version => '2.2',
}
This results in zabbix-agent 2.4 installed
This can be easily fixed passing zabbix_version to class repo in agent.pp:
if $manage_repo {
#include zabbix::repo
class { 'zabbix::repo':
zabbix_version => $zabbix_version,
}
Package['zabbix-agent'] {require => Class['zabbix::repo']}
}
Exactly same issue on proxy.pp and very likely server.pp.
Good day.
Faced strange issue. Tried to debug it:
# puppet module install wdijkerman-zabbix -d
Debug: Runtime environment: puppet_version=3.7.0, ruby_version=1.8.7, run_mode=user
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=wdijkerman-zabbix
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-apache
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-apache&limit=20&offset=20
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-firewall
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-firewall&limit=20&offset=20
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-stdlib
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-stdlib&limit=20&offset=20
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-concat
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=ripienaar-concat
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-postgresql
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-postgresql&limit=20&offset=20
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-apt
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-mysql
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=puppetlabs-mysql&limit=20&offset=20
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/releases?module=bodepd-create_resources
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Info: Resolving dependencies ...
Info: Preparing to install ...
Debug: HTTP GET https://forgeapi.puppetlabs.com/v3/files/wdijkerman-zabbix-0.4.1.tar.gz
Debug: Failed to load library 'pe_license' for feature 'pe_license'
Debug: Executing 'gzip -dc /var/lib/puppet/puppet-module/cache/wdijkerman-zabbix20140918-29480-rt697-0 | tar xof -'
Debug: Executing 'find . -type d -exec chmod 755 {} +'
Debug: Executing 'find . -type f -exec chmod a-wst {} +'
Debug: Executing 'chown -R 0:0 .'
Error: No such file or directory - /var/lib/puppet/puppet-module/cache/tmp-unpacker20140918-29480-1wwook3/zabbix
Error: Try 'puppet help module install' for usage
I'm using foreman(maybe this will help).
For now I've managed to install module by repacking it and creating symlink: zabbix -> wdijkerman-zabbix-0.4.1
Thanks,
Mikhail.
Hi,
I use zabbix::userparams in node definition like that:
node test {
include zabbix::agent
zabbix::userparams { 'mysql.conf':
content => 'UserParameter=mysql.ping,mysqladmin -uroot ping | grep -c alive',
}
and when run puppet aggent -t got error:
Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/mysql.conf.conf] => Service[zabbix-agent] => File[/mysql.conf.conf])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
I try use zabbix:userparams without inslude zabbix::agent, but got error:
Error: Failed to apply catalog: Could not find dependency Service[zabbix-agent] for File[/mysql.conf.conf] at /etc/puppet/modules/zabbix/manifests/userparameters.pp:60
How use this to work correctly ?
Using wdijkerman-zabbix-1.0.0, when manage_repo in zabbix::server is false, zabbix::repo is still required (and installs the repos).
This is because of the following: -
package { "zabbix-server-${db}":
ensure => $zabbix_package_state,
require => Class['zabbix::repo'],
}
Hi Werner,
Please update apache_ssl_cipher list and clarify which list is used (Modern compatibility?) by updating comment.
Karolis
OS: RHEL 6
Puppet Master: 3.7.4
Puppet Agent: 3.7.4
node 'ZABBIXMASTER' {
file { '/etc/yum.conf':
source => 'puppet:///modules/yum/yum.conf',
owner => root,
group => root,
}
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
class { 'mysql::server': }
class { 'zabbix':
zabbix_url => 'ZABBIXMASTER',
database_type => 'mysql',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'HIDDEN',
manage_resources => true,
}
class { 'zabbix::agent':
server => 'ZABBIXMASTER',
}
}
node 'EXAMPLENODE' {
class { 'zabbix::agent':
server => 'c0007329.itcs.hp.com',
manage_resources => true,
}
Puppet complains that neither bundler or zabbixapi are installed in logs.
The Zabbix module reports this should resolve after a maximum of 3 runs. Issue did not resolve itself after more than 3 runs.
https://forge.puppetlabs.com/wdijkerman/zabbix/readme#when-using-exported-resources
Installed bundler and zabbixapi gems on the Zabbix Master server.
gem install bundler
gem install zabbixapi
After running puppet agent --test
on Zabbix Master the following errors are reported.
[root@nope zabbix]# puppet agent --test
Info: Retrieving plugin
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/win_common_desktop_directory.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/apt_update_last_success.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_puppetdb_server_status.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppi_projects.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/last_run.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/platform_tag.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_build.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows_common_appdata.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/gemhome.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/apt_updates.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/staging_http_get.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb
Info: Caching catalog for c2t06545.itcs.hp.com
Info: Applying configuration version '1424201871'
Error: Could not run Puppet configuration client: cannot load such file -- zabbixapi
Error: Could not run: can't convert Puppet::Util::Log into Integer
Hi,
i have an issue when I try to put domain name in zabbix::agent for the parameter server and or serveractive.
Indeed, in manifests/agent.pp we have this code for the firewall :
# Manage firewall
if $manage_firewall {
firewall { '150 zabbix-agent':
dport => $listenport,
proto => 'tcp',
action => 'accept',
source => "${server}/24",
state => ['NEW','RELATED', 'ESTABLISHED'],
}
Here my code :
# Zabbix
class { 'zabbix::agent':
zabbix_version => '2.2.6',
server => 'example.com',
serveractive => 'example.com',
hostname => 'test_puppet',
manage_firewall => true,
}
zabbix::userparameters { 'raid_default':
source => 'puppet:///modules/zabbix/raid0_test.conf.erb',
}
The /24 doesn't work on debian 7 (wheezy).
I have this error with puppet agent -v --test --debug command.
Error: Failed to apply catalog: Parameter source failed on Firewall[150 zabbix-agent]: host_to_ip failed for example.fr/24, exception no address for example.com//24 at /etc/puppet/modules/zabbix/manifests/agent.pp:292
Wrapped exception:
host_to_ip failed for example.com/24, exception no address for parc.tec6.fr/24
Can you make a change for resolv this unfotunetly problem please ?
Thanks for you super project !
It would be great to support SSL sites when managing the Apache vhost. Also, the new provider which connects to the zabbix api has the url protocol hard coded:
:url => "http://#{zabbix_url}/api_jsonrpc.php",
Today I've tried to update from 0.5.1 to 1.3.0 and got an error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: validate_re(): "FBABD5FB20255ECAB22EE194D13D58E479EA5ED4" does not match ["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z"] at /etc/puppet/environments/zabbix_update/modules/apt/manifests/key.pp:60 on node vagrant-ubuntu-precise-64
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Found, that you've updated keys in 32adbb8, but my apt module was of version 1.6.0.
Could you, please, add dependency on apt module, so it would be easier to update later?
Thank you!
Hello, and thank you for this Puppet module, it's quite excellent. I have run into an issue with proxy configuration, however. Proxies support use of sqLite for the dbtype in Zabbix, and it looks like there is mention of this in your docs also:
https://github.com/dj-wasabi/puppet-zabbix/blob/master/manifests/proxy.pp#L11
However, setting the dbtype to `sqlite' seems to fail with the following error:
Error: Unrecognized database type for proxy: sqlite at /etc/puppet/modules/zabbix/manifests/proxy.pp:295
Farther down in the proxy manifest, it looks like there is no case switch to set `sqlite' as an option for the dbtype:
https://github.com/dj-wasabi/puppet-zabbix/blob/master/manifests/proxy.pp#L286
case $dbtype {
'postgresql': {
$db = 'pgsql'
}
'mysql': {
$db = 'mysql'
}
default: {
fail("Unrecognized database type for proxy: ${dbtype}")
}
}
Is this an option that can be fully implemented at some point? Thank you.
I've had trouble attempting to use this module with postgresql on another machine.
class { 'zabbix::server':
zabbix_url => 'zabbix.example.com',
dbhost => '10.0.0.2',
}
(Where the machine at 10.0.0.2 is already set up running postgresql).
I get the following types of puppet errors:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Postgresql_psql[Check for existence of db 'zabbix-server'] { require => Class[Postgresql::Server::Service] }, because Class[Postgresql::Server::Service] doesn't seem to be in the catalog
And
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Postgresql_psql[CREATE ROLE "zabbix-server" ENCRYPTED PASSWORD '**redacted**' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1] { require => Class[Postgresql::Server] }, because Class[Postgresql::Server] doesn't seem to be in the catalog
This is because the module has require statements which reference the postgreqsl classes, assuming they're going to be on the same machine. If I add include postgresql::server
to my manifest, then the errors go away. (But then I end up postgresql configured on the localhost, not remotely)
The path for psql in zabbix::database::postgresql is: -
/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I have it installed in /opt/postgres/9.3/bin.
Can we have a parameter to set the path for non-standard.
I can create a symlink, but it seems a shame that it's necessary.
Are you accepting merge requests or have plans to support centos 7?
I'm having an interesting error.
According to the docs I don't need to add anything more than:
class { 'zabbix::agent':
server => 'ipaddress',
}
which I did.
Here is the code snippet:
'ubuntu' : {
apt::source { 'zabbix':
location => "http://repo.zabbix.com/zabbix/${zabbix_version}/ubuntu/",
release => $ubuntu,
repos => 'main',
key => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
key_source => 'http://repo.zabbix.com/zabbix-official-repo.key',
}
Are you using an "old" apt::source definition?
David Thornton
It would be nice to give users possibility to select where they would like scripts to be installed.
Could you, please, parametrise script folder like ${include_dir}
for user parameters?
Thank you.
When deploying "zabbix::web" on a stand alone server or on a monolithic server I get the following error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template apache/vhost/_directories.erb:
Filepath: /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/parser/functions/fail.rb
Line: 3
Detail: Apache::Vhost: Using allow is not supported in your Apache version
at /etc/puppetlabs/puppet/environments/production/modules/apache/manifests/vhost.pp:545 on node zabbix-web.streetlightdata.net
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
All other modules (including "zabbix::database" and "zabbix::server) deploy without issues.
Setup is as follows (all instances running in google cloud):
Newly build puppet enterprise server [3.7.3 (Puppet Enterprise 3.7.1)]
Newly build zabbix server. Installed zabbix module with "puppet module install wdijkerman-zabbix"
Class: apache
mpm_module = "prefork"
Class: apache::mod::php
Class: zabbix::web
zabbix_url = "zabbix-web.test.net"
Hello,
I've installed your puppet module in my environment. I'm using exported_resources and my nodes are automatically added to zabbix thanks to your module.
I'm following the instructions in https://github.com/dj-wasabi/puppet-zabbix#usage-zabbix-userparameters and configured some userparemeters in hiera:
zabbix::userparameter::data:
DiskIO_userparameters:
source: 'puppet:///modules/zabbix/diskio.conf'
template: 'DiskIO'
But the userparameter is not copied to the client.
I've hardcoded manage_reosurces=true in the module.
If I call it as zabbix:userparameters:
zabbix::userparameters { 'diskIO' :
source => 'puppet:///modules/zabbix/diskio.conf',
template => 'DiskIO',
}
It works as expected.
So, at this point I'm not sure if I faced a bug in the zabbix/hiera usage or in the doc or something wrong in my code.
Am I doing something wrong? Do you have any working example?
Many thanks for your great work in this module.
Cheers,
A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.