Good day. I'm trying to make print counters for printers - while I'm trying from HP. The indicator from which I can take data is only a counter that tells me how much the printer has printed, respectively, then everything is just formulas. For a week now, I've been puzzling over how to correctly write a formula for data for a day, week, month and year, for example. Through much work with the help of ChatGPT, I have so far come to two formulas max(//printer.total.printed.pages,1d) - min(//printer.total.printed.pages,1d) and the second one last(//a4total.device)-last(//a4total_1d.device,#1) printer.total.printed.pages in the first one is an indicator from the SNMP of all prints. a4total.device is the same thing, but a4total_1d.device also takes it from SNMP, but at the same time it works with the Scheduling parameter - wd1-7h0m00 - that is, it seems to work out at the right time. chatgpt, of course, alas, does not understand a lot - sometimes it offered something like a formula with delta - delta(//printer.total.printed.pages[1d]) - but here the syntax is incorrect and I do not know if it works in my case at all? Actually, the question is - what is the difference between my two formulas and whether they can actually do calculations at all? Or maybe there are other options? Thank you in advance for your help
Ad Widget
Collapse
Counters for printers
Collapse
X
-
max(,,1d)-min(,,1d) .. if that is evergrowing number, and you do that calculation in midnight, then you probably are going to get a number of prints per day, as smallest number was a day ago and it grew through the day ..
last() and last(,#1) are identical things.. so last(//a4total.device)-last(//a4total_1d.device,#1)... I guess it might do the similar calculation, if that a4total_1d contains number form 1d ago...
you can also use time shift in parameters.. last(/host/item)-last(/host/item,#1:now/d)
Last edited by cyber; 11-09-2024, 14:57. -
That is, as I understand it, in general, my formulas are identical and make the correct measurements?max(,,1d)-min(,,1d) .. if that is evergrowing number, and you do that calculation in midnight, then you probably are going to get a number of prints per day, as smallest number was a day ago and it grew through the day ..
last() and last(,#1) are identical things.. so last(//a4total.device)-last(//a4total_1d.device,#1)... I guess it might do the similar calculation, if that a4total_1d contains number form 1d ago...
you can also use time shift in parameters.. last(/host/item)-last(/host/item,#1:now/d)
https://www.zabbix.com/documentation...ion#time-shift
They can easily spread to the calculations of the month, half a year and a year - is there nothing to think about here?Comment
Where does money disappear and from where comes the dust...
Comment