hp-toolbox uses HTTP to fetch toner levels:
Printer has SNMP activated, and we can fetch the toner status:
$ snmpwalk -c public -v 1 -On 192.168.3.98 .1.3.6.1.2.1.43.11.1.1.8.1.1 = INTEGER: 590 .1.3.6.1.2.1.43.11.1.1.8.1.2 = INTEGER: 470 .1.3.6.1.2.1.43.11.1.1.8.1.3 = INTEGER: 470 .1.3.6.1.2.1.43.11.1.1.8.1.4 = INTEGER: 470 .1.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: 45 .1.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: 0 .1.3.6.1.2.1.43.11.1.1.9.1.3 = INTEGER: 85 .1.3.6.1.2.1.43.11.1.1.9.1.4 = INTEGER: 57
With readable names (from Printer-MIB that I got by executing "download-mibs"):
$ snmpwalk -c public -v 1 -m Printer-MIB 192.168.3.98 Printer-MIB::prtMarkerSuppliesDescription.1.1 = STRING: "Black Cartridge HP Q6000A" Printer-MIB::prtMarkerSuppliesDescription.1.2 = STRING: "Cyan Cartridge HP Q6001A" Printer-MIB::prtMarkerSuppliesDescription.1.3 = STRING: "Magenta Cartridge HP Q6003A" Printer-MIB::prtMarkerSuppliesDescription.1.4 = STRING: "Yellow Cartridge HP Q6002A" Printer-MIB::prtMarkerSuppliesSupplyUnit.1.1 = INTEGER: tenthsOfGrams(13) Printer-MIB::prtMarkerSuppliesSupplyUnit.1.2 = INTEGER: tenthsOfGrams(13) Printer-MIB::prtMarkerSuppliesSupplyUnit.1.3 = INTEGER: tenthsOfGrams(13) Printer-MIB::prtMarkerSuppliesSupplyUnit.1.4 = INTEGER: tenthsOfGrams(13) Printer-MIB::prtMarkerSuppliesMaxCapacity.1.1 = INTEGER: 590 Printer-MIB::prtMarkerSuppliesMaxCapacity.1.2 = INTEGER: 470 Printer-MIB::prtMarkerSuppliesMaxCapacity.1.3 = INTEGER: 470 Printer-MIB::prtMarkerSuppliesMaxCapacity.1.4 = INTEGER: 470 Printer-MIB::prtMarkerSuppliesLevel.1.1 = INTEGER: 45 Printer-MIB::prtMarkerSuppliesLevel.1.2 = INTEGER: 0 Printer-MIB::prtMarkerSuppliesLevel.1.3 = INTEGER: 85 Printer-MIB::prtMarkerSuppliesLevel.1.4 = INTEGER: 57 Printer-MIB::prtMarkerColorantValue.1.1 = STRING: "black" Printer-MIB::prtMarkerColorantValue.1.2 = STRING: "cyan" Printer-MIB::prtMarkerColorantValue.1.3 = STRING: "magenta" Printer-MIB::prtMarkerColorantValue.1.4 = STRING: "yellow"
Still CUPS does not show the ink level, only says that the printer does not provide information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | <?xml version="1.0" encoding="UTF-8" ?> <DeviceStatusPage xmlns="http://www.hp.com/schemas/imaging/pls/dev/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/pls/dev/1.0 DeviceStatusPage.xsd"> <DeviceStatus> <StatusList> <Status> <Priority>1</Priority> <Code>-19928</Code> </Status> <Status> <Priority>2</Priority> <Code>-19752</Code> </Status> <Status> <Priority>3</Priority> <Code>0</Code> </Status> </StatusList> </DeviceStatus> <SuppliesStatus> <BlackSupply> <Status>0</Status> <PercentRemaining>8</PercentRemaining> <PagesRemaining>66</PagesRemaining> </BlackSupply> <CyanSupply> <Status>6</Status> <CartridgeOutOverrideActive>0</CartridgeOutOverrideActive> </CyanSupply> <MagentaSupply> <Status>0</Status> <PercentRemaining>18</PercentRemaining> <PagesRemaining>152</PagesRemaining> </MagentaSupply> <YellowSupply> <Status>0</Status> <PercentRemaining>12</PercentRemaining> <PagesRemaining>183</PagesRemaining> </YellowSupply> </SuppliesStatus> </DeviceStatusPage> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | <?xml version="1.0" encoding="UTF-8" ?> <SuppliesStatusPage xmlns="http://www.hp.com/schemas/imaging/pls/dev/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/pls/dev/1.0 SuppliesStatusPage.xsd"> <BlackSupply> <SuppliesStatus>0</SuppliesStatus> <PartNumber>Q6000A</PartNumber> <PercentRemaining>8</PercentRemaining> <PagesRemaining>66</PagesRemaining> <HistoricalCoverage>142</HistoricalCoverage> <LowReached>1</LowReached> <SerialNumber>2178876682</SerialNumber> <PageCount>809</PageCount> <InstallDate></InstallDate> <LastUseDate></LastUseDate> <Manufacture_Date>20140703</Manufacture_Date> <Capacity_Units>3</Capacity_Units> <Total_Capacity>25</Total_Capacity> </BlackSupply> <CyanSupply> <SuppliesStatus>6</SuppliesStatus> <PartNumber>Q6001A</PartNumber> <CartridgeOutOverrideActive>0</CartridgeOutOverrideActive> </CyanSupply> <MagentaSupply> <SuppliesStatus>0</SuppliesStatus> <PartNumber>Q6003A</PartNumber> <PercentRemaining>18</PercentRemaining> <PagesRemaining>152</PagesRemaining> <HistoricalCoverage>111</HistoricalCoverage> <LowReached>0</LowReached> <SerialNumber>2364474627</SerialNumber> <PageCount>734</PageCount> <InstallDate></InstallDate> <LastUseDate></LastUseDate> <Manufacture_Date>20061110</Manufacture_Date> <Capacity_Units>3</Capacity_Units> <Total_Capacity>20</Total_Capacity> </MagentaSupply> <YellowSupply> <SuppliesStatus>0</SuppliesStatus> <PartNumber>Q6002A</PartNumber> <PercentRemaining>12</PercentRemaining> <PagesRemaining>183</PagesRemaining> <HistoricalCoverage>64</HistoricalCoverage> <LowReached>0</LowReached> <SerialNumber>2230453519</SerialNumber> <PageCount>1355</PageCount> <InstallDate></InstallDate> <LastUseDate></LastUseDate> <Manufacture_Date>20061110</Manufacture_Date> <Capacity_Units>3</Capacity_Units> <Total_Capacity>20</Total_Capacity> </YellowSupply> </SuppliesStatusPage> |