HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/thread-self/root/usr/lib64/nagios/plugins/check_monarx
#!/bin/bash

if ! command -v monarx-agent >/dev/null 2>&1; then
  echo "UNKNOWN: Monarx is not installed on this server."
  exit 3
fi

monarx_active=$(service monarx-agent status 2>/dev/null | awk '/Active: active \(running\)/ {print $2,$3}')

if [[ "$monarx_active" == "active (running)" ]]; then
  echo "OK: Monarx is running."
  exit 0
else
  echo "CRITICAL: Monarx is not running on this server."
  exit 2
fi