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

How used other MIBs #9

Open
nfast opened this issue Dec 2, 2020 · 4 comments
Open

How used other MIBs #9

nfast opened this issue Dec 2, 2020 · 4 comments

Comments

@nfast
Copy link

nfast commented Dec 2, 2020

please ask me, where is mibs data ? i have add my mibs.
My MIBs location /usr/share/snmp/mibs, but laravel not see.

@ChadSikorra
Copy link
Contributor

Hi @nfast. Unfortunately this library doesn't really have a concept of MIBs. The main reason is that there is no PHP library capable of parsing the SMI-v2 format (which is the format a MIB is in). The SMI format is basically a subset of the X.681 spec, which is essentially a very complex syntax for describing data structures. It doesn't surprise me that such a parser doesn't exist in PHP because it's use is very limited outside of a few protocols / niche cases nowadays, and implementing the spec correctly is a huge undertaking. (Spec can be found here: https://www.itu.int/ITU-T/studygroups/com17/languages/X.681-0207.pdf).

That said, I did attempt to implement a pure PHP based MIB parser and made it quite far. But I just haven't had the time to finish it. I'd like to pick up my work again. I'm just not sure when I'll be able to.

@JeroenSteen
Copy link

I'm trying to get Xerox printer health values, like amount of toner-percentage of a certain color. And I'm also looking for those MIB files.

Snmp is new for me, but reading a MIB can be done with: snmp_read_mib and snmprealwalk right?

@ChadSikorra
Copy link
Contributor

I'm trying to get Xerox printer health values, like amount of toner-percentage of a certain color. And I'm also looking for those MIB files.

Snmp is new for me, but reading a MIB can be done with: snmp_read_mib and snmprealwalk right?

Yes, you could use the SNMP extension instead if you have it available. This library just implements the raw SNMP protocol, without any dependencies / the need for an extension. As such, I don't want to introduce a requirement for it.

I mostly started this as a fun project in my free time. But there are advantages to this library. Such as, there's no way to receive traps and parse them using the PHP SNMP extension, like you can with this library.

Regarding the Xerox printer health status, it looks like you'd want to read / interpret this OID for it:

OID: 1.3.6.1.2.1.25.3.5.1.2
Reference: https://oidref.com/1.3.6.1.2.1.25.3.5.1.2

It looks like the value uses a series on / off bits to represent different statuses for various printer parts.

@JeroenSteen
Copy link

With your SNMP-library I found these OID's indeed, but those don't give percentages or such. That's why I think I need a MIB file.

1.3.6.1.2.1.43.11.1.1.6.1.5 = Waste Toner Container
1.3.6.1.2.1.43.11.1.1.6.1.6 = Black Drum Cartridge
1.3.6.1.2.1.43.11.1.1.6.1.7 = Yellow Drum Cartridge
1.3.6.1.2.1.43.11.1.1.6.1.8 = Magenta Drum Cartridge
1.3.6.1.2.1.43.11.1.1.6.1.9 = Cyan Drum Cartridge
1.3.6.1.2.1.43.11.1.1.6.1.12 = Fuser Assembly

Do you think it's possible without a MIB, to check for example if a printer door is open, with doorOpen?
Does it work something like this 1.3.6.1.2.1.25.3.5.1.2 adding the .4, to make 1.3.6.1.2.1.25.3.5.1.2.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants