403Webshell
Server IP : 198.38.94.67  /  Your IP : 216.73.217.178
Web Server : LiteSpeed
System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
User : azfilmst ( 1070)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/thread-self/root/usr/lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/usr/lib64/nagios/plugins/check_a2_omni_pxe_https_check.sh
#!/bin/bash
#
# Jira: SYSENG-24777
#
# A script with a basic HTTPS check that runs on omni server and checks each of the PXE servers if they're working properly
#

_pxe_servers="omni-pxe-sf omni-pxe-az omni-pxe-nl omni-pxe-sg"
icinga_out="/tmp/pxe_check_out.txt"

for _pxe in ${_pxe_servers}; do
  _output=$(curl --connect-timeout 5 --max-time 5 -sX POST https://"${_pxe}".a2hosting.com/create -H 'Content-Type: application/json' -d '{"filename": "xx-xx-xx-xx-xx-xx", "uri": "http://mirror.a2hosting.com", "kernel": "/almalinux8/vmlinuz", "initrd": "/almalinux8/initrd.img", "method": "/almalinux/8/BaseOS/x86_64/kickstart/", "ks": "https://omni-prov.a2hosting.com//almalinux8/bmd/man.ks", "pxetemplate": "TEMPLATE", "token": "token-token-token-token", "host_id": "9999", "omni_host": "omni.a2hosting.com"}' | jq -r .success)

  if [[ "${_output}" == 1 ]]; then
    echo "${_pxe} - PXE server (HTTPS) is working properly"
  else
    echo "${_pxe} - PXE server (HTTPS) is NOT working!"
    
  fi
done > ${icinga_out}

if grep -q  "NOT working" ${icinga_out}; then
  echo "check_a2_omni_pxe_https_check - $(grep "NOT working" ${icinga_out} | sed ':a;N;$!ba;s/\n/ | /g')"
  exit 2
else 
  echo "check_a2_omni_pxe_https_check - $(grep "is working" ${icinga_out} | sed ':a;N;$!ba;s/\n/ | /g')"
  exit 0
fi

Youez - 2016 - github.com/yon3zu
LinuXploit