Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 SNMP 从路由器获取数据。数据将用于我猜想使用 jquery 浮点数的图表。
但我的问题是我不知道如何让我的网页使用 SNMP 从路由器读取数据。
我通常使用 MRTG,但如果可能的话,我想学习如何手动编码。
BR。安德斯
用于phpinfo()检查您的服务器的 PHP 二进制文件是否使用 SNMP 支持构建。如果是这样,您可以这样做:
phpinfo()
<?php $snmp_values = snmpwalk("10.0.0.1", "public", null); print_r($snmp_values);
其中“10.0.0.1”是您路由器的 IP;这将为您提供路由器返回的 SNMP 值(不同的路由器返回不同的数据),您可以编写脚本来处理该数据。