Monitoring vcenter appliance

Hi experts, 

I try to monitor vcenter appliance (photon OS) , I already added it in remote linux server under Linux os and it gives me connection is successful but when I am trying to make detailed test, it returns with n/a for the commands that sitescope runs, when I open vcenter appliance, it doesn't enter me to shell environment directly so I should write shell before any command so I edited the linux.conf in templates.os and added shell before each command in this file but this doesn't work also so does anyone know way to monitor this server other than depending on vm discovered by esxi host monitor 

Thanks 

  • 0  

    I think the solution here could be switching the login users shell on VAppliance from the default Appliance Shell to Bash - can't try my self though Disappointed

    chsh -s /bin/bash login_user

    Although I am an OpenText employee, I am speaking for myself and not for OpenText.

  • Verified Answer

    +1   in reply to   

    Hello,

    Gret answer from Kumitikka using chsh.  

    OA12 doesn't have a PhotonOS agent type, but that doens't mean you cannot monitor it.  You can with SiS and indirectly with OA12...

    When used in a Kubernetes environment with VMware Tanzu, you can use tanzu-cli. You also have Docker and Kuberneties APIs. Of most interest is that openSSH can also be used to manage the system, since there is no OA12 agents support for PhotonOS. You cna use SiteScope to manage PhotonOS via SSH, and you can also use OA12 to do the same. I don't think this would be too difficult.


    Operation Agent 12:
    I think examples are more useful in a situation like this. You can ssh from a system running OA12 onto the photonOS system and collect vital signs. You will need to assign and deply a opcmsg policy that matches these conditions. Such a script would look something like this:

    #!/bin/bash
    # Unsupported example script
    PHOTONOS_HOST="192.168.1.100"
    PHOTONOS_USER="myuser" # change use to use with permissions.
    SSH_KEY="/path/to/private/key" # you key that ssh uses

    # Set up some varaibles used later - configure to meet your needs:
    OPCMSG_CMD="/opt/OV/bin/opcmsg"
    APP_NAME="SystemHealth"
    OBJ_NAME="photonOS"
    SEVERITY="normal"

    # Run ssh and get some metrics:
    SYSTEM_METRICS=$(ssh -i "$SSH_KEY" "$PHOTONOS_USER@$PHOTONOS_HOST" << 'EOF'
    CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2 + $4}')
    MEMORY=$(free -h | awk '/Mem:/ {print $3 "/" $2}')
    DISK=$(df -h / | awk '/\// {print $5}')
    UPTIME=$(uptime -p)

    echo "CPU=$CPU"
    echo "MEMORY=$MEMORY"
    echo "DISK=$DISK"
    echo "UPTIME=$UPTIME"
    EOF
    )

    # Get metrics from the output and mangle to make useful:
    CPU_USAGE=$(echo "$SYSTEM_METRICS" | grep "CPU=" | cut -d'=' -f2)
    MEMORY_USAGE=$(echo "$SYSTEM_METRICS" | grep "MEMORY=" | cut -d'=' -f2)
    DISK_USAGE=$(echo "$SYSTEM_METRICS" | grep "DISK=" | cut -d'=' -f2)
    UPTIME_INFO=$(echo "$SYSTEM_METRICS" | grep "UPTIME=" | cut -d'=' -f2)

    # Generate and send opcmsg events for each metric
    $OPCMSG_CMD a="$APP_NAME" o="$OBJ_NAME" msg_grp="System" severity="$SEVERITY" msg_text="CPU Usage: $CPU_USAGE%" -option hostname=$PHOTONOS_HOST
    $OPCMSG_CMD a="$APP_NAME" o="$OBJ_NAME" msg_grp="System" severity="$SEVERITY" msg_text="Memory Usage: $MEMORY_USAGE" -option hostname=$PHOTONOS_HOST
    $OPCMSG_CMD a="$APP_NAME" o="$OBJ_NAME" msg_grp="System" severity="$SEVERITY" msg_text="Disk Usage: $DISK_USAGE" -option hostname=$PHOTONOS_HOST
    $OPCMSG_CMD a="$APP_NAME" o="$OBJ_NAME" msg_grp="System" severity="$SEVERITY" msg_text="Uptime: $UPTIME_INFO" -option hostname=$PHOTONOS_HOST

    # You can also print this out to /path/to/somelogfile because it might be interesting...
    echo "$PHOTONOS_HOST CPU: $CPU_USAGE% Memory: $MEMORY_USAGE Disk: $DISK_USAGE Uptime: $UPTIME_INFO" >> /path/to/somelogfile


    Please see docs.microfocus.com/.../opcmsg for options. Or define thresholds in a monitor (e.g. opcmon memory=10 -option hostname=photonOS)


    Another option would be to send the events from the PhotonOS via a script running via cron to opcgeni running on an OA12 agent. This would need to run as a cron job on the PhotonOS system. This exmaple sends events. You could change this to use the REST metric policy type and store metrics which you then create monitors (e.g. opcmon) to monitor:

    #!/bin/bash
    # Unsupported sample script
    # Set your OA12 Monitoring API Endpoint
    OBM_API_URL="">OA12_agent:30005/.../mangePhotonOS"
    # See docs.microfocus.com/.../OmucptrestWebservicehtml
    # whic describes how to set up this policy on a running OA12 system.

    # Do some processing to get system vital signs - here is your chance to be creative :-):
    CPU_USAGE=$(top -bn1 | grep "Cpu(s)" | awk '{print $2 + $4}')
    MEMORY_USAGE=$(free -h | awk '/Mem:/ {print $3 " used of " $2}')
    DISK_USAGE=$(df -h / | awk '/\// {print $5}')
    UPTIME=$(uptime -p)

    # Combine vital signs into a single message
    MESSAGE="CPU Usage: ${CPU_USAGE}% | Memory Usage: ${MEMORY_USAGE} | Disk Usage: ${DISK_USAGE} | Uptime: ${UPTIME}"

    # Prepare JSON payload
    JSON_PAYLOAD=$(cat <<EOF
    {
    "application": "SystemHealth",
    "object": "PhotonOS",
    "severity": "Normal",
    "message_group": "System",
    "message_text": "$MESSAGE"
    }
    EOF
    )

    # Send the event using curl
    curl -X POST "$OBM_API_URL" \
    -H "Content-Type: application/json" \
    -d "$JSON_PAYLOAD"

    exit 0

    I've not either of these scripts, and they are not supported by Opentext. They are just to give you some ideas.

    Other options would be to use a webservice interface running on PhotonOS which you can query with curl.

    SiteScope:
    Finally, you can use SiS to do this: docs.microfocus.com/.../ConfigRemoteMonitoringSSH

    Almost too much choice :-)

    I hope you get a better answer.