Mike Gerwitz
9c7961bb5c
This introduces the beginning of a very basic library for generating Prometheus metrics with GNU Awk. It is not intended to be complete, and it'll evolve as I need it to. At the moment, there are no tests, because manual verification is trivial and I'm not yet sure how far I'll be going with this. If it evolves much further, though, I'll be adding a test suite. |
||
---|---|---|
.. | ||
README.md | ||
ink.awk | ||
metrics | ||
usage.awk |
README.md
Epson ET-2720 Metrics
The Epson ET-2720 is a tank printer. It has a web interface that can be used to review printer status. The relevant sections do not require authentication.
This script produces the following metrics:
printer_pages_count
with the number of pages for copies, scans, printing, and internal operations (like diagnostic pages);printer_ink_level
for CYMK ink tank levels;printer_scrape_time_seconds
for the timestamp of the last scrape; andprinter_scrape_duration_seconds
for the number of seconds spent scraping (yes, sorry, this is an integer value and will likely be0
most of the time).
How To Use
Simply provide the URL to the web interface:
# Generate metrics
$ ./metrics URL > et-2720.$$
# Atomic move to avoid Prometheus reading incomplete writes
$ mv et-2720.$$ et-2720.prom