403Webshell
Server IP : 198.38.94.67  /  Your IP : 216.73.217.74
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 :  /lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/nagios/plugins/a2_sssd_service_check.sh.all
#!/bin/bash
# SYSENG-28030 - sssd monitoring

CHECK_NAME="sssd_service_check"
SSSD_CONF="/etc/sssd/sssd.conf"
SERVICE="sssd"

function check_service_status() {
  local service="$1"
  systemctl --quiet is-active "${service}" && IS_ACTIVE=true || IS_ACTIVE=false
  systemctl --quiet is-enabled "${service}" && IS_ENABLED=true || IS_ENABLED=false
  systemctl status "${service}" -l | tail -1 |grep -q "Backend is offline" && HAS_ERRORS=true || HAS_ERRORS=false
}

# skip unmanaged / cores
if ! grep -E -q '10\.10\.10\.10|10\.10\.10\.11' /etc/salt/minion; then
  echo "sssd not managed"
  exit 0
fi

# skip mvps and solus
if grep -E -q 'role: flexdedi$|role: mvps$' /etc/salt/minion; then
  echo "sssd not managed"
  exit 0
fi

# skip ldap LBers but keep it on internal roles
if grep -E -q '^ldap-lb' /etc/hostname; then
  echo "sssd not managed"
  exit 0
fi

if [[ ! -e "${SSSD_CONF}" ]]; then
  echo "${SSSD_CONF} not found"
  exit 2
fi

if ! grep -q "ipa_domain = a2noc.net" "${SSSD_CONF}"; then
  echo "unexpected ipa_domain value in ${SSSD_CONF}"
  exit 2
fi

check_service_status "${SERVICE}"

if "${HAS_ERRORS}"; then
  echo "backend is offline"
  exit 2
fi

if "${IS_ACTIVE}" && "${IS_ENABLED}"; then
  echo "is active and enabled"
  exit 0
elif "${IS_ACTIVE}"; then
  echo "is active but not enabled"
  exit 1
elif "${IS_ENABLED}"; then
  echo "is enabled but not active"
  exit 2
else
  echo "is not enabled or active"
  exit 2
fi

Youez - 2016 - github.com/yon3zu
LinuXploit