BATOSAY Shell
Server IP : 170.10.162.208  /  Your IP : 216.73.216.181
Web Server : LiteSpeed
System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64
User : deltahospital ( 1806)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib64/nagios/plugins/check_fs.sh
#!/bin/bash

set -o pipefail -u

FILE="/tmp/dirty_fs_7Qas9rRW"
DMESG=$(which dmesg)
DMESGOPTS="-T"
GREP=$(which grep)
GREPOPTS="-w"
GREPSTRING="EXT4-fs error"
TAIL=$(which tail)
TAILOPTS="-1"
TOUCH=$(which touch)

[[ -f $FILE ]] && \
printf "\360\237\214\213 " && \
echo "CRITICAL: Filesystem is broken. Restart and repair now." && \
exit 2

CHECK_FS=$($DMESG $DMESGOPTS | $GREP $GREPOPTS "$GREPSTRING" | $TAIL $TAILOPTS)

if [ ! -z "$CHECK_FS" ]
then
    	$TOUCH $FILE 2>/dev/null && \
        printf "\360\237\214\213 " && \
        echo "CRITICAL: Filesystem is broken. Restart and repair now." && \
        exit 2 || \
        printf "\360\237\231\200 " && \
        echo "UNKNOWN: Cannot create temp file $FILE" &&  \
        exit 3
fi

printf "\360\237\222\232 " && \
echo "OK:" "Filesystem is clean." && \
exit 0

Batosay - 2023
IDNSEO Team