Add SELinux instructions for systemd monitoring (#14809)

This commit is contained in:
Félix Bouynot
2023-01-27 00:03:28 +00:00
committed by GitHub
parent 48be858bf2
commit c2e248da55
+23
View File
@@ -2186,6 +2186,29 @@ chmod +x /etc/snmp/redis.py
extend redis /etc/snmp/redis.py
```
4. (Optional) If you have SELinux in Enforcing mode, you must add a module so the script can get redis informations and write them:
```
cat << EOF > snmpd_redis.te
module snmpd_redis 1.0;
require {
type tmp_t;
type redis_port_t;
type snmpd_t;
class tcp_socket name_connect;
class dir { add_name write };
}
#============= snmpd_t ==============
allow snmpd_t redis_port_t:tcp_socket name_connect;
allow snmpd_t tmp_t:dir { write add_name };
EOF
checkmodule -M -m -o snmpd_redis.mod snmpd_redis.te
semodule_package -o snmpd_redis.pp -m snmpd_redis.mod
semodule -i snmpd_redis.pp
```
### Agent
[Install the agent](Agent-Setup.md) on this device if it isn't already