Currently, research in normative multi-agent systems focus on how a visitor or new agent detects and updates its host norms autonomously without being explicitly given by the host system. In this paper, we present our proposed algorithm to detect the obligation and prohibition norms which we called the Obligation and Prohibition Norms Mining algorithm (OPNM). The algorithm exploits the resources of the host system, implements data formatting, filtering, and extracting the exceptional events, i.e. those that entail rewards and penalties of the obligation and prohibition norms and identifies the ensuing normative protocol. In this work, we assume that an agent is aware of its environment and is able to reason about its surrounding events. We then demonstrate the operation of the algorithm by applying it on a typical scenario and analyzing the results.