mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add SELinux instructions for systemd monitoring (#14806)
This commit is contained in:
@@ -2581,7 +2581,31 @@ extend systemd /etc/snmp/systemd.py
|
||||
}
|
||||
```
|
||||
|
||||
5. Restart snmpd.
|
||||
5. (Optional) If you have SELinux in Enforcing mode, you must add a module so the script can access systemd state:
|
||||
```
|
||||
cat << EOF > snmpd_systemctl.te
|
||||
module snmpd_systemctl 1.0;
|
||||
|
||||
require {
|
||||
type snmpd_t;
|
||||
type systemd_systemctl_exec_t;
|
||||
type init_t;
|
||||
class file { execute execute_no_trans map open read };
|
||||
class unix_stream_socket connectto;
|
||||
class system status;
|
||||
}
|
||||
|
||||
#============= snmpd_t ==============
|
||||
allow snmpd_t init_t:system status;
|
||||
allow snmpd_t init_t:unix_stream_socket connectto;
|
||||
allow snmpd_t systemd_systemctl_exec_t:file { execute execute_no_trans map open read };
|
||||
EOF
|
||||
checkmodule -M -m -o snmpd_systemctl.mod snmpd_systemctl.te
|
||||
semodule_package -o snmpd_systemctl.pp -m snmpd_systemctl.mod
|
||||
semodule -i snmpd_systemctl.pp
|
||||
```
|
||||
|
||||
6. Restart snmpd.
|
||||
|
||||
|
||||
## TinyDNS aka djbdns
|
||||
|
Reference in New Issue
Block a user