ClusterLabs / ClusterLabs/anvil

striker script for services check on cluster

Open
#913 0 comments 0 reactions 0 assignees View on GitHub
priority low
Dominant language
Perl
Stars
7
Forks
6
PR merge metrics
No merged PRs in 30d

Description

striker-check-service
this can be used in order to test different services and can be further modified to even check more services either on striker and node.

#!/bin/bash

# Color definitions
GREEN="\e[32m"
YELLOW="\e[33m"
RED="\e[31m"
RESET="\e[0m"

echo -e "${YELLOW}Checking striker-ui-api service on local machine...${RESET}"

# Check local striker-ui-api
if systemctl is-active --quiet striker-ui-api; then
echo -e "${GREEN}✅ striker-ui-api is running locally.${RESET}"
else
echo -e "${RED}❌ striker-ui-api is NOT running locally.${RESET}"
fi

echo "=================================================="
read -p "Enter hostname or IP of customer node: " NODE

echo -e "\nConnecting to ${NODE}..."
echo "=================================================="

# Check if the remote node is reachable
if ! ping -c 1 -W 2 "$NODE" &>/dev/null; then
echo -e "${RED}❌ Unable to reach ${NODE}. Please check if the system is powered on or if there is a network issue.${RESET}"
exit 1
fi

# Remote PCS status
echo -e "\n${YELLOW}=== PCS Cluster Status ===${RESET}"
ssh -tt root@"$NODE" '
if command -v pcs >/dev/null; then
TERM=xterm pcs status
else
echo "pcs command not found"
fi
' 2>/dev/null

# Remote disk usage
echo -e "\n${YELLOW}=== Disk Usage (df -h) ===${RESET}"
ssh root@"$NODE" 'df -h --output=source,size,used,avail,pcent,target' 2>/dev/null

# Anvil daemon statuses (simplified output)
echo -e "\n${YELLOW}=== Status of important services at host ${NODE} ===${RESET}"
ssh root@"$NODE" '
for service in anvil-daemon scancore anvil-safe-start; do
if systemctl is-active --quiet "$service"; then
echo -e "\e[32m✅ $service is running\e[0m"
else
echo -e "\e[31m❌ $service is NOT running\e[0m"
fi
done
' 2>/dev/null

# Virtual machine status
echo -e "\n${YELLOW}=== Virtual Machines (virsh list --all) ===${RESET}"
ssh root@"$NODE" '
if command -v virsh >/dev/null; then
virsh list --all
else
echo "virsh command not found"
fi
' 2>/dev/null

[Striker-check-service.txt](https://github.com/user-attachments/files/20415666/Striker-check-service.txt)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided striker-check-service script and inspect the repository for existing service-check or administrative scripts. Confirm where this script should live and how similar scripts are invoked, then test its local and SSH-based checks for pcs, disk usage, Anvil services, and virsh on a striker and customer node. Done means the script is placed according to project conventions and reliably reports those statuses.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli, devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.