HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/thread-self/root/proc/thread-self/root/lib64/nagios/plugins/check_csf
#!/bin/bash
# Simple check for CSF (ConfigServer Security & Firewall)
# Version: 1.0

if [ -d /etc/csf ]; then
    if [[ "$(sudo csf --status | grep DROP -c)" -gt 0 ]]; then
        if [[ "$(ps aux | grep 'lfd' | grep -v grep | wc -l)" -eq 0 ]]; then
            echo "CSF CRITICAL – CSF is running but LFD is stopped"
            exit 2
        fi
        echo "CSF OK – Running"
        exit 0
    else
        echo "CSF CRITICAL – NOT Running"
        exit 2
    fi
else
    echo "CSF CRITICAL – NOT installed"
    exit 2
fi