A page with a module, sample code for a trap, and a pointer to a printed text is
here. (BTW, the trap type in the example is "Link Down" which is probably the type you'll want to send...) You'll need a private MIB (1.3.6.1.4.1.x) and if you don't have an enterpriseID (I think that is the correct name) you can either fake it or register for one. In any case, the SNMP manager to whom you send your trap will have to know what to do with a trap from you. That means configuration at the SNMP manager.
HTH, --traveler