I’m afraid I cannot help you. I don’t use Nagios plugins.
But I wonder why you do not put those complicated, overly long and unmaintainable
sh -c snmpwalk...|awk …; awk …; if … then … else …; awk …
commands into a script, put that script below ~/local/lib/nagios/plugins
and then just call the script from your rule. That’s far easier plus you can call the script from the command line to check if it works properly.
I also wonder why there is a hardcoded IP address in the rule instead of the variables $HOSTNAME$ or $HOSTADDRESS$. If the rule matches multiple MODEMs in your folder Ulu… then they will all query the exact same IP address via snmpwalk. I’m not sure if that is intended but I do not know your environment, so maybe it’s right.