untergeek / zabbix-grab-bag

This is a collection of miscellaneous scripts for Zabbix data collection, maintenance, etc.
Other
107 stars 31 forks source link

ERROR: Connection failure. Exception: global name 'is_master_node' is not defined #9

Open erik-de-neve opened 8 years ago

erik-de-neve commented 8 years ago

Hi,

If i enable master_only = True, it always gives an error (also on the masternode): ERROR: Connection failure. Exception: global name 'is_master_node' is not defined

I fixed this by installing curator, and import it in the es_stats_zabbix/utils.py script. Here is a diff with my version:

# diff es_stats_zabbix/utils.py /tmp/utils.py.orig 
6d5
< import curator
88c87
<     if master_only and not curator.is_master_node(client):

---
>     if master_only and not is_master_node(client):

is this the right way to fix this?

Thanks, Erik

untergeek commented 8 years ago

Sorry for the belated response.

Your suggestion should fix it temporarily. Thanks for reporting the bug. I will probably make curator a dependency to use the client methods in there (that way I don't have to maintain them in two places).

The benefit will be YAML client configuration files, too. INI is pretty crusty and old.