Using rsyslog on OpenVZ like Proxmox can lead to a problem, which symtoms are mostly:
Error message is “Cannot read proc file system: 1 – Operation not permitted.”, because the file /proc/kmsg could not be read.
I’ve written a small ANSIBLE playbook that repair it
--- # # Repair 100% CPU load by rsyslog on ubuntu in openvz - hosts: all user: [Replace_with_your_remote_username] sudo: yes handlers: - name: start rsyslog service: name=rsyslog state=started tasks: - name: Check rsyslog file existence stat: path=/etc/rsyslog.conf register: rs ignore_errors: True - name: Stop Rsyslog service: name=rsyslog state=stopped when: rs.stat.exists == true and ansible_virtualization_type == 'openvz' ignore_errors: True - name: Commenting "ModLoad imklog" replace: dest=/etc/rsyslog.conf regexp='^\$ModLoad imklog' replace='#$ModLoad imklog' backup=yes when: rs.stat.exists == true and ansible_virtualization_type == 'openvz' notify: start rsyslog
Simply edit the above playbook by using the “user” and “hosts” of your choice.
Did it work for you? Let us know what you think about it by dropping a comment and sharing it with the community!