Limiting the amount of performance data on Thola check interface-metrics

Disclaimer: I am aware of the fact that the thola project seems to be not actively maintained, but the achievable results speak for themselves (compared to the effort setting it up).

When running thola-client check interface-metrics on a switch I get back about 1.000 performance data metrics - most of them I don’t care about.
Normally I would look for a way to limit the output in the check plugin (will do that eventually by looking at the thola code). For a quick fix I was thinking of piping the output to SED and delete most of the strings I’m not interested in.

Is there a proper way to do that in Icinga or do I have to wrap that in a script which I can then excute as a command?

I don’t see any chance to let icinga do this job, hence, it could be done before or after. The latter means cleaning from the performance data which might be challenging. Hence, I’d chose a wrapping script.

1 Like

Thanks for the response. That’s what I did :slight_smile: Just wanted to know if I was missing something obvious…

For the record, this is what I currently use:

#!/bin/sh

THOLA=$(realpath $0).bin

if [ $# -gt 2 ] ; then
        if [ "$2" = "interface-metrics" ] ; then
                $THOLA $@ | sed -E "s/'\S*(maxspeed|admin_status|oper_status|packet_count)\S+ ?//g;s/ \S+=0c?//g"
                exit 0
        fi
fi

$THOLA $@

I don’t know thola, but I’d assume it returns warning and critical (in case of an issue) and your script ignore them. You’d need to take care about the return code in case you want to handover the state to icinga.