'Monitoring of cartridge level in printers
I am trying to create a cartridge monitoring system for printers using SNMP printers MIB on AggreGate platform. I am a newbie to AggreGate and I am having trouble to create a model with a variable. What am I doing wrong and where is my mistake?
adjustRecordLimits(
sort( subtable(
filter( addColumns(
callFunction(
"",
"executeQuery",
"Select data.context_id as Printer, data.prtMarkerSuppliesTable$hrdevicedescr as Description, data.prtMarkerSuppliesTable$prtmarkersuppliesmaxcapacity as MaxCapacity, "<usage><I><F=N>","{maxcapacity} > 0 ? round({level}/{maxcapacity} * 100):null"),
"printer","description","maxcapacity","level"),
"usage",true), 0,20)
Solution 1:[1]
To monitor cartridges level we use SNMP printers MIB. We can create a model with a variable. In this variable, we put the result of the binding. This binding will show us 20 cartridges with the lowest cartridge level. All printers must be in one device group for this expression. The group name is marked with a red color.
adjustRecordLimits(
sort(
suitable(
filter(
addColumns(
callFunction(
"",
"executeQuery",
"Select data.context_id as Printer, data.prtMarkerSuppliesTable$hrdevicedescr as Description, data.prtMarkerSuppliesTable$prtmarkersuppliesmaxcapacity as MaxCapacity,
data.prtMarkerSuppliesTable$prtmarkersupplieslevel as Level from users.admin.devgroups.printerGroup.*:prtMarkerSuppliesTable as data"),
"<F=N>","{maxcapacity} > 0 ? round({level}/{maxcapacity} * 100):null"),
"{usage}!=null"),
"printer", "description","usage","maxcapacity","level"),
"usage",true),
0,20)
In attachments, you will see screenshots and model prs file (ver.5.61.04). Also, you can see the result in the screenshot.

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

