Server IP : 162.213.251.212 / Your IP : 3.137.174.52 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/proc/self/root/lib64/nagios/plugins/nccustom/ |
Upload File : |
#!/bin/bash log_host="127.0.0.1" log_port="514" log_path=$(systemctl cat hc-safe-logger|grep -i "LOG_DIRECTORY"|awk -F'=' '{gsub(/"/,"",$3); print $3}') [[ -z "${log_path}" ]] && log_path="/var/log/nc_audit/hc-safe-logger" # check process if ! (pidof hc-safe-logger > /dev/null 2>&1); then echo "CRITICAL! hc-safe-logger: Process doesn't exist." exit 2 fi # check connection if ! (nc -zu "${log_host}" "${log_port}"); then echo "CRITICAL! hc-safe-logger: Connection refused." exit 2 fi # check new records logger --server "${log_host}" --port "${log_port}" -p local0.info "check hc-safe-logger" -t "HEALTH_CHECK" && sleep 3 files=$(find "${log_path}" -mmin -59 -type f) if [[ -z "${files}" ]]; then echo "CRITICAL! hc-safe-logger: No records in log from last hour." exit 2 fi # all check passed echo "OK. hc-safe-logger: Healthy." exit 0