Skip to content

Zabbix/checks fsicos2 fsicos3#69

Open
robban-github wants to merge 30 commits into
masterfrom
zabbix/checks_fsicos2_fsicos3
Open

Zabbix/checks fsicos2 fsicos3#69
robban-github wants to merge 30 commits into
masterfrom
zabbix/checks_fsicos2_fsicos3

Conversation

@robban-github
Copy link
Copy Markdown
Contributor

Sending an updated new structure and files with custom zabbix checks for fsicos2 and fsicos3.

robban-github and others added 30 commits October 13, 2025 10:56
Copy link
Copy Markdown
Contributor

@jonathanthiry jonathanthiry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sit needed to keep a copy of this file here, or could we get it from a remove URL?

Comment on lines +30 to +52
- 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it report that the task made some changes even if the service wasn't restarted?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a separate PR? It doesn't seem related to the Zabbix changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants