# Use Ruby to monitor a printer?

**URL:** <https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272>\
**Category:** Ruby\
**Created:** [March 27, 2007, 9:55am UTC](https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272 "2007-03-27T09:55:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ak756](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@ak756](https://www.ruby-forum.com/u/ak756)\
**Post date:** [March 27, 2007, 9:55am UTC](https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272/1 "2007-03-27T09:55:46Z")

</div>

Hi,everyone!  
I want to write a program to monitor a network printer and give  
statistic data as whom at what time print how many pages.

Is it possible to do this using Ruby? Which library shall I use to do  
this?

---

<div class="post-metadata">

**Author:** ![ak756](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@ak756](https://www.ruby-forum.com/u/ak756)\
**Post date:** [March 27, 2007, 11:30am UTC](https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272/2 "2007-03-27T11:30:54Z")

</div>

On 27.03.2007 09:55, Ak 756 wrote:

> I want to write a program to monitor a network printer and give  
> statistic data as whom at what time print how many pages.
> 
> Is it possible to do this using Ruby? Which library shall I use to do  
> this?

What interface does the printer support? Generally Ruby comes with a  
whole bunch of networking support libraries. It really depends on what  
your printer offers.

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![ak756](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@ak756](https://www.ruby-forum.com/u/ak756)\
**Post date:** [March 27, 2007, 11:43am UTC](https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272/3 "2007-03-27T11:43:55Z")

</div>

On 3/27/07, Robert K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 27.03.2007 09:55, Ak 756 wrote:
> 
> > I want to write a program to monitor a network printer and give  
> > statistic data as whom at what time print how many pages.
> > 
> > Is it possible to do this using Ruby? Which library shall I use to do  
> > this?
> 
> What interface does the printer support? Generally Ruby comes with a  
> whole bunch of networking support libraries. It really depends on what  
> your printer offers.

The best library for monitoring printers is SNMP. All major  
manufacturers  
will support it. There is a ruby-SNMP project, but it leans a lot on  
C libraries for basic support of the protocol (like using your printer  
manufacturers MIB file).

Alternatively you could scrape the Web UI of the printer, there must be  
at least 6 different Ruby libraries for doing this now.

---

<div class="post-metadata">

**Author:** ![ak756](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@ak756](https://www.ruby-forum.com/u/ak756)\
**Post date:** [March 27, 2007, 11:39am UTC](https://www.ruby-forum.com/t/use-ruby-to-monitor-a-printer/90272/4 "2007-03-27T11:39:26Z")

</div>

Robert K. wrote:

> On 27.03.2007 09:55, Ak 756 wrote:
> 
> > I want to write a program to monitor a network printer and give  
> > statistic data as whom at what time print how many pages.
> > 
> > Is it possible to do this using Ruby? Which library shall I use to do  
> > this?
> 
> What interface does the printer support? Generally Ruby comes with a  
> whole bunch of networking support libraries. It really depends on what  
> your printer offers.
> 
> Kind regards
> 
> robert

The printer is connected in a Windows2000 server. All the computers in  
the local network can reach the printer. The printer is HP LaserJet  
1000. I don’t know what interface it support. Shall I interface directly  
with the printer or through the Win2000 server?
