Checking for shared printer on network...

Does anyone know a way to ping a machine on a certain IP number on a local network to check if it’s actively sharing its printer…?
This functionality is in OSX, is shared printers do appear in Print dialogs.
TCP ports 631,515 seem to handle communications.