Remove agent verification and installation scripts.

This commit is contained in:
Haitao Pan 2026-02-01 23:39:10 +08:00
parent 4129a6fed1
commit 6cbae55c8a
3 changed files with 1 additions and 137 deletions

View File

@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@ -1,69 +0,0 @@
#!/bin/bash
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m'
log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
log_fail() { echo -e "${RED}[FAIL]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_info() { echo -e "${NC}[INFO] $1"; }
echo "---------------------------------------------------"
echo " Verifying Observability Agent Installation"
echo "---------------------------------------------------"
# 1. Check Systemd Services
check_service() {
local service=$1
if systemctl is-active --quiet "$service"; then
log_success "Service '$service' is running"
else
log_fail "Service '$service' is NOT running"
systemctl status "$service" --no-pager | head -n 10
fi
}
log_info "Checking Services..."
check_service "node_exporter"
check_service "process_exporter"
check_service "vector"
# 2. Check Ports
check_port() {
local port=$1
local name=$2
if ss -tulnA | grep -q ":$port "; then
log_success "Port $port ($name) is listening"
else
log_fail "Port $port ($name) is NOT listening"
fi
}
echo ""
log_info "Checking Ports..."
check_port 9100 "Node Exporter"
check_port 9256 "Process Exporter"
# 3. Check Vector Connectivity / Logs
echo ""
log_info "Checking Vector Logs (Last 10 lines)..."
# Check for errors in the last few logs
if journalctl -u vector -n 20 --no-pager | grep -iE "error|fail"; then
log_warn "Possible errors found in Vector logs:"
journalctl -u vector -n 20 --no-pager | grep -iE "error|fail"
else
log_success "No recent errors found in Vector logs."
fi
echo ""
log_info "Vector Status Summary:"
journalctl -u vector -n 5 --no-pager
echo ""
echo "---------------------------------------------------"
echo " Verification Complete."
echo " If all services are OK, data should appear in your infrastructure dashboard."
echo "---------------------------------------------------"

View File

@ -1,67 +0,0 @@
#!/bin/bash
#==============================================================#
# File : install.sh
# Mtime : 2026-02-01
# Desc : Install observability.svc.plus
# Usage : curl ... | bash -s <VERSION> <DOMAIN>
#==============================================================#
# Default parameters
VERSION="${1:-main}"
DOMAIN="${2:-$(hostname)}"
REPO_URL="https://github.com/cloud-neutral-toolkit/observability.svc.plus.git"
INSTALL_DIR="${HOME}/pigsty"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}Installing observability.svc.plus...${NC}"
echo -e "${BLUE}Version : ${VERSION}${NC}"
echo -e "${BLUE}Domain : ${DOMAIN}${NC}"
echo -e "${BLUE}Repo : ${REPO_URL}${NC}"
echo -e "${BLUE}Dir : ${INSTALL_DIR}${NC}"
# Check for git
if ! command -v git &> /dev/null; then
echo -e "${RED}Error: git is not installed.${NC}"
echo "Please install git first (yum install git / apt install git)"
exit 1
fi
# Clone or Update
if [ -d "${INSTALL_DIR}" ]; then
echo -e "${BLUE}Directory ${INSTALL_DIR} already exists.${NC}"
read -p "Overwrite? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf "${INSTALL_DIR}"
git clone -b "${VERSION}" "${REPO_URL}" "${INSTALL_DIR}"
else
echo -e "${BLUE}Updating existing repo...${NC}"
cd "${INSTALL_DIR}"
git fetch origin
git checkout "${VERSION}" || echo -e "${RED}Version ${VERSION} not found${NC}"
git pull origin "${VERSION}"
fi
else
git clone -b "${VERSION}" "${REPO_URL}" "${INSTALL_DIR}"
fi
cd "${INSTALL_DIR}"
# Run Bootstrap
if [ -f "./bootstrap" ]; then
echo -e "${BLUE}Running bootstrap...${NC}"
./bootstrap
else
echo -e "${RED}bootstrap script not found!${NC}"
fi
echo -e "${GREEN}Installation successful!${NC}"
echo -e "Next steps:"
echo -e " cd ${INSTALL_DIR}"
echo -e " ./configure # Generate config"
echo -e " ./deploy.yml # Install"