It's the switch on the brake pedal and is a very common failure on E36s. It has a separate circuit for the OBC to indicate if the brake switch isn't working. Fairly easy to replace, but I found you have to destroy the original part to get it out of the bracket.
What's the exact message you get - if it is "brake circuit failure" then it's the pedal switch. If it is something else, then the fix is something else.