Skip to content

Instantly share code, notes, and snippets.

@raphaunix
Created November 7, 2017 02:12
Show Gist options
  • Save raphaunix/85cff30d924083e346f73cc90a384e12 to your computer and use it in GitHub Desktop.
Save raphaunix/85cff30d924083e346f73cc90a384e12 to your computer and use it in GitHub Desktop.
[SOLVED] - "Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details."
"Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details."
[SOLVED]
sudo setenforce 0
@durgeshmanjhi
Copy link

durgeshmanjhi commented Dec 24, 2020

I was getting the same error in ansible, for restarting zabbix agent, After adding this piece of code its working fine.
Also don't add daemon_reload=yes , while restarting zabbix.


- name: SELinux specific configuration for zabbix agent
  block:
    - name: Create zabbix log file
      file:
        path: /var/log/zabbix/zabbix_agentd.log
        state: touch

    - name: Set zabbix pid folder permission
      file:
        path: /run/zabbix
        state: directory
        mode: u=rwx,g=rwx,o=rwx
        recurse: True

    - name: "Enable Zabbix specific booleans if selinux enabled"
      seboolean:
        name: "{{ item }}"
        state: yes
        persistent: yes
      with_items:
       - zabbix_can_network
       - zabbix_run_sudo

    - name: Copy zabbix package for selinux to unblock port
      copy: src=zabbix_agent.pp dest=/etc/zabbix/zabbix_agent.pp mode=0644

    - name: "Enable Zabbix selinux moule to allow zabbix port"
      command: semodule -i /etc/zabbix/zabbix_agent.pp
      args:
        chdir: /etc/zabbix/
  when: ansible_selinux.status == "enabled"

- name: Restart zabbix agent
  service: name=zabbix-agent state=restarted`

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