Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set "Status" on Network Printer object #829

Open
eduardomozart opened this issue Jan 21, 2025 · 1 comment
Open

Unable to set "Status" on Network Printer object #829

eduardomozart opened this issue Jan 21, 2025 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@eduardomozart
Copy link
Contributor

Bug reporting acknowledgment

Yes, I read it

Professional support

None

Describe the bug

Hello,
I'm using GLPI-Agent 1.11 and GLPI 10.0.17 (bugfixes branch).
The inventory.schema.json file doesn't seems to provide a way to set Network Printer status, the <STATUS></STATUS> tag seems available only for local printers (as seen here: https://github.com/glpi-project/glpi/blob/4d1548a14d405681b8a8a3289b804dfda1cb6a06/phpunit/functional/Glpi/Inventory/Assets/PrinterTest.php#L65) and not network (SNMP) printers and the glpi-injector fails with an validation violation error.
The network printer can provide it's status by the prtAlertEntry OID (.1.3.6.1.2.1.43.18.1.1.8.1.1.) so it would be possible to set the printer status and display it on Status dropdown of GLPI.

Image

On the snmpwalk attached below, my Brother HL-1210W printer reports it's status as "Sleep" (on hexadecimal) at .1.3.6.1.2.1.43.18.1.1.8.1.1 OID.

snmpwalk_brother_OID.txt
snmpwalk_brother.txt

To reproduce

  1. Attempt to set <STATUS></STATUS> tag on printer network (SNMP) object.

Expected behavior

Status should be available for Printer objects on Inventory schema.

Operating system

Windows

GLPI Agent version

v1.11

GLPI version

10.0.17

GLPIInventory plugin or other plugin version

GLPI Inventory v1.4.0

Additional context

Please let me know if anymore information are needed.

@eduardomozart eduardomozart added the bug Something isn't working label Jan 21, 2025
@eduardomozart eduardomozart changed the title Unable to set "Status" on Printer object Unable to set "Status" on Network Printer object Jan 21, 2025
@g-bougard g-bougard added enhancement New feature or request and removed bug Something isn't working labels Jan 21, 2025
@g-bougard
Copy link
Member

Hi @eduardomozart

Actually, it is defined in inventory_format project here: https://github.com/glpi-project/inventory_format/blob/0f4d697ab3a58135ed38320ab172aa2b1e2fc93d/inventory.schema.json#L1545
And this definition only concerns "computer" type.

Actually, in glpi-agent project, I only see it in printers inventory on windows:

STATUS => $status[$object->{PrinterStatus} // 0],

There's even an "ERRSTATUS" field which is probably just ignored in GLPI.
So I guess this "STATUS" field is an historical feature which may eventually even not work, but I didn't checked.

Today, adding such a feature would require an inventory_format update, a glpi update and glpi-agent update with a lot of work to not break anything.

I'm not against it. I just think it is not the right time to implement it. I think we can keep it for next major glpi-agent and glpi releases. As far I know, GLPI 11 will no more reject inventories on format not validated by "inventory_format" specs. This will permit to develop features involving glpi-agent format changes more easily. Indeed, we will be able to develop the change in glpi-agent before the glpi change as inventory_format will become informative by default.
Of course, if you have a GLPI subscription and want to get this feature sooner, don't hesitate to contact us on subscribers support to obtain a quote.

@g-bougard g-bougard added this to the 2.0 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants