LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-20-2014, 03:49 AM   #1
icy1900
LQ Newbie
 
Registered: Jun 2014
Location: China
Posts: 2

Rep: Reputation: Disabled
couldn't get data through snmp from remote machine


brief: I have configured net-snmp on a centos Linux server , but the data couldn't be collected from remote host,the network connecttion has no problem , and also the firewall ,the snmp log shows there was remote machine connectted 。but on the contract, I could get info through snmp on the server itself using the exactly same command-line.

I have configured net-snmp on a CentOS Linux 5.10 server (For simplicity call it __Machine A__), the configuration info is

Code:
    com2sec notConfigUser  default       ibccdg
    group   notConfigGroup v2c           notConfigUser
    view    systemview    included   .1.3.6.1.2.1.1
    view    systemview    included   .1.3.6.1.2.1.25.1.1
    access  notConfigGroup ""      any       noauth    exact  systemview none none
    syslocation Unknown (edit /etc/snmp/snmpd.conf)
    syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
    pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
    rouser jkb
I wasn't quite familliar with SNMP, since what I need is SNMPv3,it seems the front five lines was useless。
I exec the below command-line on machine A

Code:
    # snmpwalk  -v 3 -l authNoPriv -a MD5 -u user -A password X.X.X.X:161 sysDescr
    SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64
It works just fine,but the completely same command-line does not work on the other machines(the ip in the above command-line is a public ip) ,it respones an error

Quote:
No log handling enabled - turning on stderr logging
snmpwalk: Timeout (Sub-id not found: (top) -> sysDescr)
even I have turned off the iptables , and the SELinux was not enabled。On an other CentOS Linux 5.6 machine (For simplicity call it __Machine B__), it also have net-snmp configured, and there is no any problem。So I try to copy the configuration of net-snmp on the Machine B (/etc/snmp/snmpd.conf and the configure file under /var/net-snmp etc) to Machine A,So there is no difference in the configuration of net-snmp on the two machine ,but this does not solve the problem, I counld gather info by use snmpwalk command-line on Machine A,but the same command-line does not work out on the other machine,still shows error just like before

Quote:
"snmpwalk: Timeout (Sub-id not found: (top) -> sysDescr)
I have tried to use SNMPv2 , it get an error too.

Quote:
"snmp Timeout: No Response from X.X.X.X"
software inforamtion
- on machine B

Code:
        -bash-3.2# rpm -qa | grep snmp
        net-snmp-5.3.2.2-17.el5_8.1
        net-snmp-devel-5.3.2.2-17.el5_8.1
        net-snmp-libs-5.3.2.2-17.el5_8.1
        net-snmp-devel-5.3.2.2-17.el5_8.1
        net-snmp-libs-5.3.2.2-17.el5_8.1
        net-snmp-utils-5.3.2.2-17.el5_8.1
        -bash-3.2# ls /var/net-snmp/
        snmpd.conf
        -bash-3.2# ls /var/net-snmp/ -a
        .  ..  snmpd.conf  .snmp-exec-cache
        -bash-3.2# cat /etc/redhat-release 
        CentOS release 5.6 (Final)
- on machine A

Code:
        [root@localhost snmp]# rpm -qa | grep snmp
        net-snmp-libs-5.3.2.2-20.el5
        net-snmp-libs-5.3.2.2-20.el5
        net-snmp-devel-5.3.2.2-20.el5
        net-snmp-utils-5.3.2.2-20.el5
        net-snmp-5.3.2.2-20.el5
        net-snmp-devel-5.3.2.2-20.el5
        [root@localhost snmp]# cat /etc/redhat-release 
        CentOS release 5.10 (Final)
I have tried to use `snmpd -f -Le` to get more debug information,but this doesn't give much useful info, except

Quote:
Duplicate IP address detected, some interfaces may not be visible in IP-MIB

I didn't quite realize what dose it means,On the machine A, there is a sub-interface: eth0:1, so the machine A has two IP on it's eth0。

Any help would be appreciated !
 
Old 06-20-2014, 12:09 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
For what it's worth, I use the exact same snmp.conf on every host I need to grab snmp data from.
This has never failed me.

Can you get data from the troubled hosts using
Code:
snmpwalk  -v 3 -l authNoPriv -a MD5 -u user -A password localhost

Last edited by Habitual; 06-20-2014 at 12:10 PM.
 
Old 06-24-2014, 01:46 AM   #3
icy1900
LQ Newbie
 
Registered: Jun 2014
Location: China
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
For what it's worth, I use the exact same snmp.conf on every host I need to grab snmp data from.
This has never failed me.

Can you get data from the troubled hosts using
Code:
snmpwalk  -v 3 -l authNoPriv -a MD5 -u user -A password localhost
-------------------------------------------------------------------------------------------------------------------------------

I can get data from the troubled hosts using
Code:
snmpwalk  -v 3 -l authNoPriv -a MD5 -u user -A password localhost
as I can get data from the troubled hosts using

Code:
snmpwalk  -v 3 -l authNoPriv -a MD5 -u user -A password public-ip:161 sysDescr
Certainly I can get data from a loopback interface

Last edited by icy1900; 06-24-2014 at 01:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to know the remote machine is Virtual machine or physical machine pantdk Linux - Server 19 10-16-2014 01:48 PM
data shift from 1 remote machine to another remote machine raheelch General 7 03-09-2010 08:44 AM
snmp is not working on remote host machine renuaseri Linux - Newbie 2 06-16-2009 09:25 AM
gdb Couldn't establish connection to remote target powah Linux - Software 0 03-21-2006 03:59 PM
VSFTP - SFTP error: Couldn't get remote handle. m0untaind0g Linux - Networking 3 01-20-2004 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration