Thanks for your fast response. Perhaps I am not making myself clear.
The ups_power snmp check only provides a simple check with a return like:
if power <= crit:
return (2, "CRIT" + infotext, perfdata)
elif power <= warn:
return (1, "WARN" + infotext, perfdata)
return (0, "OK" + infotext, perfdata)
Just plain text without any WATO intelligence whatsoever.
I already wrote SNMP checks like this. And I guess, I am able to follow the logic of the inventory and the check function. But I want a more complex return that looks like this in WATO:
My non-SNMP code for that looks like this:
print("P " + target + " TX=" + tx + ";" + tx_warn_lower + ":" + tx_warn_upper + ";" + tx_crit_lower + ":" + tx_crit_upper +
"|RX=" + rx + ";" + rx_warn_lower + ":" + rx_warn_upper + ";" + rx_crit_lower + ":" + rx_crit_upper)
The OK, WARN, CRIT alerts are generated dynamically based on the TX and RX variable. And WATO automatically generates a wonderful plot.
P.S.: I thought that this was an agent check, because I had to set the data source from the host in WATO to “Normal Checkmk agent”, activate an agent and deploy my python script in the right folder to make it work: