mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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:
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user