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

**URL:** <https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986>\
**Category:** Service Monitoring\
**Created:** [August 13, 2024, 8:03pm UTC](https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986 "2024-08-13T20:03:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adn77](https://community.icinga.com/user_avatar/community.icinga.com/adn77/32/7028_2.png) [@adn77](https://community.icinga.com/u/adn77)\
**Post date:** [August 13, 2024, 8:03pm UTC](https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986/1 "2024-08-13T20:03:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [August 14, 2024, 8:18am UTC](https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986/2 "2024-08-14T08:18:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adn77](https://community.icinga.com/user_avatar/community.icinga.com/adn77/32/7028_2.png) [@adn77](https://community.icinga.com/u/adn77)\
**Post date:** [August 14, 2024, 8:22am UTC](https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986/3 "2024-08-14T08:22:26Z")

</div>

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

For the record, this is what I currently use:

```auto
#!/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 $@

```

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [August 14, 2024, 8:54am UTC](https://community.icinga.com/t/limiting-the-amount-of-performance-data-on-thola-check-interface-metrics/13986/4 "2024-08-14T08:54:21Z")

</div>

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.
