InfotelGLPI / printercounters

Plugin Printercounters for GLPI
http://blogglpi.infotel.com
GNU General Public License v2.0
14 stars 9 forks source link

It's possible to add a lower position counter through CRON #78

Open eduardomozart opened 3 years ago

eduardomozart commented 3 years ago

The specification documentation has a diagram that shows the error management of the plug-in - https://forge.glpi-project.org/projects/glpi/wiki/SNMP_printer_counters#27-Gestion-des-erreurs

It states that, if the Counter < Last record, the Counter isn't added, but it's possible when adding it through the CRON script.

E.g. The following screenshot:

2020-11-20 19_30_00-Window

  1. This is an intentionaly added "Manual" record with a higher value than the last ones.
  2. The second is an attempt to add a "Manual" record with a lower value than the last one (it fails, as it should).
  3. The third is the result of the CRON script: it adds the record even if it's lower than the last one.

The third result should return an "Record error" instead of "Success".

The record is written into the database.

/plugins/printercounters/scripts/run.php * Screenshot of the problem (if pertinent) :