HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
File: //opt/BCLinux/bse/secure_check/c19_syslogError
#!/bin/sh

#=======================================================
InsertSection "check if record the error events"

SYSLOG_CONF="/etc/rsyslog.conf /etc/syslog.conf"

for i in ${SYSLOG_CONF}
do
    if [ -s ${i} ];then
        cp -np ${i} ${i}_bak
        grep "*.err \{1,\}\/var\/log\/.\{1,\}" ${i}|grep -v "#" |wc -l | while read count
        do
            if [ $count -lt 1 ];then
                echo "c19" >> $RESULT_FILE
                echo "" >> $RESULT_FILE
                logtext "WRN_C19: $(loadtext TXT_WRN_C19)"
                logtext "Suggestion: $(loadtext TXT_SUG_C19)"
                Display --indent 2 --text "- Check if there have *.err set... " --result WARNING --color RED
                AddHP 0 1
            else
                logtext "The security audit modle *err is set, checking OK"
                Display --indent 2 --text "- Check if there have *.err set... " --result OK --color GREEN
                AddHP 1 1
            fi
        done

    fi
done