I use custom pollers regularly with Advanced alerts and they work great using the following method.
If you are trying to create an alert based on the output value of your undp(let's say '1' or 'idle').One of the ways you can build the trigger is as follows. Note: below is an example of one of my own trigger.
"trigger alert when all of the following apply
MIB is equal to ISDN-MIB:isdnBearerOperStaus
Rate is equal to 4"
Where the rate is the value returned from the device when it is polled on the specified OID.
If this is not what you're looking for or it doesn't work for you let me know