voxpupuli / puppet-zabbix

Puppet module for creating and maintaining zabbix components with puppet.
https://forge.puppet.com/puppet/zabbix
Apache License 2.0
80 stars 228 forks source link

Error: Could not set 'present' on ensure: undefined local variable or method `proxy_mode' for #<Puppet::Type::Zabbix_proxy::ProviderRuby:0x00000003aa85b8> #334

Open peceka opened 7 years ago

peceka commented 7 years ago

Affected Puppet, Ruby, OS and module versions/distributions

I've created zabbix proxy with such hiera config: classes:

zabbix::proxy::manage_resources: true zabbix::mode: 1 zabbix::proxy::mode: 1 zabbix::proxy_mode: 1

so nothing special. Also creating zabbix server was no challenging: classes:

zabbix::manage_resources: true zabbix::web::manage_resources: true

So when running puppet agent --test on proxy machine it puts data to puppetdb. And after that running puppet agent --test on zabbix server I receive:

Error: Could not set 'present' on ensure: undefined local variable or method proxy_mode' for #<Puppet::Type::Zabbix_proxy::ProviderRuby:0x000000042ef6b8> Error: Could not set 'present' on ensure: undefined local variable or methodproxy_mode' for # Wrapped exception: undefined local variable or method proxy_mode' for #<Puppet::Type::Zabbix_proxy::ProviderRuby:0x000000042ef6b8> Error: /Stage[main]/Zabbix::Resources::Web/Zabbix_proxy[zabbix-proxy.domain.com]/ensure: change from absent to present failed: Could not set 'present' on ensure: undefined local variable or methodproxy_mode' for # Error: Could not set 'present' on ensure: Server answer API error { "code": -32602, "message": "Invalid params.", "data": "Trigger has items from template \"Template App Zabbix Proxy\" that is not linked to host." } on request: { "method": "template.massAdd", "params": { "hosts": [ { "hostid": null } ], "templates": [ { "templateid": 10048 } ] }, "id": 16118, "jsonrpc": "2.0", "auth": "57d3992bc5eb3cee2c0f46cdb9efff59" } Error: Could not set 'present' on ensure: Server answer API error { "code": -32602, "message": "Invalid params.", "data": "Trigger has items from template \"Template App Zabbix Proxy\" that is not linked to host." } on request: { "method": "template.massAdd", "params": { "hosts": [ { "hostid": null } ], "templates": [ { "templateid": 10048 } ] }, "id": 16118, "jsonrpc": "2.0", "auth": "57d3992bc5eb3cee2c0f46cdb9efff59" } Wrapped exception: Server answer API error { "code": -32602, "message": "Invalid params.", "data": "Trigger has items from template \"Template App Zabbix Proxy\" that is not linked to host." } on request: { "method": "template.massAdd", "params": { "hosts": [ { "hostid": null } ], "templates": [ { "templateid": 10048 } ] }, "id": 16118, "jsonrpc": "2.0", "auth": "57d3992bc5eb3cee2c0f46cdb9efff59" } Error: /Stage[main]/Zabbix::Resources::Web/Zabbix_userparameters[zabbix-proxy.domain.com_zabbix-proxy_Zabbix_Proxy]/ensure: change from absent to present failed: Could not set 'present' on ensure: Server answer API error { "code": -32602, "message": "Invalid params.", "data": "Trigger has items from template \"Template App Zabbix Proxy\" that is not linked to host." } on request: { "method": "template.massAdd", "params": { "hosts": [ { "hostid": null } ], "templates": [ { "templateid": 10048 } ] }, "id": 16118, "jsonrpc": "2.0", "auth": "57d3992bc5eb3cee2c0f46cdb9efff59" }

Can anybody give some hint what's wrong?

regards, p.

ghost commented 7 years ago

I am experiencing this same issue. I think it is because of a missing parameter in the proxy ruby code. I have made a PR to fix it.