当我从源代码编译时,snmpd 没有响应

发布于 2024-11-25 07:47:30 字数 405 浏览 0 评论 0原文

我使用的操作系统:Fedora 15。

今天早上,我删除了系统上先前安装的 net-snmp rpm 软件包。然后,我从源代码编译并安装了 snmp。编译后的 snmpd 不响应任何 get 请求。

我通过执行以下命令安装了该软件包:

./.configure && make && make install

过了一会儿,完成后我发现安装成功了。

为了测试安装,我运行了一个 get 请求:

snmpget -v2c -c public 127.0.0.1 sysDescr.0

我觉得很奇怪,没有响应...... 我可能会错过什么?需要超级用户权限吗?

OS that I am using: Fedora 15.

Today morning, I removed net-snmp rpm package previously installed on my system. Then, I compiled and installed snmp from source. Compiled snmpd does not respond to any get requests.

I installed the package by executing these commands:

./.configure && make && make install

After a while it was done and I find the installation was successful.

For testing the installation I ran a get request:

snmpget -v2c -c public 127.0.0.1 sysDescr.0

Weird I feel, no response...
What could I be missing? a super-user privilege is required?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我ぃ本無心為│何有愛 2024-12-02 07:47:30

此外,从源安装需要执行几个步骤。

按照此处进行操作,

步骤 1:以 root 身份登录 (su - root)

步骤 2:导航到保存 net-snmp tar.gz 的主文件夹
在提示符下发出此命令

tar -zxvf net-snmp-5.5.tar.gz

(我仍然使用 v 5.5。根据您的版本更改此命令)

步骤 3:导航到未压缩的目录。

步骤 4:运行 ./configure

步骤 5:make

步骤 6:make install

步骤 7:现在 netsnmp 已安装并可以使用。

哈哈..不完全是..在我们可以说之前还有很多事情需要完成...是的..工作得很好..

第8步:导航到/usr/local/bin 查看该文件夹是否有一堆 snmp 内容,例如 snmpconf snmptranslate 等等...

第 9 步:还要查看 /usr/local/share/snmp/mibs< /code> 文件夹并查看如果所有 MIB 文件都存在..

第 10 步:如果在此之前一切正常,请尝试进行一些配置检查(否则重新开始)。
运行,

net-snmp-config --default-mibdirs

您必须获得输出

/root/.snmp/mibs:/usr/local/share/snmp/mibs

运行,

net-snmp-config --snmpconfpath

输出应类似于

/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/root/.snmp:/var/net-snmp

步骤 11:运行,

ldd /usr/local/bin/snmptranslate

输出将为:

linux-gate.so.1 =>  (0x00110000)
       libnetsnmpagent.so.15 => not found
       libnetsnmphelpers.so.15 => not found
       libnetsnmpmibs.so.15 => not found
       libnetsnmp.so.15 => not found

这意味着您可能会在加载共享库时收到 snmp*: 错误:
例如上面提到的 libnetsnmp.so.20:它无法打开共享对象文件。

如果没有出现上述错误,则无需执行任何操作,但如果出现错误,则必须执行以下步骤
编辑 /etc 中的 ld.so.conf 并添加 /usr/local/lib 的 lib 路径的详细信息,然后运行 ​​ldconfig

vi /etc/ld.so.conf

