FreeDSx / SNMP

A Pure PHP SNMP Library.
MIT License
57 stars 13 forks source link

What is the purpose of 1.3.6.1.2.1 #4

Closed simPod closed 2 years ago

simPod commented 5 years ago

I have gone exploring internals of this lib. I'd like to ask about this line

$this->startAt = $startAt ?? '1.3.6.1.2.1';

Shouldn't it rather throw exception when no startAt is provided? Or just type string $startAt? I don't get the reason for default '1.3.6.1.2.1'. Thanks!

ChadSikorra commented 5 years ago

Yeah, I remember thinking about that too when I was looking back through this. I agree, the constructor should probably just be string $startAt = '1.3.6.1.2.1'. If you submit a PR with that I'd merge it. Not sure if any specs need to be changed. Otherwise I could probably take care of it over the weekend.

simPod commented 5 years ago

I have some changes ready here. Will try to somehow get it into reasonable PRs.

ChadSikorra commented 2 years ago

Closing this out. That oid is a default that the standard snmpwalk cli suggests when none is provided. Seems OK to keep that IMO. Someone using this should be aware to provide their own value. It's also documented here:

https://github.com/FreeDSx/SNMP/blob/master/docs/Client/SNMP-Walk.md#startat