Path : /proc/2/root/var/lib/zabbix/ |
Current File : //proc/2/root/var/lib/zabbix/check_log_timestamp.sh |
#!/usr/bin/env bash current_time=$(date +%s) DBHOST="$1" DBUSER="$2" DBPASSWORD="$3" HOSTNAME="$4" timestamp=$(mysql -u $DBUSER -p$DBPASSWORD -h $DBHOST -e "select timestamp from Logrhytm_stats.LastSeen where hostname='$HOSTNAME';" | tail -1) if [ -z "$timestamp" ] then exit else difference=$((current_time - timestamp)) echo $difference fi