/usr/X11R6/lib/Xaw3d
/usr/X11R6/lib
/usr/lib/Xaw3d
/usr/i386-suse-linux/lib
/usr/local/lib
/opt/kde3/lib
include /etc/ld.so.conf.d/*.conf

(我碰巧经常使用 Suse,但有些东西也与 Debian 很相似)

步骤 12:运行,

ldconfig

第 13 步:现在您必须告诉 netsnmp 在哪里查找 MIB 文件。您可以使用 snmpconf 命令来执行此操作。在提示符处发出此命令。

snmpconf

这就是您屏幕上显示的内容,

我可以为您创建以下类型的配置文件。
选择您要创建的文件类型:
(运行该程序时可以创建多个)
1:snmpd.conf
2:snmptrapd.conf
3:snmp.conf
其他选项:退出

选择文件:3

可以放入snmp.conf的配置信息分为
分成几个部分。选择 snmp.conf 的配置部分
您想要创建的:
1:调试输出选项
2:文本mib解析
3:输出样式选项
4:默认身份验证选项
其他选项:完成

选择部分:完成

我可以为您创建以下类型的配置文件。
选择您要创建的文件类型:
(运行该程序时可以创建多个)
1:snmpd.conf
2:snmptrapd.conf
3:snmp.conf
其他选项:退出

选择文件:退出

创建了以下文件:
snmp.conf

如果您需要,这些文件应移至 /usr/local/share/snmp
希望系统上的每个人都使用它们。将来如果你加上
命令行的 -i 选项我会自动为您将它们复制到那里。

或者,如果您希望它们仅供个人使用,请将它们复制到
/root/.snmp 。将来,如果您将 -p 选项添加到
命令行 我会自动为您复制它们。

步骤 14:复制 snmp.conf 文件。

cp snmp.conf /usr/local/share/snmp/

第15步:最后试试这个。

snmptranslate -Tp -IR ipMIB

您将在屏幕上观察到树结构。
这意味着您安装的所有内容都可以正常工作

,因此现在由于配置而不会出现错误。
无论发生什么事情,都是你的责任;-)

干杯,

Additionally, there are few steps that need to be performed for installation from source.

Follow here,

Step 1: Log in as root (su - root)

Step 2: Navigate to the home folder where the net-snmp tar.gz is kept
Issue this command at the prompt

tar -zxvf net-snmp-5.5.tar.gz

(I still happen to use v 5.5. Change this with your version)

Step 3: Navigate to the un-tarred directory.

Step 4: Run ./configure

Step 5: make

Step 6: make install

Step 7: You now have netsnmp installed and ready to use.

Ha Ha .. not quite.. there are still lot of stuff that needs to be done before we can say...yep..thats working beautifully..

Step 8: Navigate to /usr/local/bin to see if the folder has a bunch of snmp stuff like snmpconf snmptranslate and so on...

Step 9: Also see if the /usr/local/share/snmp/mibs folder and see if all the MIB files are present..

Step 10: If everything is fine until here try to do some configurations checking (else start-over).
Run,

net-snmp-config --default-mibdirs

and you must get the output

/root/.snmp/mibs:/usr/local/share/snmp/mibs

Run,

net-snmp-config --snmpconfpath

output should be like

/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/root/.snmp:/var/net-snmp

Step 11: Run,

ldd /usr/local/bin/snmptranslate

output will be:

linux-gate.so.1 =>  (0x00110000)
       libnetsnmpagent.so.15 => not found
       libnetsnmphelpers.so.15 => not found
       libnetsnmpmibs.so.15 => not found
       libnetsnmp.so.15 => not found

This means that you might get snmp*: error while loading shared libraries:
like for example as mentioned above libnetsnmp.so.20: It cannot open shared object file.

If no error comes like above , no need to do anything, but if error comes, then, you have to do the steps below
Edit ld.so.conf in /etc and add the details of the lib path of /usr/local/lib and then run ldconfig

vi /etc/ld.so.conf

/usr/X11R6/lib/Xaw3d
/usr/X11R6/lib
/usr/lib/Xaw3d
/usr/i386-suse-linux/lib
/usr/local/lib
/opt/kde3/lib
include /etc/ld.so.conf.d/*.conf

(I happen to Use Suse a lot. But something is also very similar to Debian)

Step 12: Run,

ldconfig

Step 13: Now you have to tell netsnmp where to look for MIB files. You use the snmpconf command to do this. Issue this command at the prompt.

snmpconf

This is what it will appear on your screen,

I can create the following types of configuration files for you.
Select the file type you wish to create:
(you can create more than one as you run this program)
1: snmpd.conf
2: snmptrapd.conf
3: snmp.conf
Other options: quit

Select File: 3

The configuration information which can be put into snmp.conf is divided
into sections. Select a configuration section for snmp.conf
that you wish to create:
1: Debugging output options
2: Textual mib parsing
3: Output style options
4: Default Authentication Options
Other options: finished

Select section: finished

I can create the following types of configuration files for you.
Select the file type you wish to create:
(you can create more than one as you run this program)
1: snmpd.conf
2: snmptrapd.conf
3: snmp.conf
Other options: quit

Select File: quit

The following files were created:
snmp.conf

These files should be moved to /usr/local/share/snmp if you
want them used by everyone on the system. In the future, if you add
the -i option to the command line I'll copy them there automatically for you.

Or, if you want them for your personal use only, copy them to
/root/.snmp . In the future, if you add the -p option to the
command line I'll copy them there automatically for you.

Step 14: Copy the snmp.conf file.

cp snmp.conf /usr/local/share/snmp/

Step 15: Finally try this.

snmptranslate -Tp -IR ipMIB

You will observe a tree structure on your screen.
This means that everything that you have installed is working

So now the errors are not going to be there because of configuration..
whatever gets screwed up , its your responsibilty ;-)

Cheers,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文