diff --git a/doc/Extensions/Applications.md b/doc/Extensions/Applications.md index 489d12d97d..20dc123f3b 100644 --- a/doc/Extensions/Applications.md +++ b/doc/Extensions/Applications.md @@ -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