Alert on Cluster Status

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
DoIT-Systems
Posts: 2
Joined: Tue May 07, 2019 10:35 am

Alert on Cluster Status

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Alert on Cluster Status

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked