How do i disable messenger on the iMac but not my MacBook/iPhone
Assuming you mean the Messages app, all you need to do is sign out of it on the iMac.

To do this:


Launch the Messages app on the iMac
Go to Messages menu > Preferences
Select the Accounts icon
Click on your account (in the left-hand column)
Click on the Sign Out button (on the right-hand side)


When you exit the Messages app it will no longer receive your messages.