Page 1 of 1

Alert on Cluster Status

Posted: Tue May 07, 2019 10:42 am
by DoIT-Systems
Sorry if this has been asked and answered, but I couldn't find anything in a search.

Is it possible to alert on the status of the cluster?

We recently had our system hit a critical state and didn't know about it until we needed logs that weren't being collected.

I'd like to have an alert sent out via email when the cluster status is yellow or red if it all possible.

Re: Alert on Cluster Status

Posted: Wed May 08, 2019 10:42 am
by scottwilkerson
This cannot be done from within Log Server.

Are you also using Nagios XI or Core for monitoring?

You could create a plugin for XI or Core that did the following (replacing SERVER_ADDRESS and APIKEY:

Code: Select all

#!/bin/bash

status=$(curl --silent "http://SERVER_ADDRESS/nagioslogserver/api/backend/_cat/health?v&token=APIKEY"|tail -1 |awk '{ print $4 }')
echo "Status is $status"
if [ "$status" == "green" ]; then
    exit 0
else
    exit 2
fi