prtmib — SNMPv2c printer marker dump

  prtmib [-v]

One UDP GET per host listed in config.h. Prints a dense table of
the values the device actually returned. No JSON, no daemon, no
layout flags. Filter with grep(1).

Columns

  idx     index in the printers[] table (config.h)
  host    FQDN with trailing .obspm.fr stripped
  ms      round trip, milliseconds
  err     SNMP error-status (0 = noError); RFC 1905 names with -v
  up      sysUpTime as days+hours+minutes
  hrDev   hrDeviceStatus
  hrPrt   hrPrinterStatus
  eflags  hrPrinterDetectedErrorState bits that are set
  pages   prtMarkerLifeCount, else kmLifeCount, else xrxImpressions
  toner   Y/M/C/K percent, letters taken from
          prtMarkerSuppliesDescription (not slot index). Order
          matches Konica PageScope (Yellow, Magenta, Cyan, Black).
          F_XRX is a tag only. Else Konica enterprise OIDs.
          '*' = <= LOWPCT, '!' = <= CRITPCT
  src     which mapping filled toner: std | xrx | km | -
  model   sysDescr up to ';' (Xerox firmware blob stripped),
          trailing " vN" dropped, then truncated

-v also prints every varbind (OID, MIB name, BER tag, value) and a
short packet trace.

Exit status

  0  every host answered a parseable GetResponse
  1  at least one DNS failure, timeout, or bad PDU
  2  usage

Build

  Windows (MinGW, default config.mk):
    make
    make install

  as(1) and ld(1) must be the MinGW ones; config.mk prepends
  MINGWBIN to PATH so a stock prompt is enough.

  Linux: edit config.mk (comment the Windows block, uncomment Linux),
    then make && make install. `RM = rm -f` on Unix.

  Install path (override with PREFIX=...):
    Windows: %USERPROFILE%\.local\bin  (add to PATH if it is not)
    Linux:   /usr/local/bin            (often needs sudo)
    make uninstall removes the binary.

  Hosts, community, timeouts, thresholds: config.h. Recompile.

Protocol

  SNMPv2c GET, UDP/161. One PDU per host carrying sysDescr, sysName,
  sysUpTime, hrDeviceStatus, hrPrinterStatus,
  hrPrinterDetectedErrorState, prtMarkerLifeCount, supplies
  description/max/level 1-4, Konica 18334 page+toner OIDs, Xerox 253
  impressions. Missing objects arrive as noSuchObject / noSuchInstance.

  Standard supply indices are CMYK. Konica enterprise indices are KCMY.
  Supply -1/-2/-3 (other/unknown/some) are not treated as percentages.
