Add SELinux configuration for SNMPd on Centos8 in the documentation (#14095)

* Add SELinux configuration for SNMPd on Centos8 in the documentation

* Change file creation to EOF style
This commit is contained in:
Félix Bouynot
2022-07-16 05:14:07 +02:00
committed by GitHub
parent 066e4c4e15
commit 1f41d6b16f

View File

@@ -105,6 +105,29 @@ Add the following config to your snmptrapd.service after `ExecStart=/usr/sbin/sn
```
On SELinux, you need to configure SELinux for SNMPd to communicate to LibreNMS:
```
cat > snmptrap.te << EOF
module snmptrap 1.0;
require {
type httpd_sys_rw_content_t;
type snmpd_t;
class file { append getattr open read };
class capability dac_override;
}
#============= snmpd_t ==============
allow snmpd_t httpd_sys_rw_content_t:file { append getattr open read };
allow snmpd_t self:capability dac_override;
EOF
checkmodule -M -m -o snmptrap.mod snmptrap.te
semodule_package -o snmptrap.pp -m snmptrap.mod
semodule -i snmptrap.pp
```
After successfully configuring the service, reload service files, enable, and start the snmptrapd service:
```