HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/share/locaweb-plugins/check-mk/ipmi_sensors.sh
sdrcache=/var/cache/.freeipmi/sdr-cache/sdr-cache-$(hostname).127.0.0.1
if type ipmi-sensors >/dev/null && [ ! -e "$sdrcache" -o -s "$sdrcache" ]
then
    # No cache file existing? => Impose a high time limit. We do not suffice
    # in creating the cache we most probably run on a hardware where this tool
    # is hanging forever. We make sure that we never try again in that case!
    if [ ! -e "$sdrcache" ]
    then
        WAITMAX="waitmax 300"
    elif tail --bytes 2 < "$sdrcache" | od -t x2 | grep -q 0a0a
    then
        WAITMAX="waitmax 3"
    else
        # Cache file corrupt. Must end with two linefeeds.
        rm -f $sdrcache
    WAITMAX=
    fi
    # Newer ipmi-sensors version have new output format; Legacy format can be used
    if ipmi-sensors --help | grep -q legacy-output; then
        IPMI_FORMAT="--legacy-output"
    else
        IPMI_FORMAT=""
    fi
    # Aquire lock with flock in order to avoid multiple runs of ipmi-sensors
    # in case of parallel or overlapping calls of the agent.
    (
        flock -n 200 --wait 60
        # At least with ipmi-sensoirs 0.7.16 this group is Power_Unit instead of "Power Unit"
        for class in Temperature Power_Unit Fan
        do
            $WAITMAX ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache -g "$class" | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@ \2_\1@'
            # In case of a timeout immediately leave loop.
        if [ $? = 255 ] ; then break ; fi
            WAITMAX="waitmax 3"
        done
    ) 200>>"$sdrcache"
fi