Zabbix/checks fsicos2 fsicos3#69
Conversation
jonathanthiry
left a comment
There was a problem hiding this comment.
Nice to have the configuration here!
It's a bit unfortunate that the checks are server specific. Would it be possible to reuse them, or have a clearer distinction why they would need to be different? It looks like check_certbot_valid_days.py is identical for both servers for example.
There was a problem hiding this comment.
This change should be removed.
| - name: Install Zabbix repository package on fsicos2 and fsicos3 | ||
| when: ansible_hostname in ['fsicos2', 'fsicos3'] | ||
| block: | ||
| - name: Copy Zabbix release package to /root/ |
There was a problem hiding this comment.
I sit needed to keep a copy of this file here, or could we get it from a remove URL?
| - name: Configure Zabbix agent2 - Set Server parameter | ||
| lineinfile: | ||
| path: "{{ zabbix_agent_conf_file }}" | ||
| regexp: '^Server=.*$' | ||
| line: 'Server={{ zabbix_server_host }}' | ||
| register: server_changed | ||
|
|
||
|
|
||
|
|
||
|
|
||
| - name: Configure Zabbix agent2 - Set ServerActive parameter | ||
| lineinfile: | ||
| path: "{{ zabbix_agent_conf_file }}" | ||
| regexp: '^ServerActive=.*$' | ||
| line: 'ServerActive={{ zabbix_server_host }}' | ||
| register: serveractive_changed | ||
|
|
||
| - name: Configure Zabbix agent2 - Set Hostname parameter | ||
| lineinfile: | ||
| path: "{{ zabbix_agent_conf_file }}" | ||
| regexp: '^Hostname=Zabbix server$' | ||
| line: "Hostname={{ ansible_hostname }}" | ||
| register: hostname_changed |
There was a problem hiding this comment.
Is the zabbix_agent_conf_file added when the agent is installed? Could it be better to have as a template instead of doing these modifications with a regex?
| msg: "Zabbix agent2 configuration has been modified" | ||
| when: server_changed.changed or serveractive_changed.changed or hostname_changed.changed | ||
| notify: restart zabbix-agent2 | ||
| changed_when: true |
There was a problem hiding this comment.
Would it report that the task made some changes even if the service wasn't restarted?
There was a problem hiding this comment.
Should it be a separate PR? It doesn't seem related to the Zabbix changes.
Sending an updated new structure and files with custom zabbix checks for fsicos2 and fsicos3.